Hello,
I'm using Hibernate 3.6.9-FINAL with annotations. I'm working on a legacy database that I can't modify. I'm looking for a way of doing the following with annotations.
I have to execute the basic crud operations on a table with three columns: id, name and account. The account has a primary key constraint on it. I was hoping I could create a pojo that just has the three fields where the account is an array and when I saveOrUpdate Hibernate will look at it as individual items:
Code:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private Integer id;
@Column(name = "name")
private String name;
@Column(name = "account")
private String[] account;
If I saveOrUpdate this, the account-array is serialized as one object, is there an annotation that allows me to define a one-to-many or something in the same table? Perhaps I have to reverse the whole thing, look at it from the account.
thanks for any thoughts,
Lino