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 @@ else if ( !session.isConnected() ) {
}
}
else {
/*
Whenever the collection lazy loading is triggered during the loading process,
closing the connection will cause an error when RowProcessingStateStandardImpl#next() will be called.
*/
// Whenever the collection lazy loading is triggered during the loading process,
// closing the connection will cause an error when RowProcessingStateStandardImpl#next() will be called.
final PersistenceContext persistenceContext = session.getPersistenceContext();
if ( !session.isTransactionInProgress()
&& ( !persistenceContext.hasLoadContext()

View File

@ -1646,7 +1646,6 @@ private boolean sameColumnType(int typeCode1, int typeCode2) {
* <p>
* An implementation may set configuration properties from
* {@link #initDefaultProperties()}, though it is discouraged.
the
* @return the Hibernate configuration properties
*
* @see #initDefaultProperties()

View File

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

View File

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

View File

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

View File

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

View File

@ -19,25 +19,25 @@
public class CompositeKeyDeleteTest extends BaseCoreFunctionalTestCase {
@Override
protected String getBaseForMappings() {
@Override
protected String getBaseForMappings() {
return "";
}
}
@Override
public String[] getMappings() {
@Override
public String[] getMappings() {
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" );
}
/**
}
/**
* This test checks to make sure the non null column is not updated with a
* null value when a CustomerInventory is removed.
*/
@Test
public void testRemove() {
@Test
public void testRemove() {
Session s = openSession();
Transaction tx = s.beginTransaction();
@ -94,10 +94,10 @@ public void testRemove() {
tx.commit();//fail
s.close();
}
}
@Override
protected Class[] getAnnotatedClasses() {
@Override
protected Class[] getAnnotatedClasses() {
return new Class[] {
CustomerTwo.class,
CustomerInventoryTwo.class,
@ -105,5 +105,5 @@ protected Class[] getAnnotatedClasses() {
Item.class
};
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -14,50 +14,50 @@
*/
public class MultiplePK implements Serializable
{
private final Long id1;
private final Long id2;
private final Long id3;
private final Long id1;
private final Long id2;
private final Long id3;
// 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;
id2 = null;
id3 = null;
cachedHashCode = super.hashCode();
}
}
public MultiplePK(Long id1, Long id2, Long id3)
{
public MultiplePK(Long id1, Long id2, Long id3)
{
this.id1 = id1;
this.id2 = id2;
this.id3 = id3;
this.cachedHashCode = calculateHashCode();
}
}
private int calculateHashCode() {
private int calculateHashCode() {
int result = id1.hashCode();
result = 31 * result + id2.hashCode();
return result;
}
}
public Long getId1() {
public Long getId1() {
return id1;
}
}
public Long getId2() {
public Long getId2() {
return id2;
}
}
public Long getId3() {
public Long getId3() {
return id3;
}
}
@Override
public boolean equals(Object o)
{
@Override
public boolean equals(Object o)
{
if ( this == o ) {
return true;
}
@ -71,10 +71,10 @@ public boolean equals(Object o)
return id1.equals( multiplePK.id1 )
&& id2.equals( multiplePK.id2 )
&& id3.equals( multiplePK.id3);
}
@Override
public int hashCode() {
return cachedHashCode;
}
}
@Override
public int hashCode() {
return cachedHashCode;
}
}

View File

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

View File

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

View File

@ -11,11 +11,11 @@
* @author Emmanuel Bernard
*/
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",
joinColumns = @JoinColumn(name = "repository_id"),
inverseJoinColumns = @JoinColumn(name = "property_id")
)
)
private List<Property<?>> properties = new ArrayList<>();
//Getters and setters are omitted for brevity

View File

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

View File

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

View File

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

View File

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

View File

@ -8,13 +8,13 @@
public abstract class DiscriminatorSubclassPerson {
private Long oid;
private Long oid;
public Long getOid() {
public Long getOid() {
return oid;
}
public void setOid(Long oid) {
this.oid = oid;
}
}
public void setOid(Long oid) {
this.oid = oid;
}
}

View File

@ -8,13 +8,13 @@
public abstract class JoinedSubclassPerson {
private Long oid;
private Long oid;
public Long getOid() {
public Long getOid() {
return oid;
}
public void setOid(Long oid) {
this.oid = oid;
}
}
public void setOid(Long oid) {
this.oid = oid;
}
}

View File

@ -8,13 +8,13 @@
public abstract class UnionSubclassPerson {
private Long oid;
private Long oid;
public Long getOid() {
public Long getOid() {
return oid;
}
public void setOid(Long oid) {
this.oid = oid;
}
}
public void setOid(Long oid) {
this.oid = oid;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,16 +11,16 @@
*/
public class Drug extends Resource {
String id;
String id;
String getId() {
String getId() {
return id;
}
}
void setId(String newValue) {
void setId(String newValue) {
id = newValue;
}
}
}

View File

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

View File

@ -12,16 +12,16 @@
*/
public class Medication extends Intervention {
Drug prescribedDrug;
Drug prescribedDrug;
Drug getPrescribedDrug() {
Drug getPrescribedDrug() {
return prescribedDrug;
}
}
void setPrescribedDrug(Drug newValue) {
void setPrescribedDrug(Drug newValue) {
prescribedDrug = newValue;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -38,7 +38,7 @@ public void test() {
catalog = "public",
schema = "store",
name = "book"
)
)
public static class Book {
@Id

View File

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

View File

@ -531,7 +531,7 @@ public void addAccount(Account account) {
name="active",
type=Boolean.class
)
)
)
@Filter(
name="activeAccount",
condition="active_status = :active"

View File

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

View File

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

View File

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

View File

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

View File

@ -51,7 +51,7 @@ public void test() {
columnList = "first_name, last_name",
unique = false
)
)
)
public static class Author {
@Id

View File

@ -82,7 +82,7 @@ public void test() {
"author_id"
}
)
)
)
public static class Book {
@Id

View File

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

View File

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

View File

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

View File

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

View File

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