SRJRCFrames
v0.1.296

de.schwarzrot.app.domain
Class Option

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by de.schwarzrot.data.support.AbstractEntity
          extended by de.schwarzrot.app.domain.Option
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, ChildEntity<OptionBundle>, Entity, NamedChildEntity<String,OptionBundle>, NamedEntity<String>, Serializable, Comparable<Entity>

public class Option
extends AbstractEntity
implements NamedChildEntity<String,OptionBundle>

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface de.schwarzrot.data.ChildEntity
PARENT_ATTR_NAME
 
Constructor Summary
Option()
           
Option(String name)
           
Option(String name, String value)
           
 
Method Summary
 Map<String,String> getMappings()
          returns a map with mappings of logical property names to physical property names (column names in database terms).
 String getName()
           
 OptionBundle getParent()
          returns the parent entity instance of this entity instance
 Class<OptionBundle> getParentType()
          returns the type of the parent entity
 List<String> getUniqColumnNames()
          returns a list of property names, which serve to detect a uniq instance without the usage of the primary key.
 String getValue()
           
 void setName(String name)
           
 void setParent(OptionBundle parent)
          sets the parent entity instance to the given instance
 void setValue(String value)
           
 String toString()
           
 
Methods inherited from class de.schwarzrot.data.support.AbstractEntity
adoptChildren, adoptChildren, adoptGroupedChildren, compareTo, equals, getCModified, getCode, getDefaultOrder, getDtCreated, getDtModified, getId, getLogger, getPersistenceName, getSchemaName, getSkipList, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, hashCode, isDirty, isUserType, isVirtual, setCModified, setDirty, 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.Entity
getCModified, getDefaultOrder, getDtCreated, getDtModified, getId, getPersistenceName, getSchemaName, getSkipList, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, isDirty, isUserType, isVirtual, setCModified, setDirty, setDtCreated, setDtModified, setId, setUCreated, setUModified, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.jgoodies.binding.beans.Observable
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

Option

public Option()

Option

public Option(String name)

Option

public Option(String name,
              String value)
Method Detail

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 AbstractEntity
Returns:
a Map with property names as keys and column names as values.

getName

public final String getName()
Specified by:
getName in interface NamedEntity<String>

getParent

public final OptionBundle getParent()
Description copied from interface: ChildEntity
returns the parent entity instance of this entity instance

Specified by:
getParent in interface ChildEntity<OptionBundle>
Returns:
an entity

getParentType

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

Specified by:
getParentType in interface ChildEntity<OptionBundle>
Returns:
the parent entity

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 AbstractEntity
Returns:
a list of property names

getValue

public final String getValue()

setName

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

setParent

public final void setParent(OptionBundle parent)
Description copied from interface: ChildEntity
sets the parent entity instance to the given instance

Specified by:
setParent in interface ChildEntity<OptionBundle>
Parameters:
parent - the new parent entity instance

setValue

public final void setValue(String value)

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.