org.ujorm.orm.metaModel
Class MetaRoot

java.lang.Object
  extended by org.ujorm.extensions.SuperAbstractUjo
      extended by org.ujorm.extensions.AbstractUjo
          extended by org.ujorm.orm.AbstractMetaModel
              extended by org.ujorm.orm.metaModel.MetaRoot
All Implemented Interfaces:
Serializable, UjoCloneable, UjoLockable, UjoTextable, Ujo

public final class MetaRoot
extends AbstractMetaModel

A logical database description. The class is a root of database configuration.

See Also:
Serialized Form

Field Summary
static ListKey<MetaRoot,MetaDatabase> DATABASES
          List of tables
static Key<MetaRoot,MetaParams> PARAMETERS
          ORM parameters
 
Constructor Summary
MetaRoot()
           
 
Method Summary
 void add(MetaDatabase database)
          Add a new database into repository.
 MetaDatabase getDatabase()
          Returns the first database or return null
 MetaDatabase getDatabase(String name)
          Returns the first database with required name or returns null.
 int getDatabaseCount()
          Returns the total count of databases.
 void print(File file)
          Pring all model in a XML format
 void print(Writer writer)
          Pring all model in a XML format
 MetaDatabase removeDb(String databaseId)
          Returns the first database with the same schemaName - and remove it from the list.
 String toString()
          Returns all model in a XML format
 
Methods inherited from class org.ujorm.orm.AbstractMetaModel
changeDefault, checkReadOnly, clearReadOnly, get, lock, readAuthorization, readOnly, setReadOnly, writeValue
 
Methods inherited from class org.ujorm.extensions.AbstractUjo
newCamelFactory, newFactory, readValue
 
Methods inherited from class org.ujorm.extensions.SuperAbstractUjo
clone, equals, init, init, readKeys, readUjoManager, readValueString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ujorm.Ujo
readKeys, readValue
 

Field Detail

DATABASES

public static final ListKey<MetaRoot,MetaDatabase> DATABASES
List of tables


PARAMETERS

public static final Key<MetaRoot,MetaParams> PARAMETERS
ORM parameters

Constructor Detail

MetaRoot

public MetaRoot()
Method Detail

getDatabase

public MetaDatabase getDatabase()
Returns the first database or return null


getDatabase

public MetaDatabase getDatabase(String name)
Returns the first database with required name or returns null.

Parameters:
name - If the parameter "name" is null than method returns a first database.

getDatabaseCount

public int getDatabaseCount()
Returns the total count of databases.


add

public final void add(MetaDatabase database)
Add a new database into repository.


toString

public String toString()
Returns all model in a XML format

Overrides:
toString in class SuperAbstractUjo

print

public void print(Writer writer)
           throws IOException
Pring all model in a XML format

Throws:
IOException

print

public void print(File file)
           throws IOException
Pring all model in a XML format

Throws:
IOException

removeDb

public MetaDatabase removeDb(String databaseId)
Returns the first database with the same schemaName - and remove it from the list. The method is for internal use only.

Parameters:
databaseId - The identifier for looking the database


Copyright 2013, Pavel Ponec