cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <>
Subject [jira] [Updated] (CAY-1728) Custom types used for PK are causing grief in relationships
Date Mon, 23 Jul 2012 18:46:35 GMT


Andrus Adamchik updated CAY-1728:

    Attachment: 0001X-testing-custom-types-as-PK.patch

A variation of the earlier patch where "UuidPkEntity -> UuidRelated" relationship was renamed
from "related" to "arelated", which changed the order of iteration of properties in SelectTranslator,
and this causes the problem described on the list on any select from UuidPkEntity:

java.lang.ClassCastException: java.lang.String cannot be cast to java.util.UUID
	at org.apache.cayenne.access.UUIDTest.testUUIDMeaningfulPkSelectViaRelationship1(

> Custom types used for PK are causing grief in relationships
> -----------------------------------------------------------
>                 Key: CAY-1728
>                 URL:
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1B1, 3.2M1
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>         Attachments: 0001-testing-custom-types-as-PK.patch, 0001X-testing-custom-types-as-PK.patch
> 1. Map an entity with meaningful PK, type of that PK being a non-standard type for a
given type of column (e.g. attached test case demonstrating the problem maps a VARCHAR column
to java.util.UUID).
> 2. Map another entity with an FK to the first entity, and create a to-one relaionship.
> 3. Fetch entity 2 and try to read the relationship to entity 1. The result is a FaultFailureException
similar to this one:
> org.apache.cayenne.FaultFailureException: [v.3.2M1-SNAPSHOT ${} ${}]
Error resolving fault for ObjectId: <ObjectId:UuidPkEntity, ID=8251ae98-de42-404c-9cd0-9c1b29410604>
and state (hollow). Possible cause - matching row is missing from the database.
> 	at org.apache.cayenne.BaseContext.prepareForAccess(
> 	at org.apache.cayenne.CayenneDataObject.readProperty(
> 	at
> 	at org.apache.cayenne.access.UUIDTest.testUUIDMeaningfulPkSelectViaRelationship(
> The reason is that expected ObjectId of the target entity contains a value of type String
instead of UUID, so expected and fetched ObjectId do not match, and Cayenne thinks there's
no object for relationship.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message