SRJRCFrames
v0.1.296

de.schwarzrot.data.meta
Class IdxSegmentInfo

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by de.schwarzrot.data.support.AbstractEntity
          extended by de.schwarzrot.data.support.AbstractEntityReference<A,B>
              extended by de.schwarzrot.data.support.AbstractWeightedEntityReference<IndexDefinition,ColumnDefinition,Integer>
                  extended by de.schwarzrot.data.meta.IdxSegmentInfo
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, Entity, EntityReference<IndexDefinition,ColumnDefinition>, MetaEntity<String>, NamedEntity<String>, WeightedEntityReference<IndexDefinition,ColumnDefinition,Integer>, Serializable, Comparable<Entity>

public class IdxSegmentInfo
extends AbstractWeightedEntityReference<IndexDefinition,ColumnDefinition,Integer>
implements MetaEntity<String>

See Also:
Serialized Form

Constructor Summary
IdxSegmentInfo()
           
IdxSegmentInfo(IndexDefinition refA, ColumnDefinition refB)
           
IdxSegmentInfo(IndexDefinition refA, ColumnDefinition refB, Integer weight)
           
IdxSegmentInfo(IndexDefinition refA, ColumnDefinition refB, Integer weight, boolean ascending)
           
 
Method Summary
 Class<IndexDefinition> getAType()
           
 Class<ColumnDefinition> getBType()
           
 String getComment()
          getter of the MetaEntitys comment
 String getLogicalName()
           
 Map<String,String> getMappings()
          returns a map with mappings of logical property names to physical property names (column names in database terms).
 String getName()
           
 String getPersistenceName()
          returns the name of the entity for persistance.
 String getSchemaName()
          returns the schema for this entity.
 int getSize()
           
 List<String> getUniqColumnNames()
          returns a list of property names, which serve to detect a uniq instance without the usage of the primary key.
 Class<Integer> getWeightType()
           
 boolean isAscending()
           
 boolean needsUpdate(IdxSegmentInfo other)
           
 void setAscending(boolean ascending)
           
 void setComment(String comment)
          setter of the MetaEntitys comment
 void setName(String notUsed)
           
 void setSize(int size)
           
 
Methods inherited from class de.schwarzrot.data.support.AbstractWeightedEntityReference
getDefaultOrder, getWeight, setWeight
 
Methods inherited from class de.schwarzrot.data.support.AbstractEntityReference
getReferenceA, getReferenceB, setReferenceA, setReferenceB
 
Methods inherited from class de.schwarzrot.data.support.AbstractEntity
adoptChildren, adoptChildren, adoptGroupedChildren, compareTo, equals, getCModified, getCode, getDtCreated, getDtModified, getId, getLogger, getSkipList, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, hashCode, isDirty, isUserType, isVirtual, setCModified, setDirty, setDtCreated, setDtModified, setId, setSchemaName, setUCreated, setUModified, toString, 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, 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
 
Methods inherited from interface de.schwarzrot.data.EntityReference
getReferenceA, getReferenceB, setReferenceA, setReferenceB
 

Constructor Detail

IdxSegmentInfo

public IdxSegmentInfo()

IdxSegmentInfo

public IdxSegmentInfo(IndexDefinition refA,
                      ColumnDefinition refB)

IdxSegmentInfo

public IdxSegmentInfo(IndexDefinition refA,
                      ColumnDefinition refB,
                      Integer weight)

IdxSegmentInfo

public IdxSegmentInfo(IndexDefinition refA,
                      ColumnDefinition refB,
                      Integer weight,
                      boolean ascending)
Method Detail

getAType

public Class<IndexDefinition> getAType()
Specified by:
getAType in interface EntityReference<IndexDefinition,ColumnDefinition>

getBType

public Class<ColumnDefinition> getBType()
Specified by:
getBType in interface EntityReference<IndexDefinition,ColumnDefinition>

getComment

public final String getComment()
Description copied from interface: MetaEntity
getter of the MetaEntitys comment

Specified by:
getComment in interface MetaEntity<String>
Returns:
the comment or null

getLogicalName

public String getLogicalName()
Specified by:
getLogicalName in interface MetaEntity<String>

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 String getName()
Specified by:
getName in interface NamedEntity<String>

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

getSchemaName

public String getSchemaName()
Description copied from interface: Entity
returns the schema for this entity. Not all storage types support schemata, so on systems, where the schema is not supported, it will be a prefix to the persistent name.

Specified by:
getSchemaName in interface Entity
Overrides:
getSchemaName in class AbstractEntity
Returns:
a schema name

getSize

public final int getSize()

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 AbstractEntityReference<IndexDefinition,ColumnDefinition>
Returns:
a list of property names

getWeightType

public Class<Integer> getWeightType()
Specified by:
getWeightType in interface WeightedEntityReference<IndexDefinition,ColumnDefinition,Integer>

isAscending

public final boolean isAscending()

needsUpdate

public boolean needsUpdate(IdxSegmentInfo other)

setAscending

public final void setAscending(boolean ascending)

setComment

public final void setComment(String comment)
Description copied from interface: MetaEntity
setter of the MetaEntitys comment

Specified by:
setComment in interface MetaEntity<String>
Parameters:
comment - the comment to set

setName

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

setSize

public final void setSize(int size)

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.