org.ujorm.orm.metaModel
Class MetaPKey

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.MetaPKey
All Implemented Interfaces:
Serializable, UjoCloneable, UjoLockable, UjoTextable, Ujo

public final class MetaPKey
extends AbstractMetaModel

The table primary key.

See Also:
Serialized Form

Field Summary
static ListKey<MetaPKey,MetaColumn> COLUMNS
          DB columns
static Key<MetaPKey,MetaTable> TABLE
          DB table
 
Constructor Summary
MetaPKey(MetaTable table)
           
 
Method Summary
 boolean assignPrimaryKey(OrmUjo bo, Session session)
          Assign a PK from framework in case the PK generator is type of MEMO_SEQUENCE.
 MetaColumn getColumn(int i)
          Returns column on the selected position.
 int getCount()
          Returns a count of the Primary Keys
 MetaColumn getFirstColumn()
          Returns the first column.
protected  long nextValue(Session session)
          Generate a next value
 String toString()
           
 
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

TABLE

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


COLUMNS

public static final ListKey<MetaPKey,MetaColumn> COLUMNS
DB columns

Constructor Detail

MetaPKey

public MetaPKey(MetaTable table)
Method Detail

toString

public String toString()
Overrides:
toString in class SuperAbstractUjo

assignPrimaryKey

public boolean assignPrimaryKey(OrmUjo bo,
                                Session session)
                         throws IllegalArgumentException
Assign a PK from framework in case the PK generator is type of MEMO_SEQUENCE.

Returns:
Value 'true' means, that primary key was assigned successfully and 'false' means that a primary key was defined earlier.
Throws:
IllegalArgumentException - The PK can't be assigned.

nextValue

protected final long nextValue(Session session)
Generate a next value


getFirstColumn

public MetaColumn getFirstColumn()
Returns the first column.


getColumn

public MetaColumn getColumn(int i)
Returns column on the selected position.


getCount

public int getCount()
Returns a count of the Primary Keys



Copyright 2013, Pavel Ponec