I am having a problem with SpringData, Hibernate and HSQLDB. I'm trying to set up a class as follows. Note that the @GeneratedValue and the @Id are on different columns. (I did not come up with this design.) Is this a valid strategy?
Code:
@Data
@Entity
@Table(name = "ACCTS")
public class MyAccount implements java.io.Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="ACCOUNT_ID", nullable=false, precision=10, scale=0)
private long accountId;
@Id
@Column(name="ACCOUNT_NUMBER", unique=true, nullable=false, precision=9, scale=0)
private int accountNumber1;
@Column(name="PRIMARY_NUMBER", nullable=false, precision=9, scale=0)
private int accountNumber2;
}