cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Meyer - KMZ" <>
Subject Re: Is it possible/easy to integrate cayenne with other frameworks?
Date Mon, 12 Dec 2011 07:50:50 GMT
Hmm.. curiouser and curiouser:
I'm reorganising the entity setup, and now I get:

org.apache.cayenne.CayenneRuntimeException: [v.3.1M4-SNAPSHOT Dec 11 2011 10:30:28] ObjAttribute
'number' does not have a corresponding DbAttribute

My setup, below, links the two:
id, in this case, is the magic "number" - the name of my POJO value 
field, of type int.

        // represents a database table
        DbEntity dbEntity = new DbEntity(entityName);

        // Represents a domain object
        ObjEntity objEntity = new ObjEntity(entityName);

        // Link the table to the domain object

        // Create fields
        List<OneToOneAssociation> assocs = specification.getProperties();
        for (OneToOneAssociation assoc : assocs) {
            final String id = assoc.getId(); // number
            final String type = assoc.getSpecification().getFullIdentifier(); // int

            DbAttribute dbAttribute = new DbAttribute(id, java.sql.Types.INTEGER, dbEntity);

            ObjAttribute objAttribute = new ObjAttribute(id, type, objEntity);


On 11 Dec 2011 at 21:05, Andrus Adamchik wrote:

> Great to hear there a workaround. Object structure is a pretty fundamental issue, so
I was afraid we may get stuck here.
> Cheers,
> Andrus 

View raw message