|
JDO (1.0.1 and 2.0) expects the Meta-Data to be specified in a file or files in particular
positions in the file system. For example, if you have a class com.mycompany.sample.myexample, JDO
will look for any of the following files until it finds one (in the order stated) :-
META-INF/package.jdo
WEB-INF/package.jdo
package.jdo
com/package.jdo
com/mycompany/package.jdo
com/mycompany/sample/package.jdo
com/mycompany/sample/myexample.jdo
In addition, for this example, DataNucleus allows the previous JDO 1.0.0 alternatives of
com.jdo
com/mycompany.jdo
com/mycompany/sample.jdo
In addition to the above, you can split your MetaData definitions between JDO MetaData files.
For example if you have the following classes
com/mycompany/A.java
com/mycompany/B.java
com/mycompany/C.java
com/mycompany/app1/D.java
com/mycompany/app1/E.java
You could define the MetaData for these 5 classes in many ways -- for example put all class definitions
in
com/mycompany/package.jdo
, or put the definitions for D and E in
com/mycompany/app1/package.jdo
and the definitions for A, B, C in
com/mycompany/package.jdo
, or have some in their class named MetaData files e.g
com/mycompany/app1/A.jdo
, or a mixture of the above. DataNucleus will always search for the
MetaData file containing the class definition for the class that it requires.
JDO MetaData has the following format. Please refer to the
JDO ORM XSD for precise details.
What follows provides a reference guide to MetaData elements.
These are attributes within the
<package>
tag (jdo/package). This is used to denote
a package, and all of the
<class>
elements that follow are in this Java package.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the java package
|
|
|
catalog
|
Name of the catalog in which to persist the classes in this package. See also the property name
"javax.jdo.mapping.Catalog" in the PMF Guide.
|
|
|
schema
|
Name of the schema in which to persist the classes in this package. See also the property name
"javax.jdo.mapping.Schema" in the PMF Guide.
|
|
These are attributes within the
<class>
tag (jdo/package/class). This is used to define
the persistence definition for this class.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the class to persist
|
|
|
identity-type
|
The identity type, specifying whether they are uniquely provided by the JDO implementation (datastore identity),
accessible fields in the object (application identity), or not at all (nondurable identity).
DataNucleus only supports nondurable identity for SQL views, and NucleusSQL queries
.
|
datastore
, application, nondurable
|
|
objectid-class
|
The class name of the primary key. When using
application identity
.
|
|
|
requires-extent
|
Whether the JDO implementation must provide an Extent for this class.
|
true
, false
|
|
detachable
|
Whether the class is detachable from the persistence graph.
|
true,
false
|
|
embedded-only
|
Whether this class should only be stored embedded in the tables for other classes.
|
true,
false
|
|
persistence-modifier
|
What type of persistability type this class exhibits.
Please refer to JDO Class Types.
|
persistence-capable
| persistence-aware | non-persistent
|
|
persistence-capable-superclass
|
Class name of superclass that is persistent capable.
This is deprecated in JDO2 and you no longer need to specify it, leaving it to DataNucleus
to determine if there is a superclass that is
PersistenceCapable
.
|
|
|
catalog
|
Name of the catalog in which to persist the class. See also the property name
"javax.jdo.mapping.Catalog" in the PMF Guide.
|
|
|
schema
|
Name of the schema in which to persist the class. See also the property name
"javax.jdo.mapping.Schema" in the PMF Guide.
|
|
|
table
|
Name of the table/view in which to persist the class. See also the property name
"datanucleus.identifier.case" in the
Persistence Properties Guide.
|
|
|
cacheable
|
Whether the class can be cached in a Level 2 cache.
From JDO2.2
|
true
| false
|
These are attributes within the
<implements>
tag (jdo/package/class/implements).
This is used when the
<class>
implements interfaces that are used as field types in
other classes.
This is deprecated in JDO2.1 since it can be determined from reflection on the class
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the interface being implemented (fully qualified, else will look in the same package)
|
|
These are attributes within the
<datastore-identity>
tag (jdo/package/class/datastore-identity).
This is used when the
<class>
to which this pertains uses datastore identity. It is used to define
the precise definition of datastore identity to be used.
This element can contain
column
sub-elements allowing definition of the column details where required -
these are optional.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
strategy
|
Strategy for datastore identity generation for this class.
native
allows DataNucleus to choose the most suitable for the datastore.
sequence
will use a sequence (specified by the attribute
sequence
) - if supported by
the datastore.
increment
will use the id values in the datastore to decide the next id.
uuid-string
will use a UUID string generator (16-characters).
uuid-hex
will use a UUID string generator (32-characters).
identity
will use a datastore inbuilt auto-incrementing types.
auid
is a DataNucleus extension, that is an almost universal id generator (best possible derivate of a DCE UUID).
max
is a DataNucleus extension, that uses "select max(column)+1 from table" for the identity.
timestamp
is a DataNucleus extension, providing the current timestamp.
timestamp-value
is a DataNucleus extension, providing the current timestamp millisecs.
[other values]
to utilise user-supplied DataNucleus value generator
plugins.
|
native
| sequence | increment | identity | uuid-string | uuid-hex |
auid
|
max
|
timestamp
|
timestamp-value
|
[other values]
|
|
sequence
|
Name of the sequence to use to generate identity values, when using a
strategy
of
sequence
.
Please see also the
class
extension tags for controlling the sequence.
|
|
|
column
|
Name of the column used for the datastore identity for this class.
|
|
These are attributes within the
<extension>
tag (jdo/package/class/datastore-identity/extension).
These are for controlling the generation of ids when in
datastore identity
mode.
|
Attribute
|
Description
|
Values
|
|
Extension (JDO) Tags
|
|
sequence-table-basis
|
This defines the basis on which to generate unique identities when using the TablePoidGenerator
(used by the "increment" strategy, and sometimes by "native"). You can either define identities unique
against the base table name, or against the base class name (in an inheritance tree).
Used when the strategy is set to
native
or
increment
|
class
| table
|
|
sequence-catalog-name
|
The catalog used to store sequences for use by poid generators. See
Value Generation.
Default catalog for the datastore will be used if not specified.
|
|
|
sequence-schema-name
|
The schema used to store sequences for use by poid generators. See
Value Generation.
Default schema for the datastore will be used if not specified.
|
|
|
sequence-table-name
|
The table used to store sequences for use by poid generators. See
Value Generation.
|
SEQUENCE_TABLE
|
|
sequence-name-column-name
|
The column name in the sequence-table used to store the name of the sequence for use by poid generators.
See Value Generation.
|
SEQUENCE_NAME
|
|
sequence-nextval-column-name
|
The column name in the sequence-table used to store the next value in the sequence for use by poid
generators. See Value Generation.
|
NEXT_VAL
|
|
key-min-value
|
The minimum key value for use by poid generators. Keys lower than this will not be generated.
See Value Generation.
|
|
|
key-max-value
|
The maximum key value for use by poid generators. Keys higher than this will not be generated.
See Value Generation.
|
|
|
key-start-with
|
The starting value for use by poid generators. Keys will start from this value when being generated.
See Value Generation.
|
|
|
key-increment-by
|
The increment value for use by poid generators. Keys will be incremented by this value when being
generated. See Value Generation.
|
|
|
key-database-cache-size
|
The database cache size for keys for use by poid generators. The cache of keys will be constrained by
this value. See Value Generation.
|
|
|
key-cache-size
|
The cache size for keys for use by poid generators. The cache of keys will be constrained by this value.
See Value Generation.
|
|
These are attributes within the
<primary-key>
tag (jdo/package/class/primary-key or
class/field/join/primary-key). It is used to specify the name of the primary key constraint in the
datastore during the schema generation process. When used under <join> it specifies that the
join table has a primary-key.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the primary key constraint.
|
|
|
column
|
Name of the column to use for the primary key
|
|
These are attributes within the
<inheritance>
tag (jdo/package/class/inheritance). It is used when this
class is part of an inheritance tree, and to denote how the class is stored in the datastore since there are several
ways (strategies) in which it can be stored.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
strategy
|
Strategy for inheritance of this class. Please refer to the
Inheritance Guide.
Note that "complete-table" is a DataNucleus extension to JDO2
|
new-table, subclass-table, superclass-table, complete-table
|
These are attributes within the
<discriminator>
tag (jdo/package/class/inheritance/discriminator).
This is used to define a discriminator column that is used when this class is stored in the same table as another
class in the same inheritance tree. The discriminator column will contain a value for objects of this class, and
different values for objects of other classes in the inheritance tree.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
strategy
|
Strategy for the discrimination column
|
value-map | class-name | none
|
|
value
|
Value for the discrimination column
|
|
|
column
|
Name for the discrimination column
|
|
|
indexed
|
Whether the discriminator column should be indexed.
This is to be specified when defining index information
|
true | false | unique
|
These are attributes within the
<version>
tag (jdo/package/class/version). This is used to define
whether and how this class is handled with respect to optimistic transactions.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
strategy
|
Strategy for versioning of this class. The "version-number" mode uses an incremental numbered value, and the
"date-time" mode uses a java.sql.Timestamp value.
state-image
isn't currently supported.
|
state-image, date-time, version-number
|
|
column
|
Name of the column in the datastore to store this field
|
|
|
indexed
|
Whether the version column should be indexed.
This is to be specified when defining index information
|
true | false | unique
|
These are attributes within the
<extension>
tag (jdo/package/class/version/extension).
|
Attribute
|
Description
|
Values
|
|
Extension (JDO) Tags
|
|
field-name
|
This extension allows you to define a field that will be used to contain the
version of the object. It is populated by DataNucleus at persist.
See JDO Versioning
|
|
These are attributes within the
<query>
tag (jdo/package/class/query). This element is used to define
any "named queries" that are to be available for this class. This element contains the query single-string
form as its content.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the query. This name is mandatory and is used in calls to
pm.newNamedQuery()
. Has to be
unique for this class.
|
|
|
language
|
Query language to use. Some datastores offer other languages
|
JDOQL
| SQL | JPQL | NucleusSQL
|
|
unique
|
Whether the query is to return a unique result (only for SQL queries).
|
true |
false
|
|
result-class
|
Class name of any result class (only for SQL queries).
|
|
These are attributes within the
<field>
tag (jdo/package/class/field). This is used to define the
persistence behaviour of the fields of the class to which it pertains. Certain types of fields are, by default,
persisted. This element can be used to change the default behaviour and maybe not persist a field, or to persist
something that normally isn't persisted. It is used, in addition, to define more details about how the field
is persisted in the datastore.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the field.
|
|
|
persistence-modifier
|
The persistence-modifier specifies how JDO manage each field in your persistent class. There are three
options: persistent, transactional and none.
-
persistent
means that your field will managed by JDO and stored in the database on
transaction commit.
-
transactional
means that your field will managed by JDO but not stored in the database.
Transactional fields values will be saved by JDO when you start your transaction and restored
when you roll back your transaction.
-
none
means that your field will not be managed by JDO.
|
persistent, transactional, none
|
|
primary-key
|
Whether the field is part of any primary key (if using
application identity
).
|
true,
false
|
|
null-value
|
How to treat null values of persistent fields during storage. Valid options are "exception", "default",
"none" (where "none" is the default).
|
exception, default,
none
|
|
default-fetch-group
|
Whether this field is part of the default fetch group for the class. Defaults to true for non-key fields
of primitive types, java.util.Date, java.lang.*, java.math.*, etc.
|
true
, false
|
|
embedded
|
Whether this field should be stored, if possible, as part of the object instead as its own object in
the datastore. This defaults to true for primitive types, java.util.Date, java.lang.*, java.math.* etc and
false for PersistenceCapable, reference (Object, Interface) and container types.
|
true, false
|
|
serialized
|
Whether this field should be stored serialised into a single column of the table of the containing object.
|
true,
false
|
|
dependent
|
Whether the field should be used to check for dependent objects, and to delete them when this object is
deleted. In other words
cascade delete
capable.
|
true,
false
|
|
mapped-by
|
The name of the field at the other end of a relationship.
Used by 1-1, 1-N, M-N to mark a relation as bidirectional.
|
|
|
value-strategy
|
The strategy for populating values to this field. Is typically used for
generating primary key values.
See the definitions under "datastore-identity".
|
native | sequence | increment | identity | uuid-string | uuid-hex |
auid
|
max
|
timestamp
|
timestamp-value
|
[other values]
|
|
sequence
|
Name of the sequence to use to generate values, when using a
strategy
of
sequence
.
Please see also the
class
extension tags for controlling the sequence.
|
|
|
recursion-depth
|
The depth that will be recursed when this field is self-referencing. Should be used alongside
FetchPlan.setMaxFetchDepth() to control the objects fetched.
|
-1,
1
, 2, ... (integer)
|
|
field-type
|
Used to specify a more restrictive type than the field definition
in the class. This might be required in order to map the field to the datastore. To be
portable, specify the name of a single type that is itself able to be mapped to the datastore
(e.g. a field of type Object can specify field-type="Integer").
|
|
|
indexed
|
Whether the column(s) for this field should be indexed.
This is to be specified when defining index information
|
true | false | unique
|
|
table
|
Table name to use for any join table overriding the default name provided by DataNucleus.
This is used either for 1-N relationships with a join table
or for Secondary Tables.
See also the property name "datanucleus.identifier.case" in the
Persistence Properties Guide.
|
|
|
column
|
Column name to use for this field (alternative to specifying column sub-elements if only one column).
|
|
|
delete-action
|
The foreign-key delete action. This is a shortcut to
specifying foreign key information. Please refer to
the <foreign-key> element for full details.
|
cascade | restrict | null | default | none
|
|
cacheable
|
Whether the field/property can be cached in a Level 2 cache.
From JDO2.2
|
true
| false
|
These are attributes within the
<extension>
tag (jdo/package/class/field/extension).
|
Attribute
|
Description
|
Values
|
|
Extension (JDO) Tags
|
|
cascade-persist
|
JDO defines that when an object is persisted then all fields will also be persisted
using "persistence-by-reachability". This extension allows you to turn off the persistence
of a field relation.
|
true
| false
|
|
cascade-update
|
JDO defines that when an object is updated then all fields containing PersistenceCapable objects will also
be updated using "persistence-by-reachability". This extension allows you to turn off the update
of a field relation.
|
true
| false
|
|
cascade-refresh
|
When calling PersistenceManager.refresh() only fetch plan fields of the passed object will be
refreshed. Setting this to true will refresh the fields of related PC objects in this field
|
true |
false
|
|
allows-null
|
When the field is a collection by default it will not be allowed to have nulls present
but you can allow them by setting this DataNucleus extension tag
|
true |
false
|
|
insertable
|
Whether this field should be supplied when inserting into the datastore.
|
true
| false
|
|
updateable
|
Whether this field should be supplied when updating the datastore.
|
true
| false
|
|
adapter-column-name
|
In some situations DataNucleus will add a special datastore column to a join table so that collections
can allow the storage of duplicate elements. This extension allows the specification of the column name
to be used. This should be specified within the field at the collection end of the relationship.
JDO2 doesnt allow a standard place for such a specification and so is an extension tag.
|
INTEGER_IDX
|
|
implementation-classes
|
Used to define the possible classes implementing this interface/Object field. This is used to limit the possible
tables that this is a foreign key to (when this field is specified as an interface/Object in the class).
Value should be comma-separated list of fully-qualified class names
|
|
|
key-implementation-classes
|
Used to define the possible classes implementing this interface/Object key. This is used to limit the possible
tables that this is a foreign key to (when this key is specified as an interface/Object).
Value should be comma-separated list of fully-qualified class names
|
|
|
value-implementation-classes
|
Used to define the possible classes implementing this interface/Object value. This is used to limit the possible
tables that this is a foreign key to (when this value is specified as an interface/Object).
Value should be comma-separated list of fully-qualified class names
|
|
|
strategy-when-notnull
|
This is to be used in conjunction with the "value-strategy" attribute. Default JDO2 behaviour when you
have a "value-strategy" defined for a field is to always create a strategy value for that field regardless
of whether you have set the value of the field yourself. This extension allows you to only apply the
strategy if the field is null at persistence. This extension has no effect on primitive field
types (which can't be null) and the value-strategy will always be applied to such fields.
|
true
| false
|
|
relation-discriminator-column
|
Name of a column to use for discrimination of the relation used by objects stored.
This is defined when, for example, a join table is shared by multiple relations and
the objects placed in the join table need discriminating for which relation they are for
|
RELATION_DISCRIM
|
|
relation-discriminator-pk
|
Whether the column added for the discrimination of relations is to be part of the PK when using a join table.
|
true |
false
|
|
relation-discriminator-value
|
Value to use in the relation discriminator column for objects of this fields relation.
This is defined when, for example, a join table is shared by multiple relations and
the objects placed in the join table need discriminating for which relation they are for.
|
Fully-qualified class name
|
|
select-function
|
Permits to use a function when fetching contents from the database. A ? (question mark) is mandatory to have
and will be replaced by the column name when generating the SQL statement.
For example to specify a value of
UPPER(?)
will convert the field value
to upper case on a datastore that supports that UPPER function.
|
|
|
insert-function
|
Permits to use a function when inserting into the database. A ? (question mark) is optional and will be
replaced by the column name when generating the SQL statement.
For example to specify a value of
TRIM(?)
will trim the field value
on a datastore that supports that TRIM function.
|
|
|
update-function
|
Permits to use a function when updating into the database. A ? (question mark) is optional and will be replaced
by the column name when generating the SQL statement.
For example to specify a value of
FUNC(?)
will perform "FUNC" on the field value
on a datastore that supports that FUNC function.
|
|
|
sequence-table-basis
|
This defines the basis on which to generate unique identities when using the TablePoidGenerator
(used by the "increment" strategy, and sometimes by "native"). You can either define identities unique
against the base table name, or against the base class name (in an inheritance tree).
Used when the strategy is set to
native
or
increment
|
class
| table
|
|
sequence-catalog-name
|
The catalog used to store sequences for use by poid generators. See
Value Generation.
Default catalog for the datastore will be used if not specified.
|
|
|
sequence-schema-name
|
The schema used to store sequences for use by poid generators. See
Value Generation.
Default schema for the datastore will be used if not specified.
|
|
|
sequence-table-name
|
The table used to store sequences for use by poid generators. See
Value Generation.
|
SEQUENCE_TABLE
|
|
sequence-name-column-name
|
The column name in the sequence-table used to store the name of the sequence for use by poid generators.
See Value Generation.
|
SEQUENCE_NAME
|
|
sequence-nextval-column-name
|
The column name in the sequence-table used to store the next value in the sequence for use by poid
generators. See Value Generation.
|
NEXT_VAL
|
|
key-min-value
|
The minimum key value for use by poid generators. Keys lower than this will not be generated.
See Value Generation.
|
|
|
key-max-value
|
The maximum key value for use by poid generators. Keys higher than this will not be generated.
See Value Generation.
|
|
|
key-start-with
|
The starting value for use by poid generators. Keys will start from this value when being generated.
See Value Generation.
|
|
|
key-increment-by
|
The increment value for use by poid generators. Keys will be incremented by this value when being
generated. See Value Generation.
|
|
|
key-database-cache-size
|
The database cache size for keys for use by poid generators. The cache of keys will be constrained by
this value. See Value Generation.
|
|
|
key-cache-size
|
The cache size for keys for use by poid generators. The cache of keys will be constrained by this value.
See Value Generation.
|
|
|
mapping-class
|
Specifies the mapping class to be used for mapping this field. This is only used where the user wants
to override the default DataNucleus mapping class and provide their own mapping class for this field.
|
Fully-qualified class name
|
These are attributes within the
<property>
tag (jdo/package/class/property).
This is used to define the persistence behaviour of the Java Bean properties of the class to which it
pertains. This element can be used to change the default behaviour and maybe not persist a property,
or to persist something that normally isn't persisted. It is used, in addition, to define more details
about how the property is persisted in the datastore.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the property. The "name" of a property is obtained by taking the
getXXX, setXXX method names and using the XXX and making the first letter lowercase.
|
|
|
persistence-modifier
|
The persistence-modifier specifies how to manage each property in your persistent class.
There are three options: persistent, transactional and none.
-
persistent
means that your field will be managed and stored in the database on
transaction commit.
-
transactional
means that your field will be managed but not stored in the
database. Transactional fields values will be saved by JDO when you start your
transaction and restored when you roll back your transaction.
-
none
means that your field will not be managed.
|
persistent, transactional, none
|
|
primary-key
|
Whether the property is part of any primary key (if using
application identity
).
|
true,
false
|
|
null-value
|
How to treat null values of persistent properties during storage.
|
exception, default,
none
|
|
default-fetch-group
|
Whether this property is part of the default fetch group for the class.
Defaults to true for non-key fields of primitive types, java.util.Date, java.lang.*,
java.math.*, etc.
|
true
, false
|
|
embedded
|
Whether this property should be stored, if possible, as part of the object instead as its
own object in the datastore. This defaults to true for primitive types, java.util.Date,
java.lang.*, java.math.* etc and false for PersistenceCapable, reference (Object, Interface)
and container types.
|
true, false
|
|
serialized
|
Whether this property should be stored serialised into a single column of the table of the
containing object.
|
true,
false
|
|
dependent
|
Whether the property should be used to check for dependent objects, and to delete them when
this object is deleted. In other words
cascade delete
capable.
|
true,
false
|
|
mapped-by
|
The name of the property at the other end of a relationship.
Used by 1-1, 1-N, M-N to mark a relation as bidirectional.
|
|
|
value-strategy
|
The strategy for populating values to this property. Is typically used for
generating primary key values.
See the definitions under "datastore-identity".
|
native | sequence | increment | identity | uuid-string | uuid-hex |
auid
|
max
|
timestamp
|
timestamp-value
|
[other values]
|
|
sequence
|
Name of the sequence to use to generate values, when using a
strategy
of
sequence
.
Please see also the
class
extension tags for controlling the sequence.
|
|
|
recursion-depth
|
The depth that will be recursed when this property is self-referencing.
Should be used alongside FetchPlan.setMaxFetchDepth() to control the objects fetched.
|
-1,
1
, 2, ... (integer)
|
|
field-type
|
Used to specify a more restrictive type than the property definition
in the class. This might be required in order to map the field to the datastore. To be
portable, specify the name of a single type that is itself able to be mapped to the datastore
(e.g. a field of type Object can specify field-type="Integer").
|
|
|
indexed
|
Whether the column(s) for this property should be indexed.
This is to be specified when defining index information
|
true | false | unique
|
|
table
|
Table name to use for any join table overriding the default name provided by DataNucleus.
This is used either for 1-N relationships with a join table
or for Secondary Tables.
See also the property name "datanucleus.identifier.case" in the
Persistence Properties Guide.
|
|
|
column
|
Column name to use for this property (alternative to specifying column sub-elements if
only one column).
|
|
|
delete-action
|
The foreign-key delete action. This is a shortcut to
specifying foreign key information. Please refer to
the <foreign-key> element for full details.
|
cascade | restrict | null | default | none
|
These are attributes within the
<extension>
tag (jdo/package/class/property/extension).
|
Attribute
|
Description
|
Values
|
|
Extension (JDO) Tags
|
|
cascade-persist
|
JDO defines that when an object is persisted then all fields will also be persisted
using "persistence-by-reachability". This extension allows you to turn off the persistence
of a field relation.
|
true
| false
|
|
cascade-update
|
JDO defines that when an object is updated then all fields containing PersistenceCapable objects will also
be updated using "persistence-by-reachability". This extension allows you to turn off the update
of a field relation.
|
true
| false
|
|
cascade-refresh
|
When calling PersistenceManager.refresh() only fetch plan fields of the passed object will be
refreshed. Setting this to true will refresh the fields of related PC objects in this field
|
true |
false
|
|
allows-null
|
When the field is a collection by default it will not be allowed to have nulls present
but you can allow them by setting this DataNucleus extension tag
|
true |
false
|
|
insertable
|
Whether this field should be supplied when inserting into the datastore.
|
true
| false
|
|
updateable
|
Whether this field should be supplied when updating the datastore.
|
true
| false
|
|
adapter-column-name
|
In some situations DataNucleus will add a special datastore column to a join table so that collections
can allow the storage of duplicate elements. This extension allows the specification of the column name
to be used. This should be specified within the field at the collection end of the relationship.
JDO2 doesnt allow a standard place for such a specification and so is an extension tag.
|
INTEGER_IDX
|
|
implementation-classes
|
Used to define the possible classes implementing this interface/Object field. This is used to limit the possible
tables that this is a foreign key to (when this field is specified as an interface/Object in the class).
Value should be comma-separated list of fully-qualified class names
|
|
|
key-implementation-classes
|
Used to define the possible classes implementing this interface/Object key. This is used to limit the possible
tables that this is a foreign key to (when this key is specified as an interface/Object).
Value should be comma-separated list of fully-qualified class names
|
|
|
value-implementation-classes
|
Used to define the possible classes implementing this interface/Object value. This is used to limit the possible
tables that this is a foreign key to (when this value is specified as an interface/Object).
Value should be comma-separated list of fully-qualified class names
|
|
|
strategy-when-notnull
|
This is to be used in conjunction with the "value-strategy" attribute. Default JDO2 behaviour when you
have a "value-strategy" defined for a field is to always create a strategy value for that field regardless
of whether you have set the value of the field yourself. This extension allows you to only apply the
strategy if the field is null at persistence. This extension has no effect on primitive field
types (which can't be null) and the value-strategy will always be applied to such fields.
|
true
| false
|
|
relation-discriminator-column
|
Name of a column to use for discrimination of the relation used by objects stored.
This is defined when, for example, a join table is shared by multiple relations and
the objects placed in the join table need discriminating for which relation they are for
|
RELATION_DISCRIM
|
|
relation-discriminator-pk
|
Whether the column added for the discrimination of relations is to be part of the PK when using a join table.
|
true |
false
|
|
relation-discriminator-value
|
Value to use in the relation discriminator column for objects of this fields relation.
This is defined when, for example, a join table is shared by multiple relations and
the objects placed in the join table need discriminating for which relation they are for.
|
Fully-qualified class name
|
|
select-function
|
Permits to use a function when fetching contents from the database. A ? (question mark) is mandatory to have
and will be replaced by the column name when generating the SQL statement.
For example to specify a value of
UPPER(?)
will convert to upper case the field
value on a datastore that supports that UPPER function.
|
|
|
insert-function
|
Permits to use a function when inserting into the database. A ? (question mark) is optional and will be
replaced by the column name when generating the SQL statement.
For example to specify a value of
TRIM(?)
will trim the field value
on a datastore that supports that TRIM function.
|
|
|
update-function
|
Permits to use a function when updating into the database. A ? (question mark) is optional and will be replaced
by the column name when generating the SQL statement.
For example to specify a value of
FUNC(?)
will perform FUNC() on the field value
on a datastore that supports that FUNC function.
|
|
|
sequence-table-basis
|
This defines the basis on which to generate unique identities when using the TablePoidGenerator
(used by the "increment" strategy, and sometimes by "native"). You can either define identities unique
against the base table name, or against the base class name (in an inheritance tree).
Used when the strategy is set to
native
or
increment
|
class
| table
|
|
sequence-catalog-name
|
The catalog used to store sequences for use by poid generators. See
Value Generation.
Default catalog for the datastore will be used if not specified.
|
|
|
sequence-schema-name
|
The schema used to store sequences for use by poid generators. See
Value Generation.
Default schema for the datastore will be used if not specified.
|
|
|
sequence-table-name
|
The table used to store sequences for use by poid generators. See
Value Generation.
|
SEQUENCE_TABLE
|
|
sequence-name-column-name
|
The column name in the sequence-table used to store the name of the sequence for use by poid generators.
See Value Generation.
|
SEQUENCE_NAME
|
|
sequence-nextval-column-name
|
The column name in the sequence-table used to store the next value in the sequence for use by poid
generators. See Value Generation.
|
NEXT_VAL
|
|
key-min-value
|
The minimum key value for use by poid generators. Keys lower than this will not be generated.
See Value Generation.
|
|
|
key-max-value
|
The maximum key value for use by poid generators. Keys higher than this will not be generated.
See Value Generation.
|
|
|
key-start-with
|
The starting value for use by poid generators. Keys will start from this value when being generated.
See Value Generation.
|
|
|
key-increment-by
|
The increment value for use by poid generators. Keys will be incremented by this value when being
generated. See Value Generation.
|
|
|
key-database-cache-size
|
The database cache size for keys for use by poid generators. The cache of keys will be constrained by
this value. See Value Generation.
|
|
|
key-cache-size
|
The cache size for keys for use by poid generators. The cache of keys will be constrained by this value.
See Value Generation.
|
|
|
mapping-class
|
Specifies the mapping class to be used for mapping this field. This is only used where the user wants
to override the default DataNucleus mapping class and provide their own mapping class for this field.
|
Fully-qualified class name
|
These are attributes within the
<fetch-group>
tag (jdo/package/class/fetch-group). This element is
used to define fetch groups that are utilised at runtime, and are of particular use with attach/detach.
This element can contain
fetch-group
sub-elements allowing definition of hierarchical groups.
It can also contain
field
elements, defining the fields that are part of this fetch-group.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the fetch group. Used with the fetch plan of the PersistenceManager.
|
|
|
post-load
|
Whether to call jdoPostLoad when the fetch group is invoked.
|
true | false
|
These are attributes within the
<embedded>
tag (jdo/package/class/embedded). It is used when this
field is a PersistenceCapable and is embedded into the same table as the class.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
owner-field
|
Name of the field in the embedded PersistenceCapable that is the link back to the owning object (if any).
|
|
|
null-indicator-column
|
Name of the column to be used for detacting if the embedded object is null.
|
|
|
null-indicator-value
|
Value of the null-indicator-column that signifies that the embedded object is null.
|
|
These are attributes within the
<key>
tag (jdo/package/class/field/key). This element is used
to define details for the persistence of a Map.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
mapped-by
|
When the map is formed by a foreign-key, the key can be a field in a value PersistenceCapable class.
This attribute defines which field in the value class is used as the key
|
|
|
column
|
Name of the column (if only one)
|
|
|
delete-action
|
Action to be performed when the owner object is deleted.
This is to be specified when defining foreign key information
|
cascade | restrict | null | default | none
|
|
indexed
|
Whether the key column should be indexed.
This is to be specified when defining index information
|
true | false | unique
|
|
unique
|
Whether the key column should be unique.
This is to be specified when defining unique key information
|
true | false
|
These are attributes within the
<value>
tag (jdo/package/class/field/value). This element is used
to define details for the persistence of a Map.
|
Attribute
|
Description
|
Values
|
|
mapped-by
|
When the map is formed by a foreign-key, the value can be a field in a key PersistenceCapable class.
This attribute defines which field in the key class is used as the value.
|
|
|
Standard (JDO) Tags
|
|
column
|
Name of the column (if only one)
|
|
|
delete-action
|
Action to be performed when the owner object is deleted.
This is to be specified when defining foreign key information
|
cascade | restrict | null | default | none
|
|
indexed
|
Whether the value column should be indexed.
This is to be specified when defining index information
|
true | false | unique
|
|
unique
|
Whether the value column should be unique.
This is to be specified when defining unique key information
|
true | false
|
These are attributes within the
<order>
tag (jdo/package/class/field/order).
This is used to define the column details for the ordering column in a List.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
mapped-by
|
When a List is formed by a foreign-key, the ordering can be a field in the element
PersistenceCapable class. This attribute defines which field in the element class is used as
the ordering. The field must be of type
int
,
Integer
,
long
,
Long
.
DataNucleus will write the index positions to this field (starting at 0 for the first item in the List)
|
|
|
column
|
Name of the column to use for ordering.
|
|
These are attributes within the
<extension>
tag (jdo/package/class/field/order/extension).
|
Attribute
|
Description
|
Values
|
|
Extension (JDO) Tags
|
|
list-ordering
|
Used to make the list be an "ordered list" where it has no index column and instead
will order the elements by the specified expression upon retrieval. The ordering expression
takes names and ASC/DESC and can be a composite
|
{valid ordering expression}
|
These are attributes within the
<index>
tag (jdo/package/class/field/index). This element is used where
a user wishes to add specific indexes to the datastore to provide more efficient access to particular fields.
|
Attribute
|
Description
|
Values
|
|
Standard (JDO) Tags
|
|
name
|
Name of the index in the datastore
|
|
|
unique
|
Whether the index is unique
|
true | false
|
|
column
|
Name of the column to use (alternative to specifying it as a sub-element).
|
|
These are attributes within the
<extension>
tag (jdo/package/class/field/index/extension).
|
Attribute
|
Description
|
Values
|
|
Extension (JDO) Tags
|
|
extended-setting
|
Additional settings to the index. This extension is used to set database proprietary settings.
|
|
These are attributes within the
<foreign-key>
tag (jdo/package/class/field/foreign-key). This is
used where the user wishes to define the behaviour of the foreign keys added due to the relationships in the object model.
This is to be read in conjunction with foreign-key guide
|
Attribute
|
Description
|
Values
|
|
|
|
|