org.ujorm.orm.metaModel
Class MetaRelation2Many

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.MetaRelation2Many
All Implemented Interfaces:
Serializable, UjoCloneable, UjoLockable, UjoTextable, Ujo
Direct Known Subclasses:
MetaColumn

public class MetaRelation2Many
extends AbstractMetaModel

The database/object relation to many.

See Also:
Serialized Form

Field Summary
static Key<MetaRelation2Many,String> ID
          The meta-model ID.
static Key<MetaRelation2Many,String> NAME
          The database column name.
static Key<MetaRelation2Many,MetaTable> TABLE
          DB table
static Key<MetaRelation2Many,Key> TABLE_KEY
          The direct table key
 
Constructor Summary
MetaRelation2Many()
           
MetaRelation2Many(MetaTable table, Key tableKey, MetaRelation2Many param)
          Meta-model for a relation to many
 
Method Summary
 boolean equals(Object relation)
          Two models are the same if its key names are the same for the same domain type.
 OrmHandler getHandler()
          OrmHandler
 String getId()
          Returns the ID of the column
 Key getKey()
          Returns a column direct key
 MetaTable getTable()
          Returns a table model
 String getTableAlias()
          Returns an alias of the table model
 Class<OrmUjo> getTableClass()
          Returns a class of column table.
 Object getValue(Ujo ujo)
          Get key value
 int hashCode()
           
 boolean isColumn()
          It is a DB column (either a value of a foreign key), not a relation to many.
 boolean isCompositeKey()
          Is it newer the composite Key
 boolean isForeignKey()
          Is it a Foreign Key ?
 boolean isTypeOf(Class type)
          Returns true if the key type is a type or subtype of the parameter class.
 String toString()
          Key name
 
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, init, init, readKeys, readUjoManager, readValueString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ujorm.Ujo
readKeys, readValue
 

Field Detail

ID

public static final Key<MetaRelation2Many,String> ID
The meta-model ID.


NAME

public static final Key<MetaRelation2Many,String> NAME
The database column name. If an appropriate Key is a relation to another ORM object with more primary keys, then the several names can be separated by a space or comma character.


TABLE_KEY

public static final Key<MetaRelation2Many,Key> TABLE_KEY
The direct table key


TABLE

public static final Key<MetaRelation2Many,MetaTable> TABLE
DB table

Constructor Detail

MetaRelation2Many

public MetaRelation2Many()

MetaRelation2Many

public MetaRelation2Many(MetaTable table,
                         Key tableKey,
                         MetaRelation2Many param)
Meta-model for a relation to many

Parameters:
table - Related Table
tableKey - The direct Key
param - XML content
Method Detail

isColumn

public boolean isColumn()
It is a DB column (either a value of a foreign key), not a relation to many.


isForeignKey

public boolean isForeignKey()
Is it a Foreign Key ?


getId

public final String getId()
Returns the ID of the column


getKey

public final Key getKey()
Returns a column direct key


isCompositeKey

public final boolean isCompositeKey()
Is it newer the composite Key


isTypeOf

public final boolean isTypeOf(Class type)
Returns true if the key type is a type or subtype of the parameter class.


getTable

public final MetaTable getTable()
Returns a table model


getTableAlias

public final String getTableAlias()
Returns an alias of the table model


getTableClass

public final Class<OrmUjo> getTableClass()
Returns a class of column table.


getValue

public final Object getValue(Ujo ujo)
Get key value


getHandler

public OrmHandler getHandler()
OrmHandler


toString

public String toString()
Key name

Overrides:
toString in class SuperAbstractUjo

equals

public boolean equals(Object relation)
Two models are the same if its key names are the same for the same domain type.

Overrides:
equals in class SuperAbstractUjo

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright 2013, Pavel Ponec