|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jgoodies.binding.beans.Model de.schwarzrot.data.support.AbstractEntity de.schwarzrot.data.meta.support.AbstractMetaEntity<String> de.schwarzrot.data.meta.DatabaseModel
public class DatabaseModel
Field Summary |
---|
Fields inherited from class de.schwarzrot.data.meta.support.AbstractMetaEntity |
---|
MODEL_SCHEMA |
Constructor Summary | |
---|---|
DatabaseModel()
|
Method Summary | |
---|---|
AttributeDomain |
findAttributeDomain(ColumnType ct,
int size)
|
AttributeDomain |
findAttributeDomain(ColumnType ct,
int size,
int decimals,
boolean autoIncrement)
|
AttributeDomain |
findAttributeDomain(String name)
|
void |
fixImported(Converter cnv)
|
List<AttributeDomain> |
getAttributeDomains()
|
String |
getDefaultPassword()
|
String |
getDefaultUser()
|
Map<ColumnType,Map<String,AttributeDomain>> |
getDomainAccess()
|
Map<String,String> |
getMappings()
returns a map with mappings of logical property names to physical property names (column names in database terms). |
String |
getPersistenceName()
returns the name of the entity for persistance. |
long |
getRevision()
|
Map<String,SchemaDefinition> |
getSchemata()
|
Map<String,Integer> |
getSkipList()
returns a map with property names, that EntityManager s should
ignore. |
List<String> |
getUniqColumnNames()
returns a list of property names, which serve to detect a uniq instance without the usage of the primary key. |
void |
initNew()
|
void |
putAttributeDomain(AttributeDomain ad)
|
void |
removeAttributeDomain(AttributeDomain ad)
|
void |
setAttributeDomains(List<AttributeDomain> attrDomains)
|
void |
setDefaultPassword(String defPw)
|
void |
setDefaultUser(String defUser)
|
void |
setRevision(long revision)
|
void |
setSchemata(Map<String,SchemaDefinition> schemata)
|
protected void |
setupDomainAccess(AttributeDomain ad)
|
void |
validate(boolean read)
will be called just before saving and after loading, so it is intended to give the opportunity to calculate virtual fields. |
Methods inherited from class de.schwarzrot.data.meta.support.AbstractMetaEntity |
---|
compareTo, getComment, getLogicalName, getName, getPhysID, getSchemaName, setComment, setName, setPhysID |
Methods inherited from class de.schwarzrot.data.support.AbstractEntity |
---|
adoptChildren, adoptChildren, adoptGroupedChildren, equals, getCModified, getCode, getDefaultOrder, getDtCreated, getDtModified, getId, getLogger, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, hashCode, isDirty, isUserType, isVirtual, setCModified, setDirty, setDtCreated, setDtModified, setId, setSchemaName, setUCreated, setUModified, toString |
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, getSystemClass, getUCreated, getUModified, getUserAttributes, getVariantColumnName, getVariantTypeMap, isDirty, isUserType, isVirtual, setCModified, setDirty, setDtCreated, setDtModified, setId, setUCreated, setUModified |
Methods inherited from interface com.jgoodies.binding.beans.Observable |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public DatabaseModel()
Method Detail |
---|
public AttributeDomain findAttributeDomain(ColumnType ct, int size)
public AttributeDomain findAttributeDomain(ColumnType ct, int size, int decimals, boolean autoIncrement)
public AttributeDomain findAttributeDomain(String name)
public void fixImported(Converter cnv)
public final List<AttributeDomain> getAttributeDomains()
public final String getDefaultPassword()
public final String getDefaultUser()
public final Map<ColumnType,Map<String,AttributeDomain>> getDomainAccess()
public Map<String,String> getMappings()
Entity
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:
List
, known (named) children are hold in a Map
.
The mapped value is used as classname to create child instances.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.
getMappings
in interface Entity
getMappings
in class AbstractMetaEntity<String>
Map
with property names as keys and column
names as values.public String getPersistenceName()
Entity
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.
getPersistenceName
in interface Entity
getPersistenceName
in class AbstractEntity
public final long getRevision()
public final Map<String,SchemaDefinition> getSchemata()
public Map<String,Integer> getSkipList()
Entity
EntityManager
s should
ignore. These properties may be virtual properties, that not should be
saved to persistence and/or methods that start with 'get' and that are
not getters.
Implemention uses HashMaps
for performance reasons, but the
values are never used. So the map consists of propertynames as keys and
an Integer as Value.
Every implementation should use the Map from parent class:
public Map<String, Integer> getSkipList() { Map<String, Integer> skipList = super.getSkipList(); skipList.put("a_virtual_field", 1); return skipList; }
getSkipList
in interface Entity
getSkipList
in class AbstractEntity
public final List<String> getUniqColumnNames()
Entity
getUniqColumnNames
in interface Entity
getUniqColumnNames
in class AbstractMetaEntity<String>
public void initNew()
public void putAttributeDomain(AttributeDomain ad)
public void removeAttributeDomain(AttributeDomain ad)
public final void setAttributeDomains(List<AttributeDomain> attrDomains)
public final void setDefaultPassword(String defPw)
public final void setDefaultUser(String defUser)
public final void setRevision(long revision)
public final void setSchemata(Map<String,SchemaDefinition> schemata)
public void validate(boolean read)
Entity
validate
in interface Entity
validate
in class AbstractEntity
read
- signals whether calculation should be done for reading or for
writingprotected void setupDomainAccess(AttributeDomain ad)
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |