Hey, I gave it a shot. I have the following table:
Code:
CREATE TABLE test_table (
pkey VARCHAR(30) PRIMARY KEY,
datecol DATE NOT NULL
);
And a superclass:
Code:
public class Parent
{
@Temporal( TemporalType.DATE )
@GeneratedValue( generator="gen_datecol" )
@GenericGenerator( name="gen_datecol", strategy="select" )
@Column( name="datecol", nullable=false )
private Date date;
/*... accessors ... */
}
And the derived class:
Code:
@Entity
@Table( name="test_table" )
public class Test
{
@Id @Column( name="pkey", length=30 )
private String pkey;
/*... accessors ... */
}
There are a whole slew of things in this, as I'm not sure if I'm doing things properly with the class hierarchy. When I create a new object of class Test and save it, and commit, the base class's date property doesn't get filled in, and I see the following SQL:
Code:
Hibernate: insert into test_table (pkey) values (?)
I did a little trial and error, but am running out of ideas. Am I annotating the properties correctly? Do I need to add an annotation to the base class declaration (before "public class Parent")?
Thanks.