Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] ReadOnly embedded primary key ?

Hi,

Can I have a embedded primary key just for read only? I need to have the 
fields of the composite primarity to be written in the entity not in the 
primary key.

Why? because I need to know (without query to the database) if the entity is a 
new entity (primary key instace is null) or if it exist in the database 
already.

I have updatable = false, insertable = false in the fields of the primary key 
embedded class, I have also declared the class as @ReadOnly, but when I try to 
persist the entity it says that the field "ClientID" (part of the composite 
primary key) cannot be NULL, but it is not null in the "Client" field in the 
entity instance.

Thanks in advance.
xavier.


Back to the top