SRJRCFrames
v0.1.296

de.schwarzrot.data.meta
Class ColumnDefinition

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by de.schwarzrot.data.support.AbstractEntity
          extended by de.schwarzrot.data.meta.support.AbstractMetaEntity<N>
              extended by de.schwarzrot.data.meta.support.AbstractMetaChildEntity<String,TableDefinition>
                  extended by de.schwarzrot.data.meta.ColumnDefinition
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, ChildEntity<TableDefinition>, Entity, MetaEntity<String>, NamedChildEntity<String,TableDefinition>, NamedEntity<String>, Serializable, Comparable<Entity>

public class ColumnDefinition
extends AbstractMetaChildEntity<String,TableDefinition>

See Also:
Serialized Form

Field Summary
 
Fields inherited from class de.schwarzrot.data.meta.support.AbstractMetaEntity
MODEL_SCHEMA
 
Fields inherited from interface de.schwarzrot.data.ChildEntity
PARENT_ATTR_NAME
 
Constructor Summary
ColumnDefinition()
           
ColumnDefinition(ColumnDefinition other)
           
 
Method Summary
 void cloneFrom(ColumnDefinition other)
           
 int compareTo(Entity other)
           
 int getDecimals()
           
 List<SortInfo> getDefaultOrder()
          returns a list of SortInfo, that build the order for default list-queries.
 String getDefaultValue()
           
 AttributeDomain getDomain()
           
 String getLogicalName()
           
 Map<String,String> getMappings()
          returns a map with mappings of logical property names to physical property names (column names in database terms).
 Class<TableDefinition> getParentType()
          returns the type of the parent entity
 String getPersistenceName()
          returns the name of the entity for persistance.
 int getSize()
           
 ColumnType getType()
           
 List<String> getUniqColumnNames()
          returns a list of property names, which serve to detect a uniq instance without the usage of the primary key.
 int getWeight()
           
 boolean isAutoincrement()
           
 boolean isInternal()
           
 boolean isNullable()
           
 boolean isVirtualAttribute()
           
 void setDefaultValue(String defaultValue)
           
 void setDomain(AttributeDomain domain)
           
 void setLogicalName(String logicalName)
           
 void setName(String name)
           
 void setNullable(boolean nullable)
           
 void setVirtualAttribute(boolean virtual)
           
 void setWeight(int weight)
           
 String toString()
           
 
Methods inherited from class de.schwarzrot.data.meta.support.AbstractMetaChildEntity
getParent, setDirty, setParent
 
Methods inherited from class de.schwarzrot.data.meta.support.AbstractMetaEntity
getComment, getName, getPhysID, getSchemaName, setComment, setPhysID
 
Methods inherited from class de.schwarzrot.data.support.AbstractEntity
adoptChildren, adoptChildren, adoptGroupedChildren, equals, getCModified, getCode, getDtCreated, getDtModified, getId, getLogger, getSkipList, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, hashCode, isDirty, isUserType, isVirtual, setCModified, setDtCreated, setDtModified, setId, setSchemaName, setUCreated, setUModified, validate
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.schwarzrot.data.NamedEntity
getName
 
Methods inherited from interface de.schwarzrot.data.Entity
getCModified, getDtCreated, getDtModified, getId, getSchemaName, getSkipList, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, isDirty, isUserType, isVirtual, setCModified, setDtCreated, setDtModified, setId, setUCreated, setUModified, validate
 
Methods inherited from interface com.jgoodies.binding.beans.Observable
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

ColumnDefinition

public ColumnDefinition()

ColumnDefinition

public ColumnDefinition(ColumnDefinition other)
Method Detail

cloneFrom

public void cloneFrom(ColumnDefinition other)

compareTo

public int compareTo(Entity other)
Specified by:
compareTo in interface Comparable<Entity>
Overrides:
compareTo in class AbstractMetaChildEntity<String,TableDefinition>

getDecimals

public final int getDecimals()

getDefaultOrder

public List<SortInfo> getDefaultOrder()
Description copied from interface: Entity
returns a list of SortInfo, that build the order for default list-queries.

Specified by:
getDefaultOrder in interface Entity
Overrides:
getDefaultOrder in class AbstractEntity
Returns:
a list of property names

getDefaultValue

public final String getDefaultValue()

getDomain

public final AttributeDomain getDomain()
Returns:
the domain

getLogicalName

public final String getLogicalName()
Specified by:
getLogicalName in interface MetaEntity<String>
Overrides:
getLogicalName in class AbstractMetaEntity<String>
Returns:
the logicalName

getMappings

public Map<String,String> getMappings()
Description copied from interface: Entity
returns a map with mappings of logical property names to physical property names (column names in database terms).

Every implementation should respect the parents mappings. The following sample shows different mapping types:

 public Map<String, String> getMappings() {
     Map<String, String> mappings = super.getMappings();
     mappings.put("title", "name");
     mappings.put("streams", Stream.class.getName());
     mappings.put("pageDefinitions", "pageType|" + ThemeElement.class.getName());
     return mappings;
 }
 
The mappings explained:
"title" -> "name"
the logical "title"-attribute is stored to persistence with a physical name "name"
"streams" -> Stream.class.getName()
the "streams" property holds related children. Unknown children are hold in a List, known (named) children are hold in a Map. The mapped value is used as classname to create child instances.
"pageDefinitions" -> "pageType|" + ThemeElement.class.getName()
pageDefinitions is a property of type Map, that holds grouped children. Known children are hold by a Map, unknown children by a List, so "pageDefinitions" may contain elements of type Map, or List. pageType, a property of ThemeElement, is used to group the children. The word before the '|' is the property name used as key value for grouping and the type after '|' is used to create instances.

Specified by:
getMappings in interface Entity
Overrides:
getMappings in class AbstractMetaEntity<String>
Returns:
a Map with property names as keys and column names as values.

getParentType

public Class<TableDefinition> getParentType()
Description copied from interface: ChildEntity
returns the type of the parent entity

Returns:
the parent entity

getPersistenceName

public String getPersistenceName()
Description copied from interface: Entity
returns the name of the entity for persistance. Normally it would be the same result as getClass().getSimpleName(), but some storage may have size limitations, or don't support case sensitive names, so this call is to deal with that kind of limitations.

Specified by:
getPersistenceName in interface Entity
Overrides:
getPersistenceName in class AbstractEntity
Returns:
the entity-name used for persistence

getSize

public final int getSize()

getType

public final ColumnType getType()

getUniqColumnNames

public List<String> getUniqColumnNames()
Description copied from interface: Entity
returns a list of property names, which serve to detect a uniq instance without the usage of the primary key. In database context this list is used to decide, whether a save operation needs an update or an insert.

Specified by:
getUniqColumnNames in interface Entity
Overrides:
getUniqColumnNames in class AbstractMetaEntity<String>
Returns:
a list of property names

getWeight

public final int getWeight()
Returns:
the weight

isAutoincrement

public final boolean isAutoincrement()

isInternal

public boolean isInternal()

isNullable

public final boolean isNullable()

isVirtualAttribute

public final boolean isVirtualAttribute()
Returns:
the virtual

setDefaultValue

public final void setDefaultValue(String defaultValue)

setDomain

public final void setDomain(AttributeDomain domain)
Parameters:
domain - the domain to set

setLogicalName

public final void setLogicalName(String logicalName)
Parameters:
logicalName - the logicalName to set

setName

public final void setName(String name)
Specified by:
setName in interface NamedEntity<String>
Overrides:
setName in class AbstractMetaEntity<String>

setNullable

public final void setNullable(boolean nullable)

setVirtualAttribute

public final void setVirtualAttribute(boolean virtual)
Parameters:
virtual - the virtual to set

setWeight

public final void setWeight(int weight)
Parameters:
weight - the weight to set

toString

public String toString()
Overrides:
toString in class AbstractEntity

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.