Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] id-validation and persist()

By setting id-validation to NULL you are telling EclipseLink that 0 is a
valid id, so it assumes 0 is valid and uses it instead of generating one
(EclipseLink will only generate id if it is null (or not valid which
includes 0 by default, but you have changed this)).

You should probably just annotate the entities for which 0 is a valid id
using @PrimaryKey(validation=IdValidation.NULL)

We should probably have a mode that allows 0 for non generated id, but
doesn't for generated ones,

something like,

"eclipselink.id-validation"="GENERATOR_ONLY", ... maybe even the default,

Please log a bug.




--
View this message in context: http://eclipse.1072660.n5.nabble.com/id-validation-and-persist-tp154610p154740.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.


Back to the top