spaces to tabs!

This commit is contained in:
Gavin King 2024-09-16 10:54:40 +02:00
parent 27db2668b4
commit bbc325c26f
1040 changed files with 31203 additions and 31207 deletions

View File

@ -285,10 +285,8 @@ public abstract class AbstractPersistentCollection<E> implements Serializable, P
} }
} }
else { else {
/* // Whenever the collection lazy loading is triggered during the loading process,
Whenever the collection lazy loading is triggered during the loading process, // closing the connection will cause an error when RowProcessingStateStandardImpl#next() will be called.
closing the connection will cause an error when RowProcessingStateStandardImpl#next() will be called.
*/
final PersistenceContext persistenceContext = session.getPersistenceContext(); final PersistenceContext persistenceContext = session.getPersistenceContext();
if ( !session.isTransactionInProgress() if ( !session.isTransactionInProgress()
&& ( !persistenceContext.hasLoadContext() && ( !persistenceContext.hasLoadContext()

View File

@ -1646,7 +1646,6 @@ public abstract class Dialect implements ConversionContext, TypeContributor, Fun
* <p> * <p>
* An implementation may set configuration properties from * An implementation may set configuration properties from
* {@link #initDefaultProperties()}, though it is discouraged. * {@link #initDefaultProperties()}, though it is discouraged.
the
* @return the Hibernate configuration properties * @return the Hibernate configuration properties
* *
* @see #initDefaultProperties() * @see #initDefaultProperties()

View File

@ -12,7 +12,7 @@ import org.hibernate.LockMode;
import org.hibernate.LockOptions; import org.hibernate.LockOptions;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
/** /**
* A locking strategy where an optimistic lock is obtained via a select * A locking strategy where an optimistic lock is obtained via a select
* statement. * statement.
* <p> * <p>

View File

@ -1639,7 +1639,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V>
} }
} }
/* /**
* This class is needed for JDK5 compatibility. * This class is needed for JDK5 compatibility.
*/ */
static class SimpleEntry<K, V> implements Entry<K, V>, Serializable { static class SimpleEntry<K, V> implements Entry<K, V>, Serializable {

View File

@ -16,7 +16,6 @@ import org.hibernate.query.QueryParameter;
import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.type.spi.TypeConfiguration;
/** /**
/**
* The value/type binding information for a particular query parameter. Supports * The value/type binding information for a particular query parameter. Supports
* both single-valued and multivalued binds * both single-valued and multivalued binds
* *

View File

@ -12,8 +12,8 @@ import jakarta.persistence.MappedSuperclass;
@MappedSuperclass @MappedSuperclass
public abstract class BaseMappedSuperclass { public abstract class BaseMappedSuperclass {
@Id @Id
protected Long id; protected Long id;
protected long value; protected long value;
} }

View File

@ -19,25 +19,25 @@ import org.junit.Test;
public class CompositeKeyDeleteTest extends BaseCoreFunctionalTestCase { public class CompositeKeyDeleteTest extends BaseCoreFunctionalTestCase {
@Override @Override
protected String getBaseForMappings() { protected String getBaseForMappings() {
return ""; return "";
} }
@Override @Override
public String[] getMappings() { public String[] getMappings() {
return new String[] { "org/hibernate/orm/test/annotations/derivedidentities/e1/b/specjmapid/lazy/order_orm.xml" }; return new String[] { "org/hibernate/orm/test/annotations/derivedidentities/e1/b/specjmapid/lazy/order_orm.xml" };
} }
public CompositeKeyDeleteTest() { public CompositeKeyDeleteTest() {
System.setProperty( "hibernate.enable_specj_proprietary_syntax", "true" ); System.setProperty( "hibernate.enable_specj_proprietary_syntax", "true" );
} }
/** /**
* This test checks to make sure the non null column is not updated with a * This test checks to make sure the non null column is not updated with a
* null value when a CustomerInventory is removed. * null value when a CustomerInventory is removed.
*/ */
@Test @Test
public void testRemove() { public void testRemove() {
Session s = openSession(); Session s = openSession();
Transaction tx = s.beginTransaction(); Transaction tx = s.beginTransaction();
@ -94,10 +94,10 @@ public class CompositeKeyDeleteTest extends BaseCoreFunctionalTestCase {
tx.commit();//fail tx.commit();//fail
s.close(); s.close();
} }
@Override @Override
protected Class[] getAnnotatedClasses() { protected Class[] getAnnotatedClasses() {
return new Class[] { return new Class[] {
CustomerTwo.class, CustomerTwo.class,
CustomerInventoryTwo.class, CustomerInventoryTwo.class,
@ -105,5 +105,5 @@ public class CompositeKeyDeleteTest extends BaseCoreFunctionalTestCase {
Item.class Item.class
}; };
} }
} }

View File

@ -35,79 +35,79 @@ import org.hibernate.orm.test.annotations.derivedidentities.e1.b.specjmapid.Item
public class CustomerInventoryTwo implements Serializable, public class CustomerInventoryTwo implements Serializable,
Comparator<CustomerInventoryTwo> { Comparator<CustomerInventoryTwo> {
@Id @Id
@TableGenerator(name = "inventory", table = "U_SEQUENCES", pkColumnName = "S_ID", valueColumnName = "S_NEXTNUM", pkColumnValue = "inventory", allocationSize = 1000) @TableGenerator(name = "inventory", table = "U_SEQUENCES", pkColumnName = "S_ID", valueColumnName = "S_NEXTNUM", pkColumnValue = "inventory", allocationSize = 1000)
@GeneratedValue(strategy = GenerationType.TABLE, generator = "inventory") @GeneratedValue(strategy = GenerationType.TABLE, generator = "inventory")
@Column(name = "CI_ID") @Column(name = "CI_ID")
private Integer id; private Integer id;
@Id @Id
@Column(name = "CI_CUSTOMERID", insertable = false, updatable = false) @Column(name = "CI_CUSTOMERID", insertable = false, updatable = false)
private int custId; private int custId;
@ManyToOne(cascade = CascadeType.MERGE) @ManyToOne(cascade = CascadeType.MERGE)
@JoinColumn(name = "CI_CUSTOMERID", nullable = false) @JoinColumn(name = "CI_CUSTOMERID", nullable = false)
private CustomerTwo customer; private CustomerTwo customer;
@ManyToOne(cascade = CascadeType.MERGE) @ManyToOne(cascade = CascadeType.MERGE)
@JoinColumn(name = "CI_ITEMID") @JoinColumn(name = "CI_ITEMID")
private Item vehicle; private Item vehicle;
@Column(name = "CI_VALUE") @Column(name = "CI_VALUE")
private BigDecimal totalCost; private BigDecimal totalCost;
@Column(name = "CI_QUANTITY") @Column(name = "CI_QUANTITY")
private int quantity; private int quantity;
@Version @Version
@Column(name = "CI_VERSION") @Column(name = "CI_VERSION")
private int version; private int version;
protected CustomerInventoryTwo() { protected CustomerInventoryTwo() {
} }
CustomerInventoryTwo(CustomerTwo customer, Item vehicle, int quantity, CustomerInventoryTwo(CustomerTwo customer, Item vehicle, int quantity,
BigDecimal totalValue) { BigDecimal totalValue) {
this.customer = customer; this.customer = customer;
this.vehicle = vehicle; this.vehicle = vehicle;
this.quantity = quantity; this.quantity = quantity;
this.totalCost = totalValue; this.totalCost = totalValue;
} }
public Item getVehicle() { public Item getVehicle() {
return vehicle; return vehicle;
} }
public BigDecimal getTotalCost() { public BigDecimal getTotalCost() {
return totalCost; return totalCost;
} }
public int getQuantity() { public int getQuantity() {
return quantity; return quantity;
} }
public Integer getId() { public Integer getId() {
return id; return id;
} }
public CustomerTwo getCustomer() { public CustomerTwo getCustomer() {
return customer; return customer;
} }
public int getCustId() { public int getCustId() {
return custId; return custId;
} }
public int getVersion() { public int getVersion() {
return version; return version;
} }
public int compare(CustomerInventoryTwo cdb1, CustomerInventoryTwo cdb2) { public int compare(CustomerInventoryTwo cdb1, CustomerInventoryTwo cdb2) {
return cdb1.id.compareTo(cdb2.id); return cdb1.id.compareTo(cdb2.id);
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == this) { if (obj == this) {
return true; return true;
} }
@ -125,6 +125,6 @@ public class CustomerInventoryTwo implements Serializable,
} }
return this.id.equals(((CustomerInventoryTwo) obj).id); return this.id.equals(((CustomerInventoryTwo) obj).id);
} }
} }

View File

@ -10,18 +10,18 @@ import java.io.Serializable;
public class CustomerInventoryTwoPK implements Serializable { public class CustomerInventoryTwoPK implements Serializable {
private Integer id; private Integer id;
private int custId; private int custId;
public CustomerInventoryTwoPK() { public CustomerInventoryTwoPK() {
} }
public CustomerInventoryTwoPK(Integer id, int custId) { public CustomerInventoryTwoPK(Integer id, int custId) {
this.id = id; this.id = id;
this.custId = custId; this.custId = custId;
} }
public boolean equals(Object other) { public boolean equals(Object other) {
if ( other == this ) { if ( other == this ) {
return true; return true;
} }
@ -31,19 +31,19 @@ public class CustomerInventoryTwoPK implements Serializable {
CustomerInventoryTwoPK cip = ( CustomerInventoryTwoPK ) other; CustomerInventoryTwoPK cip = ( CustomerInventoryTwoPK ) other;
return ( custId == cip.custId && ( id == cip.id || return ( custId == cip.custId && ( id == cip.id ||
( id != null && id.equals( cip.id ) ) ) ); ( id != null && id.equals( cip.id ) ) ) );
} }
public int hashCode() { public int hashCode() {
return ( id == null ? 0 : id.hashCode() ) ^ custId; return ( id == null ? 0 : id.hashCode() ) ^ custId;
} }
public Integer getId() { public Integer getId() {
return id; return id;
} }
public int getCustId() { public int getCustId() {
return custId; return custId;
} }
} }

View File

@ -17,14 +17,14 @@ import jakarta.persistence.Version;
@NamedQueries( { @NamedQueries( {
@NamedQuery(name = "Item.findByCategory", @NamedQuery(name = "Item.findByCategory",
query = "SELECT i FROM Item i WHERE i.category=:category ORDER BY i.id")}) query = "SELECT i FROM Item i WHERE i.category=:category ORDER BY i.id")})
@SuppressWarnings("serial") @SuppressWarnings("serial")
@Entity @Entity
@Table(name = "O_ITEM") @Table(name = "O_ITEM")
public class Item implements Serializable public class Item implements Serializable
{ {
public static final String QUERY_BY_CATEGORY = "Item.findByCategory"; public static final String QUERY_BY_CATEGORY = "Item.findByCategory";

View File

@ -25,55 +25,55 @@ import org.hibernate.annotations.GenericGenerator;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class Multiple implements Serializable public class Multiple implements Serializable
{ {
@Id @Id
@GenericGenerator(name = "increment", strategy = "increment") @GenericGenerator(name = "increment", strategy = "increment")
@GeneratedValue(generator = "increment") @GeneratedValue(generator = "increment")
private Long id1; private Long id1;
@Id @Id
@GeneratedValue(generator = "MULTIPLE_SEQ", strategy = GenerationType.SEQUENCE) @GeneratedValue(generator = "MULTIPLE_SEQ", strategy = GenerationType.SEQUENCE)
@SequenceGenerator( name = "MULTIPLE_SEQ", sequenceName = "MULTIPLE_SEQ") @SequenceGenerator( name = "MULTIPLE_SEQ", sequenceName = "MULTIPLE_SEQ")
private Long id2; private Long id2;
@Id @Id
private Long id3; private Long id3;
private int quantity; private int quantity;
public Multiple() public Multiple()
{ {
} }
public Multiple(Long id3, int quantity) public Multiple(Long id3, int quantity)
{ {
this.id3 = id3; this.id3 = id3;
this.quantity = quantity; this.quantity = quantity;
} }
public Long getId1() public Long getId1()
{ {
return id1; return id1;
} }
public Long getId2() public Long getId2()
{ {
return id2; return id2;
} }
public Long getId3() public Long getId3()
{ {
return id3; return id3;
} }
public int getQuantity() public int getQuantity()
{ {
return quantity; return quantity;
} }
public void setQuantity(int quantity) public void setQuantity(int quantity)
{ {
this.quantity = quantity; this.quantity = quantity;
} }
} }

View File

@ -14,50 +14,50 @@ import java.io.Serializable;
*/ */
public class MultiplePK implements Serializable public class MultiplePK implements Serializable
{ {
private final Long id1; private final Long id1;
private final Long id2; private final Long id2;
private final Long id3; private final Long id3;
// AnnotationSourceProcessor (incorrectly) requires this to be transient; see HHH-4819 and HHH-4820 // AnnotationSourceProcessor (incorrectly) requires this to be transient; see HHH-4819 and HHH-4820
private final transient int cachedHashCode; private final transient int cachedHashCode;
private MultiplePK() private MultiplePK()
{ {
id1 = null; id1 = null;
id2 = null; id2 = null;
id3 = null; id3 = null;
cachedHashCode = super.hashCode(); cachedHashCode = super.hashCode();
} }
public MultiplePK(Long id1, Long id2, Long id3) public MultiplePK(Long id1, Long id2, Long id3)
{ {
this.id1 = id1; this.id1 = id1;
this.id2 = id2; this.id2 = id2;
this.id3 = id3; this.id3 = id3;
this.cachedHashCode = calculateHashCode(); this.cachedHashCode = calculateHashCode();
} }
private int calculateHashCode() { private int calculateHashCode() {
int result = id1.hashCode(); int result = id1.hashCode();
result = 31 * result + id2.hashCode(); result = 31 * result + id2.hashCode();
return result; return result;
} }
public Long getId1() { public Long getId1() {
return id1; return id1;
} }
public Long getId2() { public Long getId2() {
return id2; return id2;
} }
public Long getId3() { public Long getId3() {
return id3; return id3;
} }
@Override @Override
public boolean equals(Object o) public boolean equals(Object o)
{ {
if ( this == o ) { if ( this == o ) {
return true; return true;
} }
@ -71,10 +71,10 @@ public class MultiplePK implements Serializable
return id1.equals( multiplePK.id1 ) return id1.equals( multiplePK.id1 )
&& id2.equals( multiplePK.id2 ) && id2.equals( multiplePK.id2 )
&& id3.equals( multiplePK.id3); && id3.equals( multiplePK.id3);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return cachedHashCode; return cachedHashCode;
} }
} }

View File

@ -11,7 +11,7 @@ import jakarta.persistence.ManyToOne;
@Embeddable @Embeddable
public class JobInfo { public class JobInfo {
String jobDescription; String jobDescription;
ProgramManager pm; // Bidirectional ProgramManager pm; // Bidirectional
public String getJobDescription() { public String getJobDescription() {

View File

@ -23,7 +23,7 @@ import org.hibernate.annotations.Formula;
@FieldResult(name = "tableName", column = "t_name"), @FieldResult(name = "tableName", column = "t_name"),
@FieldResult(name = "daysOld", column = "t_time") @FieldResult(name = "daysOld", column = "t_time")
})) }))
public class AllTables { public class AllTables {
@Id @Id
@Column(name = "table_name", nullable = false) @Column(name = "table_name", nullable = false)
@ -48,4 +48,4 @@ import org.hibernate.annotations.Formula;
public void setDaysOld(String daysOld) { public void setDaysOld(String daysOld) {
this.daysOld = daysOld; this.daysOld = daysOld;
} }
} }

View File

@ -11,11 +11,11 @@ package org.hibernate.orm.test.annotations.xml.hbm;
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
public interface Z extends java.io.Serializable { public interface Z extends java.io.Serializable {
public Integer getZId(); public Integer getZId();
public void setZId(Integer zId); public void setZId(Integer zId);
public B getB(); public B getB();
public void setB(B b); public void setB(B b);
} }

View File

@ -42,7 +42,7 @@ public class PropertyRepository {
@JoinTable(name = "repository_properties", @JoinTable(name = "repository_properties",
joinColumns = @JoinColumn(name = "repository_id"), joinColumns = @JoinColumn(name = "repository_id"),
inverseJoinColumns = @JoinColumn(name = "property_id") inverseJoinColumns = @JoinColumn(name = "property_id")
) )
private List<Property<?>> properties = new ArrayList<>(); private List<Property<?>> properties = new ArrayList<>();
//Getters and setters are omitted for brevity //Getters and setters are omitted for brevity

View File

@ -13,42 +13,42 @@ import jakarta.persistence.OneToOne;
@Entity @Entity
public class A { public class A {
@Id @Id
private Integer id; private Integer id;
private String otherProperty; private String otherProperty;
@OneToOne(fetch = FetchType.LAZY) @OneToOne(fetch = FetchType.LAZY)
private B b; private B b;
public A() { public A() {
} }
public A(Integer id) { public A(Integer id) {
this.id = id; this.id = id;
} }
public Integer getId() { public Integer getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getOtherProperty() { public String getOtherProperty() {
return otherProperty; return otherProperty;
} }
public void setOtherProperty(String otherProperty) { public void setOtherProperty(String otherProperty) {
this.otherProperty = otherProperty; this.otherProperty = otherProperty;
} }
public B getB() { public B getB() {
return b; return b;
} }
public void setB(B b) { public void setB(B b) {
this.b = b; this.b = b;
} }
} }

View File

@ -17,43 +17,43 @@ import jakarta.persistence.IdClass;
@BatchSize(size = 1000) @BatchSize(size = 1000)
public class B { public class B {
@Id @Id
private Integer idPart1; private Integer idPart1;
@Id @Id
private Integer idPart2; private Integer idPart2;
private String otherProperty; private String otherProperty;
public B() { public B() {
} }
public B(Integer idPart1, Integer idPart2) { public B(Integer idPart1, Integer idPart2) {
this.idPart1 = idPart1; this.idPart1 = idPart1;
this.idPart2 = idPart2; this.idPart2 = idPart2;
} }
public Integer getIdPart1() { public Integer getIdPart1() {
return idPart1; return idPart1;
} }
public void setIdPart1(Integer idPart1) { public void setIdPart1(Integer idPart1) {
this.idPart1 = idPart1; this.idPart1 = idPart1;
} }
public Integer getIdPart2() { public Integer getIdPart2() {
return idPart2; return idPart2;
} }
public void setIdPart2(Integer idPart2) { public void setIdPart2(Integer idPart2) {
this.idPart2 = idPart2; this.idPart2 = idPart2;
} }
public String getOtherProperty() { public String getOtherProperty() {
return otherProperty; return otherProperty;
} }
public void setOtherProperty(String otherProperty) { public void setOtherProperty(String otherProperty) {
this.otherProperty = otherProperty; this.otherProperty = otherProperty;
} }
} }

View File

@ -10,37 +10,37 @@ import java.io.Serializable;
public class BId public class BId
implements Serializable { implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer idPart1; private Integer idPart1;
private Integer idPart2; private Integer idPart2;
public BId() { public BId() {
} }
public BId(Integer idPart1, Integer idPart2) { public BId(Integer idPart1, Integer idPart2) {
this.idPart1 = idPart1; this.idPart1 = idPart1;
this.idPart2 = idPart2; this.idPart2 = idPart2;
} }
public Integer getIdPart1() { public Integer getIdPart1() {
return idPart1; return idPart1;
} }
public void setIdPart1(Integer idPart1) { public void setIdPart1(Integer idPart1) {
this.idPart1 = idPart1; this.idPart1 = idPart1;
} }
public Integer getIdPart2() { public Integer getIdPart2() {
return idPart2; return idPart2;
} }
public void setIdPart2(Integer idPart2) { public void setIdPart2(Integer idPart2) {
this.idPart2 = idPart2; this.idPart2 = idPart2;
} }
@Override @Override
public String toString() { public String toString() {
return "BId (" + idPart1 + ", " + idPart2 + ")"; return "BId (" + idPart1 + ", " + idPart2 + ")";
} }
} }

View File

@ -585,7 +585,7 @@ public class BootstrapTest {
value= "MANUAL" value= "MANUAL"
) )
} }
) )
private EntityManager entityManager; private EntityManager entityManager;
//end::bootstrap-jpa-compliant-PersistenceContext-configurable-example[] //end::bootstrap-jpa-compliant-PersistenceContext-configurable-example[]

View File

@ -8,13 +8,13 @@ package org.hibernate.orm.test.cache.hhh13179;
public abstract class DiscriminatorSubclassPerson { public abstract class DiscriminatorSubclassPerson {
private Long oid; private Long oid;
public Long getOid() { public Long getOid() {
return oid; return oid;
} }
public void setOid(Long oid) { public void setOid(Long oid) {
this.oid = oid; this.oid = oid;
} }
} }

View File

@ -8,13 +8,13 @@ package org.hibernate.orm.test.cache.hhh13179;
public abstract class JoinedSubclassPerson { public abstract class JoinedSubclassPerson {
private Long oid; private Long oid;
public Long getOid() { public Long getOid() {
return oid; return oid;
} }
public void setOid(Long oid) { public void setOid(Long oid) {
this.oid = oid; this.oid = oid;
} }
} }

View File

@ -8,13 +8,13 @@ package org.hibernate.orm.test.cache.hhh13179;
public abstract class UnionSubclassPerson { public abstract class UnionSubclassPerson {
private Long oid; private Long oid;
public Long getOid() { public Long getOid() {
return oid; return oid;
} }
public void setOid(Long oid) { public void setOid(Long oid) {
this.oid = oid; this.oid = oid;
} }
} }

View File

@ -19,7 +19,7 @@ import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
/** /**
@author Vlad Mihalcea @author Vlad Mihalcea
*/ */
@RequiresDialect( HSQLDialect.class ) @RequiresDialect( HSQLDialect.class )
public class HSQLTruncFunctionTest extends BaseEntityManagerFunctionalTestCase { public class HSQLTruncFunctionTest extends BaseEntityManagerFunctionalTestCase {

View File

@ -19,7 +19,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
/** /**
@author Strong Liu @author Strong Liu
*/ */
@RequiresDialect( MySQLDialect.class ) @RequiresDialect( MySQLDialect.class )
public class MySQLRoundFunctionTest extends BaseCoreFunctionalTestCase { public class MySQLRoundFunctionTest extends BaseCoreFunctionalTestCase {

View File

@ -14,7 +14,7 @@ import jakarta.persistence.Id;
*/ */
@Entity @Entity
public class Author { public class Author {
@Id @GeneratedValue @Id @GeneratedValue
private Long id; private Long id;
} }

View File

@ -20,5 +20,5 @@ public class WorkOrder implements Serializable {
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "workOrder") @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "workOrder")
@OrderBy("operation, bomItemNumber") @OrderBy("operation, bomItemNumber")
private Set<WorkOrderComponent> components; private Set<WorkOrderComponent> components;
/* other stuffs */ /* other stuffs */
} }

View File

@ -12,25 +12,25 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Company extends Party { public class Company extends Party {
String id; String id;
String president; String president;
String getId() { String getId() {
return id; return id;
} }
void setId(String newValue) { void setId(String newValue) {
id = newValue; id = newValue;
} }
String getPresident() { String getPresident() {
return president; return president;
} }
void setPresident(String newValue) { void setPresident(String newValue) {
president = newValue; president = newValue;
} }
} }

View File

@ -11,16 +11,16 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Drug extends Resource { public class Drug extends Resource {
String id; String id;
String getId() { String getId() {
return id; return id;
} }
void setId(String newValue) { void setId(String newValue) {
id = newValue; id = newValue;
} }
} }

View File

@ -12,26 +12,26 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Intervention { public class Intervention {
String id; String id;
long version; long version;
String description; String description;
String getId() { String getId() {
return id; return id;
} }
void setId(String newValue) { void setId(String newValue) {
id = newValue; id = newValue;
} }
long getVersion() { long getVersion() {
return version; return version;
} }
void setVersion(long newValue) { void setVersion(long newValue) {
version = newValue; version = newValue;
} }
public String getDescription() { public String getDescription() {

View File

@ -12,16 +12,16 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Medication extends Intervention { public class Medication extends Intervention {
Drug prescribedDrug; Drug prescribedDrug;
Drug getPrescribedDrug() { Drug getPrescribedDrug() {
return prescribedDrug; return prescribedDrug;
} }
void setPrescribedDrug(Drug newValue) { void setPrescribedDrug(Drug newValue) {
prescribedDrug = newValue; prescribedDrug = newValue;
} }
} }

View File

@ -12,34 +12,34 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Party { public class Party {
String id; String id;
String name; String name;
String address; String address;
String getId() { String getId() {
return id; return id;
} }
void setId(String newValue) { void setId(String newValue) {
id = newValue; id = newValue;
} }
String getName() { String getName() {
return name; return name;
} }
void setName(String newValue) { void setName(String newValue) {
name = newValue; name = newValue;
} }
String getAddress() { String getAddress() {
return address; return address;
} }
void setAddress(String newValue) { void setAddress(String newValue) {
address = newValue; address = newValue;
} }
} }

View File

@ -12,43 +12,43 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Person extends Party { public class Person extends Party {
String id; String id;
String givenName; String givenName;
String lastName; String lastName;
String nationalID; String nationalID;
String getId() { String getId() {
return id; return id;
} }
void setId(String newValue) { void setId(String newValue) {
id = newValue; id = newValue;
} }
String getGivenName() { String getGivenName() {
return givenName; return givenName;
} }
void setGivenName(String newValue) { void setGivenName(String newValue) {
givenName = newValue; givenName = newValue;
} }
String getLastName() { String getLastName() {
return lastName; return lastName;
} }
void setLastName(String newValue) { void setLastName(String newValue) {
lastName = newValue; lastName = newValue;
} }
String getNationalID() { String getNationalID() {
return nationalID; return nationalID;
} }
void setNationalID(String newValue) { void setNationalID(String newValue) {
nationalID = newValue; nationalID = newValue;
} }
} }

View File

@ -12,34 +12,34 @@ package org.hibernate.orm.test.legacy;
*/ */
public class Resource { public class Resource {
String id; String id;
String name; String name;
String userCode; String userCode;
String getId() { String getId() {
return id; return id;
} }
void setId(String newValue) { void setId(String newValue) {
id = newValue; id = newValue;
} }
String getName() { String getName() {
return name; return name;
} }
void setName(String newValue) { void setName(String newValue) {
name = newValue; name = newValue;
} }
String getUserCode() { String getUserCode() {
return userCode; return userCode;
} }
void setUserCode(String newValue) { void setUserCode(String newValue) {
userCode = newValue; userCode = newValue;
} }
} }

View File

@ -14,40 +14,40 @@ import java.util.Set;
*/ */
public class Role { public class Role {
long id; long id;
String name; String name;
Set interventions = new HashSet(); Set interventions = new HashSet();
private List bunchOfStrings; private List bunchOfStrings;
long getId() { long getId() {
return id; return id;
} }
void setId(long newValue) { void setId(long newValue) {
id = newValue; id = newValue;
} }
String getName() { String getName() {
return name; return name;
} }
void setName(String newValue) { void setName(String newValue) {
name = newValue; name = newValue;
} }
public Set getInterventions() { public Set getInterventions() {
return interventions; return interventions;
} }
public void setInterventions(Set iv) { public void setInterventions(Set iv) {
interventions = iv; interventions = iv;
} }
List getBunchOfStrings() { List getBunchOfStrings() {
return bunchOfStrings; return bunchOfStrings;
} }
void setBunchOfStrings(List s) { void setBunchOfStrings(List s) {
bunchOfStrings = s; bunchOfStrings = s;
} }
} }

View File

@ -14,20 +14,20 @@ import java.io.Serializable;
*/ */
public class SerializableData implements Serializable public class SerializableData implements Serializable
{ {
private String payload; private String payload;
public SerializableData(String payload) public SerializableData(String payload)
{ {
this.payload = payload; this.payload = payload;
} }
public String getPayload() public String getPayload()
{ {
return payload; return payload;
} }
public void setPayload(String payload) public void setPayload(String payload)
{ {
this.payload = payload; this.payload = payload;
} }
} }

View File

@ -10,26 +10,26 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
public class Name implements Serializable { public class Name implements Serializable {
private int id; private int id;
private String name; private String name;
private int nameLength; private int nameLength;
private List values; private List values;
public int getId() { return id; } public int getId() { return id; }
public String getName() { return name; } public String getName() { return name; }
public int getNameLength() { return nameLength; } public int getNameLength() { return nameLength; }
public List getValues() { return values; } public List getValues() { return values; }
public void setId(int id) { this.id = id; } public void setId(int id) { this.id = id; }
public void setName(String name) { this.name = name; } public void setName(String name) { this.name = name; }
public void setNameLength(int nameLength) { this.nameLength = nameLength; } public void setNameLength(int nameLength) { this.nameLength = nameLength; }
public void setValues(List values) { this.values = values; } public void setValues(List values) { this.values = values; }
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof Name )) return false; if (!(obj instanceof Name )) return false;
Name other = (Name) obj; Name other = (Name) obj;
return other.id == this.id; return other.id == this.id;
} }
public int hashCode() { return id; } public int hashCode() { return id; }
} }

View File

@ -9,23 +9,23 @@ package org.hibernate.orm.test.mapping.fetch.subselect;
import java.io.Serializable; import java.io.Serializable;
public class Value implements Serializable { public class Value implements Serializable {
private int id; private int id;
private Name name; private Name name;
private String value; private String value;
public int getId() { return id; } public int getId() { return id; }
public Name getName() { return name; } public Name getName() { return name; }
public String getValue() { return value; } public String getValue() { return value; }
public void setId(int id) { this.id = id; } public void setId(int id) { this.id = id; }
public void setName(Name name) { this.name = name; } public void setName(Name name) { this.name = name; }
public void setValue(String value) { this.value = value; } public void setValue(String value) { this.value = value; }
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof Value )) return false; if (!(obj instanceof Value )) return false;
Value other = (Value) obj; Value other = (Value) obj;
return other.id == this.id; return other.id == this.id;
} }
public int hashCode() { return id; } public int hashCode() { return id; }
} }

View File

@ -38,7 +38,7 @@ public class SimpleEntityTableTest extends BaseEntityManagerFunctionalTestCase {
catalog = "public", catalog = "public",
schema = "store", schema = "store",
name = "book" name = "book"
) )
public static class Book { public static class Book {
@Id @Id

View File

@ -114,7 +114,7 @@ public class FilterJoinTableTest extends BaseEntityManagerFunctionalTestCase {
name="maxOrderId", name="maxOrderId",
type=int.class type=int.class
) )
) )
public static class Client { public static class Client {
@Id @Id

View File

@ -531,7 +531,7 @@ public class FilterTest extends BaseEntityManagerFunctionalTestCase {
name="active", name="active",
type=Boolean.class type=Boolean.class
) )
) )
@Filter( @Filter(
name="activeAccount", name="activeAccount",
condition="active_status = :active" condition="active_status = :active"

View File

@ -15,20 +15,20 @@ import jakarta.persistence.Table;
@Table(name = "invoice") @Table(name = "invoice")
public class InvoiceBE { public class InvoiceBE {
@Id @Id
// @GeneratedValue // @GeneratedValue
private long id; private long id;
@Column(name = "removed", nullable = false) @Column(name = "removed", nullable = false)
private boolean removed; private boolean removed;
public InvoiceBE setId(long id) { public InvoiceBE setId(long id) {
this.id = id; this.id = id;
return this; return this;
} }
public InvoiceBE setRemoved(boolean removed) { public InvoiceBE setRemoved(boolean removed) {
this.removed = removed; this.removed = removed;
return this; return this;
} }
} }

View File

@ -17,20 +17,20 @@ import jakarta.persistence.Table;
name = "paid_invoice") name = "paid_invoice")
public class PaidInvoiceBE { public class PaidInvoiceBE {
@Id @Id
// @GeneratedValue // @GeneratedValue
private long id; private long id;
@ManyToOne(optional = false, fetch = FetchType.LAZY) @ManyToOne(optional = false, fetch = FetchType.LAZY)
private InvoiceBE invoice; private InvoiceBE invoice;
public PaidInvoiceBE setId(long id) { public PaidInvoiceBE setId(long id) {
this.id = id; this.id = id;
return this; return this;
} }
public PaidInvoiceBE setInvoice(InvoiceBE invoice) { public PaidInvoiceBE setInvoice(InvoiceBE invoice) {
this.invoice = invoice; this.invoice = invoice;
return this; return this;
} }
} }

View File

@ -15,7 +15,7 @@ public class StringCompositeKey implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String substation; private String substation;
private String deviceType; private String deviceType;

View File

@ -19,8 +19,8 @@ import jakarta.persistence.Table;
@Table(name = "`Role`") @Table(name = "`Role`")
public class Role implements Serializable { public class Role implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private long id; private long id;
} }

View File

@ -51,7 +51,7 @@ public class IndexTest extends BaseEntityManagerFunctionalTestCase {
columnList = "first_name, last_name", columnList = "first_name, last_name",
unique = false unique = false
) )
) )
public static class Author { public static class Author {
@Id @Id

View File

@ -82,7 +82,7 @@ public class UniqueConstraintTest extends BaseEntityManagerFunctionalTestCase {
"author_id" "author_id"
} }
) )
) )
public static class Book { public static class Book {
@Id @Id

View File

@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/ */
@BaseUnitTest @BaseUnitTest
public class CacheKeySerializationTest { public class CacheKeySerializationTest {
private SessionFactoryImplementor getSessionFactory(String cacheKeysFactory) { private SessionFactoryImplementor getSessionFactory(String cacheKeysFactory) {
Configuration configuration = new Configuration() Configuration configuration = new Configuration()
.setProperty(Environment.USE_SECOND_LEVEL_CACHE, true) .setProperty(Environment.USE_SECOND_LEVEL_CACHE, true)
.setProperty(Environment.CACHE_REGION_FACTORY, CachingRegionFactory.class) .setProperty(Environment.CACHE_REGION_FACTORY, CachingRegionFactory.class)
@ -56,33 +56,33 @@ public class CacheKeySerializationTest {
configuration.addAnnotatedClass( WithSimpleId.class ); configuration.addAnnotatedClass( WithSimpleId.class );
configuration.addAnnotatedClass( WithEmbeddedId.class ); configuration.addAnnotatedClass( WithEmbeddedId.class );
return (SessionFactoryImplementor) configuration.buildSessionFactory(); return (SessionFactoryImplementor) configuration.buildSessionFactory();
} }
@Test @Test
@JiraKey(value = "HHH-11202") @JiraKey(value = "HHH-11202")
public void testSimpleCacheKeySimpleId() throws Exception { public void testSimpleCacheKeySimpleId() throws Exception {
testId( SimpleCacheKeysFactory.INSTANCE, WithSimpleId.class.getName(), 1L ); testId( SimpleCacheKeysFactory.INSTANCE, WithSimpleId.class.getName(), 1L );
} }
@Test @Test
@JiraKey(value = "HHH-11202") @JiraKey(value = "HHH-11202")
public void testSimpleCacheKeyEmbeddedId() throws Exception { public void testSimpleCacheKeyEmbeddedId() throws Exception {
testId( SimpleCacheKeysFactory.INSTANCE, WithEmbeddedId.class.getName(), new PK( 1L ) ); testId( SimpleCacheKeysFactory.INSTANCE, WithEmbeddedId.class.getName(), new PK( 1L ) );
} }
@Test @Test
@JiraKey(value = "HHH-11202") @JiraKey(value = "HHH-11202")
public void testDefaultCacheKeySimpleId() throws Exception { public void testDefaultCacheKeySimpleId() throws Exception {
testId( DefaultCacheKeysFactory.INSTANCE, WithSimpleId.class.getName(), 1L ); testId( DefaultCacheKeysFactory.INSTANCE, WithSimpleId.class.getName(), 1L );
} }
@Test @Test
@JiraKey(value = "HHH-11202") @JiraKey(value = "HHH-11202")
public void testDefaultCacheKeyEmbeddedId() throws Exception { public void testDefaultCacheKeyEmbeddedId() throws Exception {
testId( DefaultCacheKeysFactory.INSTANCE, WithEmbeddedId.class.getName(), new PK( 1L ) ); testId( DefaultCacheKeysFactory.INSTANCE, WithEmbeddedId.class.getName(), new PK( 1L ) );
} }
private void testId(CacheKeysFactory cacheKeysFactory, String entityName, Object id) throws Exception { private void testId(CacheKeysFactory cacheKeysFactory, String entityName, Object id) throws Exception {
final SessionFactoryImplementor sessionFactory = getSessionFactory(cacheKeysFactory.getClass().getName()); final SessionFactoryImplementor sessionFactory = getSessionFactory(cacheKeysFactory.getClass().getName());
final EntityPersister persister = sessionFactory.getRuntimeMetamodels().getMappingMetamodel().getEntityDescriptor(entityName); final EntityPersister persister = sessionFactory.getRuntimeMetamodels().getMappingMetamodel().getEntityDescriptor(entityName);
final Object key = cacheKeysFactory.createEntityKey( final Object key = cacheKeysFactory.createEntityKey(
@ -130,5 +130,5 @@ public class CacheKeySerializationTest {
finally { finally {
sessionFactory.close(); sessionFactory.close();
} }
} }
} }

View File

@ -19,6 +19,6 @@ import jakarta.persistence.Id;
@Entity @Entity
@Cacheable @Cacheable
public class WithSimpleId { public class WithSimpleId {
@Id @Id
private Long id; private Long id;
} }

View File

@ -92,7 +92,7 @@ public class CustomSQLSecondaryTableTest extends BaseEntityManagerFunctionalTest
pkJoinColumns = @PrimaryKeyJoinColumn(name = "person_id")) pkJoinColumns = @PrimaryKeyJoinColumn(name = "person_id"))
@SQLInsert( @SQLInsert(
sql = "INSERT INTO person (name, id, valid) VALUES (?, ?, true) " sql = "INSERT INTO person (name, id, valid) VALUES (?, ?, true) "
) )
@SQLDelete( @SQLDelete(
sql = "UPDATE person SET valid = false WHERE id = ? " sql = "UPDATE person SET valid = false WHERE id = ? "
) )

View File

@ -39,7 +39,7 @@ import jakarta.persistence.SqlResultSetMapping;
" length * width * 10 as volume " + " length * width * 10 as volume " +
"FROM SpaceShip", "FROM SpaceShip",
resultSetMapping = "spaceship" resultSetMapping = "spaceship"
) )
}) })
@SqlResultSetMapping( @SqlResultSetMapping(
name = "spaceship", name = "spaceship",
@ -54,7 +54,7 @@ import jakarta.persistence.SqlResultSetMapping;
@FieldResult(name = "dimensions.length", column = "length"), @FieldResult(name = "dimensions.length", column = "length"),
@FieldResult(name = "dimensions.width", column = "width"), @FieldResult(name = "dimensions.width", column = "width"),
} }
), ),
columns = { columns = {
@ColumnResult(name = "surface"), @ColumnResult(name = "surface"),
@ColumnResult(name = "volume") @ColumnResult(name = "volume")

View File

@ -11,11 +11,11 @@ import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
/** /**
* @author Strong Liu * @author Strong Liu
*/ */
@Entity @Entity
public class Issue { public class Issue {
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;
@ -47,4 +47,4 @@ import jakarta.persistence.Id;
public void setIssueNumber(String issueNumber) { public void setIssueNumber(String issueNumber) {
this.issueNumber = issueNumber; this.issueNumber = issueNumber;
} }
} }