Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
431b489
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 10, 2025
d8e3477
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
b96b830
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
d169364
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
5e6ab08
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
0af6fa5
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
1957f11
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
db82950
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
008eda4
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
843be56
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
3e06d33
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
e48a57a
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 13, 2025
76d2c82
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 14, 2025
bda5c2f
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 14, 2025
5da2cc8
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 14, 2025
fc9b6de
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 15, 2025
dd31d2f
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 15, 2025
9a1fca8
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 16, 2025
e0a37aa
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 16, 2025
6fc4de9
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 16, 2025
c1f393f
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 16, 2025
a4ea17e
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 16, 2025
5b6b462
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 16, 2025
2341ec1
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 17, 2025
5989f77
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 17, 2025
81106fb
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 17, 2025
47526df
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 17, 2025
9b33289
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 19, 2025
5b7e1ce
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 19, 2025
b89bbe9
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
c7f7413
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
f39f978
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
93fa825
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
933b4d7
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
d3c9343
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
59737fa
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
52a1dca
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
6a24eab
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
6d6b788
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
8461a1d
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 20, 2025
e2baec3
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 21, 2025
d850576
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 21, 2025
8d2ef5e
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 21, 2025
aa6e98d
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 21, 2025
543a1d3
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 21, 2025
9e2e0d1
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 21, 2025
0de933c
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 22, 2025
b5ff879
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 22, 2025
0472efe
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 22, 2025
cbf2790
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 22, 2025
085a529
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 22, 2025
df0acc3
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 23, 2025
7ea6fbc
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 23, 2025
876267c
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 27, 2025
8ddd9a3
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 27, 2025
00de02f
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 27, 2025
50ef5ce
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 27, 2025
a824b9a
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 27, 2025
2c564bb
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 27, 2025
59abf04
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 28, 2025
dfc57c4
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 28, 2025
26efb90
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 28, 2025
1099aef
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 28, 2025
bb88bba
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 28, 2025
6b27991
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 29, 2025
08fc1fd
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 29, 2025
a129e23
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 29, 2025
291e441
HHH-19846 Drop JUnit 4 usage
dreab8 Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
package org.hibernate.community.dialect;

import org.hibernate.orm.test.sql.hand.custom.CustomStoredProcTestSupport;

import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.RequiresDialect;


/**
* @author Andrea Boriero
*/
@RequiresDialect(DerbyDialect.class)
@DomainModel(
xmlMappings = "org/hibernate/orm/test/derby/Mappings.hbm.xml"
)
public class DerbyCustomSQLTest extends CustomStoredProcTestSupport {
public String[] getMappings() {
return new String[] {"derby/Mappings.hbm.xml"};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.orm.test.annotations;

import java.io.Serializable;
import java.util.Collection;
import java.util.SortedSet;
Expand Down Expand Up @@ -31,7 +32,7 @@ public class Customer implements Serializable {
Long id;
String name;
SortedSet<Ticket> tickets;
Collection discountTickets;
Collection<Discount> discountTickets;
Passport passport;

public Customer() {
Expand Down Expand Up @@ -69,11 +70,11 @@ public void setTickets(SortedSet<Ticket> tickets) {
@OneToMany(targetEntity = Discount.class,
cascade = CascadeType.ALL, mappedBy = "owner")
@Cascade({ALL})
public Collection getDiscountTickets() {
public Collection<Discount> getDiscountTickets() {
return discountTickets;
}

public void setDiscountTickets(Collection collection) {
public void setDiscountTickets(Collection<Discount> collection) {
discountTickets = collection;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.orm.test.annotations;

import java.io.Serializable;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.orm.test.annotations;

import java.io.Serializable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.orm.test.annotations;

import java.io.Serializable;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand Down Expand Up @@ -43,13 +44,9 @@ public void setNumber(String string) {

public boolean equals(Object o) {
if ( this == o ) return true;
if ( !( o instanceof Ticket ) ) return false;

final Ticket ticket = (Ticket) o;

if ( !number.equals( ticket.number ) ) return false;
if ( !(o instanceof Ticket ticket) ) return false;

return true;
return number.equals( ticket.number );
}

public int hashCode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@
import org.hibernate.boot.registry.BootstrapServiceRegistry;
import org.hibernate.boot.registry.BootstrapServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.testing.orm.junit.BaseUnitTest;
import org.junit.jupiter.api.Test;

import org.junit.Assert;
import org.junit.Test;
import static org.assertj.core.api.Fail.fail;

/**
* @author Emmanuel Bernard
*/
@BaseUnitTest
public class ConfigurationTest {
@Test
public void testMixPackageAndResourceOrdering() throws Exception {
public void testMixPackageAndResourceOrdering() {
try (BootstrapServiceRegistry serviceRegistry = new BootstrapServiceRegistryBuilder().build()) {
Configuration config = new Configuration( serviceRegistry );
config.addResource( "org/hibernate/orm/test/annotations/configuration/orm.xml" );
config.addPackage( "org.hibernate.orm/test.annotations.configuration" );
}
catch( Exception e ) {
Assert.fail( "Processing package first when ORM.xml is used should not fail" );
fail( "Processing package first when ORM.xml is used should not fail" );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,83 @@
*/
package org.hibernate.orm.test.annotations.derivedidentities.e1.b;

import org.hibernate.Session;

import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.orm.test.util.SchemaUtil;
import org.junit.Test;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

/**
* @author Emmanuel Bernard
*/
public class DerivedIdentitySimpleParentEmbeddedIdDepTest extends BaseNonConfigCoreFunctionalTestCase {
@Test
public void testManyToOne() throws Exception {
assertTrue( SchemaUtil.isColumnPresent( "Dependent", "emp_empId", metadata() ) );
assertTrue( ! SchemaUtil.isColumnPresent( "Dependent", "empPK", metadata() ) );

Employee e = new Employee();
e.empId = 1;
e.empName = "Emmanuel";
Session s = openSession( );
s.getTransaction().begin();
@SessionFactory
@DomainModel(
annotatedClasses = {
Dependent.class,
Employee.class,
ExclusiveDependent.class
}
)
public class DerivedIdentitySimpleParentEmbeddedIdDepTest {

Dependent d = new Dependent();
d.emp = e;
d.id = new DependentId();
d.id.name = "Doggy";
s.persist( d );
s.persist( e );
s.flush();
s.clear();
d = (Dependent) s.get( Dependent.class, d.id );
assertEquals( d.id.empPK, d.emp.empId );
s.getTransaction().rollback();
s.close();
@AfterEach
public void tearDown(SessionFactoryScope scope) {
scope.getSessionFactory().getSchemaManager().truncateMappedObjects();
}

@Test
public void testOneToOne() throws Exception {
assertTrue( SchemaUtil.isColumnPresent( "ExclusiveDependent", "FK", metadata() ) );
assertTrue( ! SchemaUtil.isColumnPresent( "ExclusiveDependent", "empPK", metadata() ) );
public void testManyToOne(SessionFactoryScope scope) {
MetadataImplementor metadata = scope.getMetadataImplementor();
assertThat( SchemaUtil.isColumnPresent( "Dependent", "emp_empId", metadata ) ).isTrue();
assertThat( !SchemaUtil.isColumnPresent( "Dependent", "empPK", metadata ) ).isTrue();

Employee e = new Employee();
e.empId = 1;
e.empName = "Emmanuel";
Session s = openSession( );
s.getTransaction().begin();
s.persist( e );
ExclusiveDependent d = new ExclusiveDependent();
d.emp = e;
d.id = new DependentId();
d.id.name = "Doggy";
//d.id.empPK = e.empId; //FIXME not needed when foreign is enabled
s.persist( d );
s.flush();
s.clear();
d = (ExclusiveDependent) s.get( ExclusiveDependent.class, d.id );
assertEquals( d.id.empPK, d.emp.empId );
s.getTransaction().rollback();
s.close();
scope.inTransaction(
session -> {
Employee e = new Employee();
e.empId = 1;
e.empName = "Emmanuel";
Dependent d = new Dependent();
d.emp = e;
d.id = new DependentId();
d.id.name = "Doggy";
session.persist( d );
session.persist( e );
session.flush();
session.clear();
d = session.find( Dependent.class, d.id );
assertThat( d.emp.empId ).isEqualTo( d.id.empPK );
}
);
}

@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] {
Dependent.class,
Employee.class,
ExclusiveDependent.class
};
@Test
public void testOneToOne(SessionFactoryScope scope) {
MetadataImplementor metadata = scope.getMetadataImplementor();
assertThat( SchemaUtil.isColumnPresent( "ExclusiveDependent", "FK", metadata ) ).isTrue();
assertThat( !SchemaUtil.isColumnPresent( "ExclusiveDependent", "empPK", metadata ) ).isTrue();

scope.inTransaction(
session -> {
Employee e = new Employee();
e.empId = 1;
e.empName = "Emmanuel";
session.persist( e );
ExclusiveDependent d = new ExclusiveDependent();
d.emp = e;
d.id = new DependentId();
d.id.name = "Doggy";
//d.id.empPK = e.empId; //FIXME not needed when foreign is enabled
session.persist( d );
session.flush();
session.clear();
d = session.find( ExclusiveDependent.class, d.id );
assertThat( d.emp.empId ).isEqualTo( d.id.empPK );
}
);
}

}
Loading
Loading