On 11/09/12 9:22pm, Felipe Martín Santos wrote:

*DataObject city = context.createAndRegisterNewObject("City");
city.writeProperty("cdCity", new Integer("11"));

You are better just writing:

city = context.newObject(City.class);
city.setcdCity(11);


         <db-attribute name="CD_CITY" type="NUMERIC" isPrimaryKey="true"
isMandatory="true" length="2"/>

Length 2?


Is recommended using Meaningful Primary Key?

It is almost never a good idea to use a meaningful primary key. Other than when 
you need to refactor an existing badly written database and you are stuck with 
it, I can think of no valid reason to do so. Just let Cayenne handle it for you.


Ari



--
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Reply via email to