de.deepamehta.core.impl
Class AttachedDeepaMehtaObject
java.lang.Object
de.deepamehta.core.impl.AttachedDeepaMehtaObject
- All Implemented Interfaces:
- DeepaMehtaObject, Identifiable, JSONEnabled
- Direct Known Subclasses:
- AttachedAssociation, AttachedTopic
abstract class AttachedDeepaMehtaObject
- extends Object
- implements DeepaMehtaObject
A DeepaMehta object model that is attached to the DB.
Method name conventions and semantics:
- getXX() Reads from memory (model).
- setXX(arg) Writes to memory (model) and DB. Elementary operation.
- updateXX(arg) Compares arg with current value (model) and calls setXX() method(s) if required.
Can be called with arg=null which indicates no update is requested.
Typically returns nothing.
- fetchXX() Fetches value from DB. ### FIXDOC
- storeXX() Stores current value (model) to DB. ### FIXDOC
Method Summary |
(package private) abstract String |
className()
|
void |
delete()
Deletes all sub-topics of this DeepaMehta object (associated via "dm4.core.composition", recursively) and
deletes all the remaining direct associations of this DeepaMehta object. |
boolean |
equals(Object o)
|
(package private) abstract RelatedTopicModel |
fetchRelatedTopic(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
|
(package private) abstract ResultList<RelatedTopicModel> |
fetchRelatedTopics(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize)
|
AttachedChildTopics |
getChildTopics()
|
Object |
getDatabaseVendorObject()
|
long |
getId()
|
DeepaMehtaObjectModel |
getModel()
|
RelatedTopic |
getRelatedTopic(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
Fetches and returns a related topic or null if no such topic extists. |
ResultList<RelatedTopic> |
getRelatedTopics(String assocTypeUri,
int maxResultSize)
|
ResultList<RelatedTopic> |
getRelatedTopics(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize)
|
SimpleValue |
getSimpleValue()
|
(package private) Type |
getType()
|
String |
getTypeUri()
|
(package private) abstract Directive |
getUpdateDirective()
|
String |
getUri()
|
int |
hashCode()
|
DeepaMehtaObject |
loadChildTopics()
|
DeepaMehtaObject |
loadChildTopics(String childTypeUri)
|
void |
setChildTopics(ChildTopicsModel childTopics)
|
void |
setSimpleValue(boolean value)
|
void |
setSimpleValue(int value)
|
void |
setSimpleValue(long value)
|
void |
setSimpleValue(SimpleValue value)
|
void |
setSimpleValue(String value)
|
void |
setTypeUri(String typeUri)
|
void |
setUri(String uri)
|
(package private) abstract void |
storeTypeUri()
|
(package private) abstract void |
storeUri()
|
JSONObject |
toJSON()
|
String |
toString()
|
void |
update(DeepaMehtaObjectModel newModel)
|
void |
updateChildTopic(TopicModel newChildTopic,
AssociationDefinition assocDef)
|
void |
updateChildTopics(List<TopicModel> newChildTopics,
AssociationDefinition assocDef)
|
private void |
updateSimpleValue(SimpleValue newValue)
|
private void |
updateTypeUri(String newTypeUri)
|
private void |
updateUri(String newUri)
|
private void |
updateValue(DeepaMehtaObjectModel newModel)
|
model
private DeepaMehtaObjectModel model
childTopics
private AttachedChildTopics childTopics
dms
protected final EmbeddedService dms
logger
private Logger logger
AttachedDeepaMehtaObject
AttachedDeepaMehtaObject(DeepaMehtaObjectModel model,
EmbeddedService dms)
getId
public long getId()
- Specified by:
getId
in interface DeepaMehtaObject
- Specified by:
getId
in interface Identifiable
getUri
public String getUri()
- Specified by:
getUri
in interface DeepaMehtaObject
setUri
public void setUri(String uri)
- Specified by:
setUri
in interface DeepaMehtaObject
getTypeUri
public String getTypeUri()
- Specified by:
getTypeUri
in interface DeepaMehtaObject
setTypeUri
public void setTypeUri(String typeUri)
- Specified by:
setTypeUri
in interface DeepaMehtaObject
getSimpleValue
public SimpleValue getSimpleValue()
- Specified by:
getSimpleValue
in interface DeepaMehtaObject
setSimpleValue
public void setSimpleValue(String value)
- Specified by:
setSimpleValue
in interface DeepaMehtaObject
setSimpleValue
public void setSimpleValue(int value)
- Specified by:
setSimpleValue
in interface DeepaMehtaObject
setSimpleValue
public void setSimpleValue(long value)
- Specified by:
setSimpleValue
in interface DeepaMehtaObject
setSimpleValue
public void setSimpleValue(boolean value)
- Specified by:
setSimpleValue
in interface DeepaMehtaObject
setSimpleValue
public void setSimpleValue(SimpleValue value)
- Specified by:
setSimpleValue
in interface DeepaMehtaObject
getChildTopics
public AttachedChildTopics getChildTopics()
- Specified by:
getChildTopics
in interface DeepaMehtaObject
setChildTopics
public void setChildTopics(ChildTopicsModel childTopics)
- Specified by:
setChildTopics
in interface DeepaMehtaObject
loadChildTopics
public DeepaMehtaObject loadChildTopics()
- Specified by:
loadChildTopics
in interface DeepaMehtaObject
loadChildTopics
public DeepaMehtaObject loadChildTopics(String childTypeUri)
- Specified by:
loadChildTopics
in interface DeepaMehtaObject
getModel
public DeepaMehtaObjectModel getModel()
- Specified by:
getModel
in interface DeepaMehtaObject
update
public void update(DeepaMehtaObjectModel newModel)
- Specified by:
update
in interface DeepaMehtaObject
updateChildTopic
public void updateChildTopic(TopicModel newChildTopic,
AssociationDefinition assocDef)
- Specified by:
updateChildTopic
in interface DeepaMehtaObject
updateChildTopics
public void updateChildTopics(List<TopicModel> newChildTopics,
AssociationDefinition assocDef)
- Specified by:
updateChildTopics
in interface DeepaMehtaObject
delete
public void delete()
- Deletes all sub-topics of this DeepaMehta object (associated via "dm4.core.composition", recursively) and
deletes all the remaining direct associations of this DeepaMehta object.
Note: deletion of the object itself is up to the subclasses.
- Specified by:
delete
in interface DeepaMehtaObject
getRelatedTopic
public RelatedTopic getRelatedTopic(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
- Description copied from interface:
DeepaMehtaObject
- Fetches and returns a related topic or
null
if no such topic extists.
- Specified by:
getRelatedTopic
in interface DeepaMehtaObject
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be null
getRelatedTopics
public ResultList<RelatedTopic> getRelatedTopics(String assocTypeUri,
int maxResultSize)
- Specified by:
getRelatedTopics
in interface DeepaMehtaObject
getRelatedTopics
public ResultList<RelatedTopic> getRelatedTopics(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize)
- Specified by:
getRelatedTopics
in interface DeepaMehtaObject
- Parameters:
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullmaxResultSize
- Result size limit. Pass 0 for no limit.
getDatabaseVendorObject
public Object getDatabaseVendorObject()
- Specified by:
getDatabaseVendorObject
in interface DeepaMehtaObject
toJSON
public JSONObject toJSON()
- Specified by:
toJSON
in interface JSONEnabled
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
className
abstract String className()
getUpdateDirective
abstract Directive getUpdateDirective()
storeUri
abstract void storeUri()
storeTypeUri
abstract void storeTypeUri()
fetchRelatedTopic
abstract RelatedTopicModel fetchRelatedTopic(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri)
fetchRelatedTopics
abstract ResultList<RelatedTopicModel> fetchRelatedTopics(String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri,
int maxResultSize)
getType
Type getType()
updateUri
private void updateUri(String newUri)
updateTypeUri
private void updateTypeUri(String newTypeUri)
updateValue
private void updateValue(DeepaMehtaObjectModel newModel)
updateSimpleValue
private void updateSimpleValue(SimpleValue newValue)
Copyright © 2014. All Rights Reserved.