org.ujoframework.orm.metaModel
Class MetaRoot

java.lang.Object
  extended by org.ujoframework.extensions.AbstractUjo
      extended by org.ujoframework.implementation.quick.QuickUjo
          extended by org.ujoframework.orm.AbstractMetaModel
              extended by org.ujoframework.orm.metaModel.MetaRoot
All Implemented Interfaces:
java.io.Serializable, UjoCloneable, UjoTextable, Ujo

public final class MetaRoot
extends AbstractMetaModel

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

Author:
Pavel Ponec
See Also:
Serialized Form

Field Summary
static ListProperty<MetaRoot,MetaDatabase> DATABASES
          List of tables
static Property<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(java.lang.String name)
          Returns the first database with required name or returns null.
 void print(java.io.File file)
          Pring all model in a XML format
 void print(java.io.Writer writer)
          Pring all model in a XML format
 MetaDatabase removeDb(java.lang.String schemaName)
          Returns the first database with the same schemaName - and remove it from the list.
 java.lang.String toString()
          Returns all model in a XML format
 
Methods inherited from class org.ujoframework.orm.AbstractMetaModel
get, changeDefault, checkReadOnly, isUsable, isUsable, readAuthorization, readOnly, setReadOnly, writeValue
 
Methods inherited from class org.ujoframework.implementation.quick.QuickUjo
newListProperty, newListProperty, newProperty, newProperty, newProperty, newProperty, newProperty, newProperty, readValue
 
Methods inherited from class org.ujoframework.extensions.AbstractUjo
clone, equals, init, init, readProperties, readUjoManager, readValueString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATABASES

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


PARAMETERS

public static final Property<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(java.lang.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.

add

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


toString

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

Overrides:
toString in class AbstractUjo

print

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

Throws:
java.io.IOException

print

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

Throws:
java.io.IOException

removeDb

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

Parameters:
schemaName - The identifier for looking the database


Copyright © 2010. All Rights Reserved.