org.ujoframework.orm.metaModel
Class MetaTable

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.MetaTable
All Implemented Interfaces:
java.io.Serializable, UjoCloneable, UjoTextable, Ujo

public final class MetaTable
extends AbstractMetaModel

DB table or view meta-model.

Author:
Pavel Ponec
See Also:
Serialized Form

Field Summary
static Property<MetaTable,java.lang.String> ALIAS
          The unique table/view name over all Databases in scope one OrmHandler
static ListProperty<MetaTable,MetaColumn> COLUMNS
          Table Columns (no relations)
static Property<MetaTable,MetaDatabase> DATABASE
          Database
static Property<MetaTable,RelationToMany> DB_PROPERTY
          Database relative property (a base definition of table)
static Property<MetaTable,java.lang.String> ID
          The meta-model id
static Property<MetaTable,java.lang.String> NAME
          DB table name
static Property<MetaTable,MetaPKey> PK
          Unique Primary Key
static ListProperty<MetaTable,MetaRelation2Many> RELATIONS
          Table relations to many
static Property<MetaTable,java.lang.String> SELECT
          SQL SELECT statement
static Property<MetaTable,MetaSelect> SELECT_MODEL
          SQL SELECT model.
static Property<MetaTable,java.lang.String> SEQUENCE
          Name of DB sequence.
static Property<MetaTable,java.lang.String> SCHEMA
          Name of table schema.
static Property<MetaTable,java.lang.Boolean> VIEW
          Is it a model of a database view or table ?
 
Constructor Summary
MetaTable()
          No parameter constructor.
MetaTable(MetaDatabase database, RelationToMany dbProperty, MetaTable parTable)
          Create new MetaTable.
 
Method Summary
 void assignPrimaryKey(OrmUjo bo, Session session)
          Assign a PK from framework
 OrmUjo createBO()
          Returns a new instance or the BO.
 boolean equals(java.lang.Object obj)
          Compare object by the same instance.
 java.lang.String getAlias()
          Returns a unique table name over all Databases of the one OrmHandler.
 MetaDatabase getDatabase()
          Returns the database
 MetaColumn getFirstPK()
          Returns the first PK
 java.util.List<MetaColumn> getForeignColumns()
          Get all foreign columns
 java.util.Collection<MetaIndex> getIndexCollection()
          Create a collection of the table indexes.
 UjoSequencer getSequencer()
          UJO sequencer
 java.lang.Class<OrmUjo> getType()
          Returns a base table class.
 boolean isPersistent()
          Is the instance a database relation model?
 boolean isSelectModel()
          Is the query from a SQL select model ?
 boolean isTable()
          Is the instance a database persistent table?
 boolean isView()
          Is the instance a database relation model?
 void setNotPersistent()
          Database model is not persistent.
 
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, init, init, readProperties, readUjoManager, readValueString, toString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final Property<MetaTable,java.lang.String> ID
The meta-model id


NAME

public static final Property<MetaTable,java.lang.String> NAME
DB table name


ALIAS

public static final Property<MetaTable,java.lang.String> ALIAS
The unique table/view name over all Databases in scope one OrmHandler


SCHEMA

public static final Property<MetaTable,java.lang.String> SCHEMA
Name of table schema.


SEQUENCE

public static final Property<MetaTable,java.lang.String> SEQUENCE
Name of DB sequence. The value is not used by default, however a special implementation of the UjoSequencer can do it.


COLUMNS

public static final ListProperty<MetaTable,MetaColumn> COLUMNS
Table Columns (no relations)


RELATIONS

public static final ListProperty<MetaTable,MetaRelation2Many> RELATIONS
Table relations to many


VIEW

public static final Property<MetaTable,java.lang.Boolean> VIEW
Is it a model of a database view or table ?


SELECT

public static final Property<MetaTable,java.lang.String> SELECT
SQL SELECT statement


SELECT_MODEL

public static final Property<MetaTable,MetaSelect> SELECT_MODEL
SQL SELECT model. Note: this property must not be persistent due a blank spaces in key names!


PK

public static final Property<MetaTable,MetaPKey> PK
Unique Primary Key


DB_PROPERTY

public static final Property<MetaTable,RelationToMany> DB_PROPERTY
Database relative property (a base definition of table)


DATABASE

public static final Property<MetaTable,MetaDatabase> DATABASE
Database

Constructor Detail

MetaTable

public MetaTable()
No parameter constructor.


MetaTable

public MetaTable(MetaDatabase database,
                 RelationToMany dbProperty,
                 MetaTable parTable)
Create new MetaTable.

Parameters:
database - Database for the table
dbProperty - Configuration property
parTable - Configuration data from a XML file
Method Detail

assignPrimaryKey

public void assignPrimaryKey(OrmUjo bo,
                             Session session)
Assign a PK from framework


createBO

public OrmUjo createBO()
                throws java.lang.InstantiationException,
                       java.lang.IllegalAccessException
Returns a new instance or the BO.

Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

getType

public final java.lang.Class<OrmUjo> getType()
Returns a base table class.


getFirstPK

public MetaColumn getFirstPK()
Returns the first PK


isPersistent

public boolean isPersistent()
Is the instance a database relation model?


isView

public boolean isView()
Is the instance a database relation model?


isTable

public boolean isTable()
Is the instance a database persistent table? A false value neans that the object is a relation model or view.


isSelectModel

public boolean isSelectModel()
Is the query from a SQL select model ?


setNotPersistent

public void setNotPersistent()
Database model is not persistent. A side efect is that the DATABASE property has hot a null value.


getAlias

public java.lang.String getAlias()
Returns a unique table name over all Databases of the one OrmHandler.


getDatabase

public final MetaDatabase getDatabase()
Returns the database


equals

public boolean equals(java.lang.Object obj)
Compare object by the same instance.

Overrides:
equals in class AbstractUjo

getForeignColumns

public java.util.List<MetaColumn> getForeignColumns()
Get all foreign columns


getSequencer

public UjoSequencer getSequencer()
UJO sequencer


getIndexCollection

public java.util.Collection<MetaIndex> getIndexCollection()
Create a collection of the table indexes.



Copyright © 2010. All Rights Reserved.