de.deepamehta.core.impl
Class AttachedDeepaMehtaObject

Show UML class diagram
java.lang.Object
  extended by 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


Field Summary
private  AttachedChildTopics childTopics
           
protected  EmbeddedService dms
           
private  Logger logger
           
private  DeepaMehtaObjectModel model
           
 
Constructor Summary
AttachedDeepaMehtaObject(DeepaMehtaObjectModel model, EmbeddedService dms)
           
 
Method Summary
(package private) abstract  String className()
           
 void delete()
          Deletes 1) this DeepaMehta object's child topics (recursively) which have an underlying association definition of type "Composition Definition" and 2) 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()
           
 Object getProperty(String propUri)
          Returns this object's property value associated with the given property URI.
 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) abstract  Type getType()
           
 String getTypeUri()
           
(package private) abstract  Directive getUpdateDirective()
           
 String getUri()
           
 int hashCode()
           
 boolean hasProperty(String propUri)
          Checks whether for this object a property value is associated with a given property URI.
 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(RelatedTopicModel newChildTopic, AssociationDefinition assocDef)
           
(package private) abstract  void updateChildTopics(ChildTopicsModel childTopics)
           
 void updateChildTopics(List<RelatedTopicModel> newChildTopics, AssociationDefinition assocDef)
           
private  void updateSimpleValue(SimpleValue newValue)
           
private  void updateTypeUri(String newTypeUri)
           
private  void updateUri(String newUri)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.deepamehta.core.DeepaMehtaObject
getAssociation, getAssociations, getRelatedAssociation, getRelatedAssociations, getRelatedTopics, removeProperty, setProperty
 

Field Detail

model

private DeepaMehtaObjectModel model

childTopics

private AttachedChildTopics childTopics

dms

protected final EmbeddedService dms

logger

private Logger logger
Constructor Detail

AttachedDeepaMehtaObject

AttachedDeepaMehtaObject(DeepaMehtaObjectModel model,
                         EmbeddedService dms)
Method Detail

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(RelatedTopicModel newChildTopic,
                             AssociationDefinition assocDef)
Specified by:
updateChildTopic in interface DeepaMehtaObject

updateChildTopics

public void updateChildTopics(List<RelatedTopicModel> newChildTopics,
                              AssociationDefinition assocDef)
Specified by:
updateChildTopics in interface DeepaMehtaObject

delete

public void delete()
Deletes 1) this DeepaMehta object's child topics (recursively) which have an underlying association definition of type "Composition Definition" and 2) 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 null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersTopicTypeUri - 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 null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersTopicTypeUri - may be null
maxResultSize - Result size limit. Pass 0 for no limit.

getProperty

public Object getProperty(String propUri)
Description copied from interface: DeepaMehtaObject
Returns this object's property value associated with the given property URI. If there's no property value associated with the property URI an exception is thrown.

Specified by:
getProperty in interface DeepaMehtaObject

hasProperty

public boolean hasProperty(String propUri)
Description copied from interface: DeepaMehtaObject
Checks whether for this object a property value is associated with a given property URI.

Specified by:
hasProperty in interface DeepaMehtaObject

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()

updateChildTopics

abstract void updateChildTopics(ChildTopicsModel childTopics)

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

abstract Type getType()

updateUri

private void updateUri(String newUri)

updateTypeUri

private void updateTypeUri(String newTypeUri)

updateSimpleValue

private void updateSimpleValue(SimpleValue newValue)


Copyright © 2015. All Rights Reserved.