org.datanucleus.metadata
Class PersistenceFileMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.PersistenceFileMetaData
All Implemented Interfaces:
java.io.Serializable

public class PersistenceFileMetaData
extends MetaData

Representation of a Meta-Data "persistence.xml" file. Contains a set of "persistence-unit" meta-data.

Since:
1.1
Version:
$Revision: 1.4 $
See Also:
Serialized Form

Field Summary
protected  java.lang.String filename
          Filename of the "persistence.xml"
protected  java.util.HashSet persistenceUnits
          Persistence units defined in this file.
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
PersistenceFileMetaData(java.lang.String filename)
          Constructor.
 
Method Summary
 void addPersistenceUnit(PersistenceUnitMetaData pumd)
          Method to add a persistence unit
 java.lang.String getFilename()
          Accessor for the filename
 int getNoOfPersistenceUnits()
          Accessor for the number of persistence units.
 PersistenceUnitMetaData getPersistenceUnit(java.lang.String name)
          Accessor for the Meta-Data of a persistence unit with a given name.
 PersistenceUnitMetaData[] getPersistenceUnits()
          Accessor for the persistence units in this "persistence.xml" file.
 void setFilename(java.lang.String filename)
          Mutator for the filename for this MetaData file.
 java.lang.String toString(java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filename

protected java.lang.String filename
Filename of the "persistence.xml"


persistenceUnits

protected java.util.HashSet persistenceUnits
Persistence units defined in this file.

Constructor Detail

PersistenceFileMetaData

public PersistenceFileMetaData(java.lang.String filename)
Constructor.

Parameters:
filename - The file where this is stored (or null).
Method Detail

getFilename

public java.lang.String getFilename()
Accessor for the filename

Returns:
The filename of this MetaData file.

getNoOfPersistenceUnits

public int getNoOfPersistenceUnits()
Accessor for the number of persistence units.

Returns:
no of persistence units.

getPersistenceUnit

public PersistenceUnitMetaData getPersistenceUnit(java.lang.String name)
Accessor for the Meta-Data of a persistence unit with a given name.

Parameters:
name - Name of the persistence unit
Returns:
Meta-Data for the persistence unit

getPersistenceUnits

public PersistenceUnitMetaData[] getPersistenceUnits()
Accessor for the persistence units in this "persistence.xml" file.

Returns:
The persistence units

setFilename

public void setFilename(java.lang.String filename)
Mutator for the filename for this MetaData file.

Parameters:
filename - The filename of this MetaData file.

addPersistenceUnit

public void addPersistenceUnit(PersistenceUnitMetaData pumd)
Method to add a persistence unit

Parameters:
pumd - The PersistenceUnitMetaData to add.

toString

public java.lang.String toString(java.lang.String indent)
Returns a string representation of the object.

Parameters:
indent - The indent
Returns:
a string representation of the object.


Copyright © 2009. All Rights Reserved.