|
|
Re: NullPointerException on @VariableOneToOne [message #515316 is a reply to message #515139] |
Thu, 18 February 2010 13:33 |
No real name Messages: 3 Registered: February 2010 |
Junior Member |
|
|
Thanks Chris. You were correct. Adding the specification of "targetInterface" resolved the NullPointerException. I also agree with your suggestion that the default interface type should be used if not specified, or at least issue a more helpful message.
Now that the NullPointerException is resolved, I hit a second issue. I created the class discriminator column as a numeric type:
resourceClass INTEGER,
and specified as such in the @VariableOneToOne:
discriminatorType=DiscriminatorType.INTEGER
but am syntactically forced to specify the actual discriminator values as Strings, like this:
@DiscriminatorClass(discriminator="3", value=Role.class)
Specifically, when I try this:
@DiscriminatorClass(discriminator=3, value=Role.class)
I get a compile error "Type mismatch: cannot convert from int to String"
and so eclipseLink actually uses a string value in the SQL insert statement, causing an error:
Call: INSERT IGNORE INTO ROLECAPABILITY (ID, ENTITYVERSION, operationId, ownerId, resourceId, resourceClass) VALUES (?, ?, ?, ?, ?, ?)
bind => [8, 1, 6, 7, 7, 3]
Internal Exception: org.postgresql.util.PSQLException: ERROR: column "resourceclass" is of type integer but expression is of type character varying
Is DiscriminatorType.INTEGER not supported by eclipseLink?
Greg
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02166 seconds