Class fields selection to store

#1

In a class how do I define which are the fields to be stored? (using JDO API)

It's using persistence-modifier="persistent" ?

If I have a class with 40 fields and I only want to store one of the fields should I do the following?

<class name="Car">
   <field name="Wheels" persistence-modifier="persistent" />
</class>

Which are the value used for fields that I do not want to store?

Which are the value used as default? e.g <class name="Car">

 

Thanks in Advance

 

 

#2

All the non static non final non transient fields in a persistence capable class are persistent by default. Therefore you don't need an XML element for the persistent field but for the other 39 non persistent fields.

Alternatively, you may:

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login