Package org.datanucleus.metadata
Class FileMetaData
- java.lang.Object
-
- org.datanucleus.metadata.MetaData
-
- org.datanucleus.metadata.FileMetaData
-
- All Implemented Interfaces:
Serializable
public class FileMetaData extends MetaData
Representation of a Meta-Data file. Contains a list of package meta-data, together with any named queries and fetch plans etc.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
catalog
Catalog name for all classes in this fileprotected Collection<FetchPlanMetaData>
fetchPlans
Named FetchPlans in this file.protected String
filename
Name of fileprotected List<EventListenerMetaData>
listeners
List of event listeners defined for this file.protected List<PackageMetaData>
packages
List of packages in this file (uses List to retain file positioning)protected Collection<QueryMetaData>
queries
Named queries defined in this file.protected Collection<QueryResultMetaData>
queryResultMetaData
List of query result MetaData defined for this file.protected String
schema
Schema name for all classes in this fileprotected Collection<StoredProcQueryMetaData>
storedProcs
Named stored procedures defined in this file.protected MetadataFileType
type
Type of file (JDO, ORM, JDOQUERY, etc)-
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_DISABLE, EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE, 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_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_CASCADE_UPDATE, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_ENUM_GETTER_BY_VALUE, EXTENSION_MEMBER_ENUM_VALUE_GETTER, EXTENSION_MEMBER_FETCH_FK_ONLY, 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_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME
-
-
Constructor Summary
Constructors Constructor Description FileMetaData()
FileMetaData(String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(EventListenerMetaData listener)
Add a listener class namevoid
addQueryResultMetaData(QueryResultMetaData resultMetaData)
Method to register a query-result MetaData.String
getCatalog()
ClassMetaData
getClass(String pkg_name, String class_name)
Utility method to check if the MetaData for a class is contained in this file.FetchPlanMetaData[]
getFetchPlans()
Accessor for the metadata of the named fetch plans.String
getFilename()
List<EventListenerMetaData>
getListeners()
Get the event listeners registered against the file.int
getNoOfFetchPlans()
Accessor for the number of named fetch plans.int
getNoOfPackages()
Accessor for the number of packages.int
getNoOfQueries()
Accessor for the number of named queries.int
getNoOfStoredProcQueries()
Accessor for the number of named queries.PackageMetaData
getPackage(int i)
Accessor for the meta-data of a package.PackageMetaData
getPackage(String name)
Accessor for the Meta-Data of a package with a given name.QueryMetaData[]
getQueries()
Accessor for the metadata of the named queries.QueryResultMetaData[]
getQueryResultMetaData()
Get the query result MetaData.String
getSchema()
StoredProcQueryMetaData[]
getStoredProcQueries()
Accessor for the metadata of the named stored procedure queries.MetadataFileType
getType()
FetchPlanMetaData
newFetchPlanMetadata(String name)
PackageMetaData
newPackageMetadata(String name)
Method to create and return a package metadata for the specified package name.QueryMetaData
newQueryMetadata(String queryName)
Method to create a new QueryMetadata, add it to the registered queries and return it.QueryResultMetaData
newQueryResultMetadata(String name)
Method to create a new query result metadata, add it, and return it.StoredProcQueryMetaData
newStoredProcQueryMetaData(String queryName)
Method to create a new StoredProcQueryMetadata, add it to the registered queries and return it.FileMetaData
setCatalog(String catalog)
FileMetaData
setFilename(String filename)
FileMetaData
setSchema(String schema)
FileMetaData
setType(MetadataFileType type)
-
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setParent
-
-
-
-
Field Detail
-
type
protected MetadataFileType type
Type of file (JDO, ORM, JDOQUERY, etc)
-
filename
protected String filename
Name of file
-
catalog
protected String catalog
Catalog name for all classes in this file
-
schema
protected String schema
Schema name for all classes in this file
-
queries
protected Collection<QueryMetaData> queries
Named queries defined in this file.
-
storedProcs
protected Collection<StoredProcQueryMetaData> storedProcs
Named stored procedures defined in this file.
-
queryResultMetaData
protected Collection<QueryResultMetaData> queryResultMetaData
List of query result MetaData defined for this file.
-
fetchPlans
protected Collection<FetchPlanMetaData> fetchPlans
Named FetchPlans in this file.
-
packages
protected List<PackageMetaData> packages
List of packages in this file (uses List to retain file positioning)
-
listeners
protected List<EventListenerMetaData> listeners
List of event listeners defined for this file.
-
-
Constructor Detail
-
FileMetaData
public FileMetaData()
-
FileMetaData
public FileMetaData(String filename)
-
-
Method Detail
-
getFilename
public String getFilename()
-
setFilename
public FileMetaData setFilename(String filename)
-
getCatalog
public String getCatalog()
-
setCatalog
public FileMetaData setCatalog(String catalog)
-
getSchema
public String getSchema()
-
setSchema
public FileMetaData setSchema(String schema)
-
getType
public MetadataFileType getType()
-
setType
public FileMetaData setType(MetadataFileType type)
-
getNoOfQueries
public int getNoOfQueries()
Accessor for the number of named queries.- Returns:
- no of named queries
-
getQueries
public QueryMetaData[] getQueries()
Accessor for the metadata of the named queries.- Returns:
- Meta-Data for the named queries.
-
getNoOfStoredProcQueries
public int getNoOfStoredProcQueries()
Accessor for the number of named queries.- Returns:
- no of named queries
-
getStoredProcQueries
public StoredProcQueryMetaData[] getStoredProcQueries()
Accessor for the metadata of the named stored procedure queries.- Returns:
- Meta-Data for the named stored proc queries.
-
getNoOfFetchPlans
public int getNoOfFetchPlans()
Accessor for the number of named fetch plans.- Returns:
- no of named fetch plans
-
getFetchPlans
public FetchPlanMetaData[] getFetchPlans()
Accessor for the metadata of the named fetch plans.- Returns:
- Meta-Data for the named fetch plans.
-
getNoOfPackages
public int getNoOfPackages()
Accessor for the number of packages.- Returns:
- no of packages.
-
getPackage
public PackageMetaData getPackage(int i)
Accessor for the meta-data of a package.- Parameters:
i
- index number- Returns:
- Meta-Data for a package.
-
getPackage
public PackageMetaData getPackage(String name)
Accessor for the Meta-Data of a package with a given name.- Parameters:
name
- Name of the package- Returns:
- Meta-Data for the package
-
getClass
public ClassMetaData getClass(String pkg_name, String class_name)
Utility method to check if the MetaData for a class is contained in this file.- Parameters:
pkg_name
- Name of packageclass_name
- Name of class- Returns:
- The MetaData for the class
-
newQueryMetadata
public QueryMetaData newQueryMetadata(String queryName)
Method to create a new QueryMetadata, add it to the registered queries and return it.- Parameters:
queryName
- Name of the query- Returns:
- The Query metadata
-
newStoredProcQueryMetaData
public StoredProcQueryMetaData newStoredProcQueryMetaData(String queryName)
Method to create a new StoredProcQueryMetadata, add it to the registered queries and return it.- Parameters:
queryName
- Name of the query- Returns:
- The Query metadata
-
newFetchPlanMetadata
public FetchPlanMetaData newFetchPlanMetadata(String name)
-
newPackageMetadata
public PackageMetaData newPackageMetadata(String name)
Method to create and return a package metadata for the specified package name.- Parameters:
name
- Name of the package- Returns:
- The PackageMetadata
-
addListener
public void addListener(EventListenerMetaData listener)
Add a listener class name- Parameters:
listener
- the listener metadata. Duplicated classes are ignored
-
getListeners
public List<EventListenerMetaData> getListeners()
Get the event listeners registered against the file.- Returns:
- the event listeners
-
addQueryResultMetaData
public void addQueryResultMetaData(QueryResultMetaData resultMetaData)
Method to register a query-result MetaData.- Parameters:
resultMetaData
- Query-Result MetaData to register
-
newQueryResultMetadata
public QueryResultMetaData newQueryResultMetadata(String name)
Method to create a new query result metadata, add it, and return it.- Parameters:
name
- Name of the result- Returns:
- The query result metadata
-
getQueryResultMetaData
public QueryResultMetaData[] getQueryResultMetaData()
Get the query result MetaData.- Returns:
- Query Result MetaData
-
-