Package org.datanucleus.metadata
Class PackageMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.PackageMetaData
- All Implemented Interfaces:
Serializable
Representation of the Meta-Data for a package.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Catalog name for all classes in this packageprotected List
<ClassMetaData> List of classes (uses List to retain positioning).protected List
<InterfaceMetaData> List of interfaces (uses List to retain positioning).protected final String
Package nameprotected String
Schema name for all classes in this packageprotected Collection
<SequenceMetaData> Sequence generators.private static final long
protected Collection
<TableGeneratorMetaData> Table generators.Fields inherited from class org.datanucleus.metadata.MetaData
EXTENSION_CLASS_CREATETIMESTAMP, EXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_CREATEUSER, EXTENSION_CLASS_CREATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_CREATEUSER_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH, EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE, EXTENSION_CLASS_MULTITENANT, EXTENSION_CLASS_READ_ONLY, EXTENSION_CLASS_SOFTDELETE, EXTENSION_CLASS_SOFTDELETE_COLUMN_NAME, EXTENSION_CLASS_UPDATETIMESTAMP, EXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_UPDATEUSER, EXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_UPDATEUSER_COLUMN_NAME, EXTENSION_CLASS_VERSION_FIELD_NAME, EXTENSION_CLASS_VIEW_DEFINITION, EXTENSION_CLASS_VIEW_IMPORTS, EXTENSION_INDEX_COLUMN_ORDERING, EXTENSION_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_ATTACH, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_CREATE_TIMESTAMP, EXTENSION_MEMBER_CREATE_USER, EXTENSION_MEMBER_ENUM_VALUE_GETTER, EXTENSION_MEMBER_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_INSERTABLE, EXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_LIST_ORDERING, EXTENSION_MEMBER_RELATION_DISCRIM_COLUMN, EXTENSION_MEMBER_RELATION_DISCRIM_PK, EXTENSION_MEMBER_RELATION_DISCRIM_VALUE, EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL, EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED, EXTENSION_MEMBER_TYPE_CONVERTER_NAME, EXTENSION_MEMBER_UPDATE_TIMESTAMP, EXTENSION_MEMBER_UPDATE_USER, EXTENSION_MEMBER_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, metaDataState, parent, VENDOR_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClass
(ClassMetaData cmd) Method to add a class Meta-Data to the package.Method to add a interface Meta-Data to the package.void
addSequence
(SequenceMetaData seqmd) Method to add a sequence Meta-Data to the package.void
Method to add a TableGenerator Meta-Data to the package.Accessor for the catalog name for all classes in this packagegetClass
(int i) Accessor for the Meta-Data of a class in this package.Accessor for the Meta-Data of a class with the specified name.Accessor for the parent FileMetaData.getInterface
(int i) Accessor for the Meta-Data of a interface in this package.getInterface
(String name) Accessor for the Meta-Data of an interface with the specified name.getName()
Accessor for the name of the packageint
Accessor for the number of classes.int
Accessor for the number of interfaces.int
Accessor for the number of sequences.int
Accessor for the number of table generators.Accessor for the schema name for all classes in this packagegetSequence
(String name) Accessor for the Meta-Data of an sequence with the specified name.Accessor for the Meta-Data for the sequences in this package.getTableGenerator
(String name) Accessor for the Meta-Data of a table generator with the specified name.Accessor for the Meta-Data for the table generators in this package.void
newClassMetaData
(String className) Method to create a new class metadata, add it, and return it.newInterfaceMetaData
(String intfName) Method to create a new interface metadata, add it, and return it.newSequenceMetaData
(String seqName, String seqStrategy) Method to create a new Sequence metadata, add it, and return it.Method to create a new TableGenerator metadata, add it and return it.void
Method to remove a class from this metadata definition.setCatalog
(String catalog) Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setInitialised, setParent, setPopulated, setUsed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
interfaces
List of interfaces (uses List to retain positioning). -
classes
List of classes (uses List to retain positioning). -
sequences
Sequence generators. -
tableGenerators
Table generators. -
name
Package name -
catalog
Catalog name for all classes in this package -
schema
Schema name for all classes in this package
-
-
Constructor Details
-
PackageMetaData
PackageMetaData(String name) Constructor. Create packages using FileMetaData.newPackageMetaData()- Parameters:
name
- Name of package
-
-
Method Details
-
initialise
- Overrides:
initialise
in classMetaData
-
getFileMetaData
Accessor for the parent FileMetaData.- Returns:
- File MetaData.
-
getName
Accessor for the name of the package- Returns:
- package name
-
getCatalog
Accessor for the catalog name for all classes in this package- Returns:
- Catalog name to use.
-
getSchema
Accessor for the schema name for all classes in this package- Returns:
- Schema name to use.
-
getNoOfInterfaces
public int getNoOfInterfaces()Accessor for the number of interfaces.- Returns:
- Number of interfaces.
-
getInterface
Accessor for the Meta-Data of a interface in this package.- Parameters:
i
- interface index- Returns:
- Meta-Data for the interface
-
getInterface
Accessor for the Meta-Data of an interface with the specified name.- Parameters:
name
- the name of the interface- Returns:
- Meta-Data for the interface
-
getNoOfClasses
public int getNoOfClasses()Accessor for the number of classes.- Returns:
- Number of classes.
-
getClass
Accessor for the Meta-Data of a class in this package.- Parameters:
i
- class index- Returns:
- Meta-Data for the class
-
getClass
Accessor for the Meta-Data of a class with the specified name.- Parameters:
name
- the name of the class- Returns:
- Meta-Data for the class.
-
getNoOfSequences
public int getNoOfSequences()Accessor for the number of sequences.- Returns:
- Number of sequences.
-
getSequences
Accessor for the Meta-Data for the sequences in this package.- Returns:
- Meta-Data for the sequences
-
getSequence
Accessor for the Meta-Data of an sequence with the specified name.- Parameters:
name
- the name of the sequence- Returns:
- Meta-Data for the sequence
-
getNoOfTableGenerators
public int getNoOfTableGenerators()Accessor for the number of table generators.- Returns:
- Number of table generators.
-
getTableGenerators
Accessor for the Meta-Data for the table generators in this package.- Returns:
- Meta-Data for the table generators
-
getTableGenerator
Accessor for the Meta-Data of a table generator with the specified name.- Parameters:
name
- the name of the table generator- Returns:
- Meta-Data for the table generator
-
addClass
Method to add a class Meta-Data to the package.- Parameters:
cmd
- Meta-Data for the class- Returns:
- The class metadata that was added (or already existing)
-
removeClass
Method to remove a class from this metadata definition. This is of use where we read in metadata only to find that the class that it pertains to is not in the CLASSPATH.- Parameters:
cmd
- Metadata for the class to remove
-
newClassMetaData
Method to create a new class metadata, add it, and return it.- Parameters:
className
- Name of the class (in this package)- Returns:
- The class metadata
-
addInterface
Method to add a interface Meta-Data to the package.- Parameters:
imd
- Meta-Data for the interface- Returns:
- The interface metadata that was added (or already existing)
-
newInterfaceMetaData
Method to create a new interface metadata, add it, and return it.- Parameters:
intfName
- Name of the interface (in this package)- Returns:
- The interface metadata
-
addSequence
Method to add a sequence Meta-Data to the package.- Parameters:
seqmd
- Meta-Data for the sequence
-
newSequenceMetaData
Method to create a new Sequence metadata, add it, and return it.- Parameters:
seqName
- Name of the sequenceseqStrategy
- Strategy for the sequence- Returns:
- The sequence metadata
-
addTableGenerator
Method to add a TableGenerator Meta-Data to the package.- Parameters:
tabmd
- Meta-Data for the TableGenerator
-
newTableGeneratorMetaData
Method to create a new TableGenerator metadata, add it and return it.- Parameters:
name
- Name of the table generator- Returns:
- The metadata
-
setCatalog
-
setSchema
-