cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: CayenneDataObject is likely not mapped
Date Wed, 25 Jul 2018 08:09:23 GMT
See my reply in "is is possible to dynamically create entity in cayenne" thread. An explicit
reverse-engineering step is required.

Andrus

> On Jul 22, 2018, at 6:46 PM, 刘波 <1091643978@qq.com> wrote:
> 
> ServerRuntime cayenneRuntime = ServerRuntime.builder()
>                .addConfig("cayenne-project.xml")
>                .build();
>        ObjectContext context = cayenneRuntime.newContext();
> 
> 
>        DataObject person = new CayenneDataObject();
>        person.setObjectId(new ObjectId("Person"));
>        context.registerNewObject(person);
> 
>        String name = (String) person.readProperty("name");
> Exception in thread "main" java.lang.IllegalArgumentException: Can't find ObjEntity for
Persistent class: org.apache.cayenne.CayenneDataObject, class is likely not mapped.
> 	at org.apache.cayenne.access.DataContext.registerNewObject(DataContext.java:536)
> 
> Person is a table in mysql, we aren't map it in xml, we want use it in fly, we don't
define a deEntity for the table, just want use cayenne api to do the ORM job.
> 
> 
> and ideas, thanks~


Mime
View raw message