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~

Reply via email to