cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter <peat...@yahoo.de>
Subject Adding Property
Date Mon, 30 Oct 2006 19:59:19 GMT
Hallo Cayenne Users!

The generic-exmaple (see
http://cwiki.apache.org/confluence/display/CAY/Generic+DataObjects+Example)
was useful for me.
There you add columns via:

DbEntity messageTable = orMapping.getDbEntity("message");
DbAttribute topicColumn = new DbAttribute("topic", Types.VARCHAR,
messageTable);
messageTable.addAttribute(topicColumn);
ObjEntity messageEntity = orMapping.getObjEntity("Message");
ObjAttribute topicProperty = new ObjAttribute("topic",
String.class.getName(), messageEntity);
topicProperty.setDbAttribute(topicColumn);
messageEntity.addAttribute(topicProperty);

For what is method messageTable.dbAttributeAdded(AttributeEvent)? Who 
receives what?
How can I add columns at runtime, after I created the default db schema,
so that the existing columns will not be removed? Should I subclass
DbGenerator? Or is this only possible with raw sql statements?

And how to read ALL properties from database, not only the mapped one.
Because if I add a column externally, it won't appear in cayenne
attribute list: getDbEntity(name).getGeneratedAttributes will fail.
Should I use: Remote Object Persistence?

Thank you, Peter.


		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Mime
View raw message