I am trying to upgrade from H2 to H3. I followed the migration guide. I am using the Classic Session (for now).
Consider the following (simplified) classes:
Code:
public class BaseEntity implements Serializable {
private Long id;
public final Long getId() {
return id;
}
public final void setId(Long id) {
this.id = id;
}
}
public class Customer extends BaseEntity {
private String name;
public String getName() {
return name;
}
public void setName(String n) {
name = n;
}
}
I inserted a Customer record into the database and I have the id. Now, in a new session, I do
session.load(Customer.class, (Long)tempid);
This actually loads the customer object and I could even print the name property. But when I do cust.getId() I get null. Very weired. I added the following method in the Customer class that simply invoked super.getId();
Code:
public Long getSuperId() {
return super.getId()
}
Now, if I do cust.getSuperId(), i see the actual id. In short, I load the Customer object from the database, then
cust.getId() returns null, while
cust.getSuperId() returns the id.
I am completely lost. This issue is not just with the id property, it affects all the properties in the super class. This used to work just fine in H2. Any pointers?