I use JPA to manipulate the database. One table "User" adopts the primary key ("first name", "second name").
So I tag @Embeddable with the class "Name".
Code: Select all
@Embeddable
public class Name implements Serializable {
@Column(name="firstname", nullable=false)
private String firstname= "";
@Column(name="secondname", nullable=false)
private String firstname= "";
//getter setter hash equals
Here is the entity Class: "User":
Code: Select all
@Entity
@Table(name="User")
public class Userimplements Serializable {
@EmbeddedId
private Name name = new Name();
//Other properties
//getter setter hash equals
But I don't how to implements the datamodel:
Code: Select all
public Car getRowData(String rowKey) {
//I don't know how to write here???
return null;
}
Can someone met this before?
Thank you,
Colin