identity « ID « JPA Q&A

1. Custom wrapper for id key

I want to wrap id in custom class. Like this

@Table(name = "USERS")
public class User {
    UserId id;
public class UserId implements Serializable {

2. Identity id's, many-to-one and Sybase ASE

This is probably something stupid I have missed but why does this happen? I've got the id of my parent class setup like this: Code: ...

3. Error: GenerationType.IDENTITY requires id.

I'm using Hibernate 3.3.1 with Postgres. My persistence.xml contains the following: I have @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @Column(...) private String name; I see the db created the column as bigserial, which is what I want. When I go to persist the object it throws an error saying that the id parameter is blank. Am ...