de.deepamehta.core.impl
Class AttachedAssociation

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.impl.AttachedDeepaMehtaObject
      extended by de.deepamehta.core.impl.AttachedAssociation
All Implemented Interfaces:
Association, DeepaMehtaObject, Identifiable, JSONEnabled
Direct Known Subclasses:
AttachedAssociationDefinition, AttachedRelatedAssociation

 class AttachedAssociation
extends AttachedDeepaMehtaObject
implements Association

An association model that is attached to the DB.


Field Summary
private  Logger logger
           
private  Role role1
           
private  Role role2
           
 
Fields inherited from class de.deepamehta.core.impl.AttachedDeepaMehtaObject
dms
 
Constructor Summary
AttachedAssociation(AssociationModel model, EmbeddedService dms)
           
 
Method Summary
(package private)  void addUpdateDirective()
           
(package private)  String className()
           
private  Role createAttachedRole(RoleModel model)
           
 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.
private  Association fetchInstantiation()
           
(package private)  RelatedTopicModel fetchRelatedTopic(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
           
(package private)  ResultList<RelatedTopicModel> fetchRelatedTopics(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
           
private  void filterTopic(Role role, String roleTypeUri, List<Topic> topics)
           
 Association getAssociation(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, long othersTopicId)
           
 List<Association> getAssociations()
           
(package private)  AssociationType getAssociationType()
          Convenience method.
 AssociationModel getModel()
           
 DeepaMehtaObject getPlayer1()
           
 DeepaMehtaObject getPlayer2()
           
 Object getProperty(String propUri)
           
 RelatedAssociation getRelatedAssociation(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
           
 ResultList<RelatedAssociation> getRelatedAssociations(String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
           
 ResultList<RelatedTopic> getRelatedTopics(List assocTypeUris, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri, int maxResultSize)
           
 Role getRole(RoleModel roleModel)
          Returns this association's role which refers to the same object as the given role model.
 Role getRole1()
           
 Role getRole2()
           
 Topic getTopic(String roleTypeUri)
           
 List<Topic> getTopics(String roleTypeUri)
           
 boolean hasProperty(String propUri)
           
 boolean isPlayer(TopicRoleModel roleModel)
           
 Association loadChildTopics()
           
 Association loadChildTopics(String childTypeUri)
           
private  void reassignInstantiation()
           
 void removeProperty(String propUri)
           
 void setProperty(String propUri, Object propValue, boolean addToIndex)
           
(package private)  void storeTypeUri()
           
(package private)  void storeUri()
           
 void update(AssociationModel model)
           
private  void updateRole(RoleModel newModel, int nr)
           
 
Methods inherited from class de.deepamehta.core.impl.AttachedDeepaMehtaObject
equals, getChildTopics, getDatabaseVendorObject, getId, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getType, getTypeUri, getUri, hashCode, setChildTopics, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, toJSON, toString, update, updateChildTopic, updateChildTopics
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.deepamehta.core.DeepaMehtaObject
getChildTopics, getDatabaseVendorObject, getId, getRelatedTopic, getRelatedTopics, getRelatedTopics, getSimpleValue, getTypeUri, getUri, setChildTopics, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, update, updateChildTopic, updateChildTopics
 
Methods inherited from interface de.deepamehta.core.JSONEnabled
toJSON
 

Field Detail

role1

private Role role1

role2

private Role role2

logger

private Logger logger
Constructor Detail

AttachedAssociation

AttachedAssociation(AssociationModel model,
                    EmbeddedService dms)
Method Detail

update

public void update(AssociationModel model)
Specified by:
update in interface Association
Parameters:
model - The data to update. If the type URI is null it is not updated. If role 1 is null it is not updated. If role 2 is null it is not updated.

delete

public void delete()
Description copied from class: AttachedDeepaMehtaObject
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
Overrides:
delete in class AttachedDeepaMehtaObject

getRole1

public Role getRole1()
Specified by:
getRole1 in interface Association

getRole2

public Role getRole2()
Specified by:
getRole2 in interface Association

getPlayer1

public DeepaMehtaObject getPlayer1()
Specified by:
getPlayer1 in interface Association

getPlayer2

public DeepaMehtaObject getPlayer2()
Specified by:
getPlayer2 in interface Association

getTopic

public Topic getTopic(String roleTypeUri)
Specified by:
getTopic in interface Association

getTopics

public List<Topic> getTopics(String roleTypeUri)
Specified by:
getTopics in interface Association

getRole

public Role getRole(RoleModel roleModel)
Description copied from interface: Association
Returns this association's role which refers to the same object as the given role model. The role returned is found by comparing topic IDs, topic URIs, or association IDs. The role types are not compared.

If the object refered by the given role model is not a player in this association an exception is thrown.

Specified by:
getRole in interface Association

isPlayer

public boolean isPlayer(TopicRoleModel roleModel)
Specified by:
isPlayer in interface Association

loadChildTopics

public Association loadChildTopics()
Specified by:
loadChildTopics in interface Association
Specified by:
loadChildTopics in interface DeepaMehtaObject
Overrides:
loadChildTopics in class AttachedDeepaMehtaObject

loadChildTopics

public Association loadChildTopics(String childTypeUri)
Specified by:
loadChildTopics in interface Association
Specified by:
loadChildTopics in interface DeepaMehtaObject
Overrides:
loadChildTopics in class AttachedDeepaMehtaObject

getModel

public AssociationModel getModel()
Specified by:
getModel in interface Association
Specified by:
getModel in interface DeepaMehtaObject
Overrides:
getModel in class AttachedDeepaMehtaObject

getRelatedTopics

public ResultList<RelatedTopic> getRelatedTopics(List assocTypeUris,
                                                 String myRoleTypeUri,
                                                 String othersRoleTypeUri,
                                                 String othersTopicTypeUri,
                                                 int maxResultSize)
Specified by:
getRelatedTopics in interface DeepaMehtaObject
Parameters:
assocTypeUris - may *not* be null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersTopicTypeUri - may be null

getRelatedAssociation

public RelatedAssociation getRelatedAssociation(String assocTypeUri,
                                                String myRoleTypeUri,
                                                String othersRoleTypeUri,
                                                String othersAssocTypeUri)
Specified by:
getRelatedAssociation in interface DeepaMehtaObject
Parameters:
assocTypeUri - may be null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersAssocTypeUri - may be null

getRelatedAssociations

public ResultList<RelatedAssociation> getRelatedAssociations(String assocTypeUri,
                                                             String myRoleTypeUri,
                                                             String othersRoleTypeUri,
                                                             String othersAssocTypeUri)
Specified by:
getRelatedAssociations in interface DeepaMehtaObject
Parameters:
assocTypeUri - may be null
myRoleTypeUri - may be null
othersRoleTypeUri - may be null
othersAssocTypeUri - may be null

getAssociation

public Association getAssociation(String assocTypeUri,
                                  String myRoleTypeUri,
                                  String othersRoleTypeUri,
                                  long othersTopicId)
Specified by:
getAssociation in interface DeepaMehtaObject

getAssociations

public List<Association> getAssociations()
Specified by:
getAssociations in interface DeepaMehtaObject

getProperty

public Object getProperty(String propUri)
Specified by:
getProperty in interface DeepaMehtaObject

setProperty

public void setProperty(String propUri,
                        Object propValue,
                        boolean addToIndex)
Specified by:
setProperty in interface DeepaMehtaObject

hasProperty

public boolean hasProperty(String propUri)
Specified by:
hasProperty in interface DeepaMehtaObject

removeProperty

public void removeProperty(String propUri)
Specified by:
removeProperty in interface DeepaMehtaObject

getAssociationType

AssociationType getAssociationType()
Convenience method.


className

final String className()
Specified by:
className in class AttachedDeepaMehtaObject

addUpdateDirective

void addUpdateDirective()
Specified by:
addUpdateDirective in class AttachedDeepaMehtaObject

storeUri

final void storeUri()
Specified by:
storeUri in class AttachedDeepaMehtaObject

storeTypeUri

final void storeTypeUri()
Specified by:
storeTypeUri in class AttachedDeepaMehtaObject

fetchRelatedTopic

final RelatedTopicModel fetchRelatedTopic(String assocTypeUri,
                                          String myRoleTypeUri,
                                          String othersRoleTypeUri,
                                          String othersTopicTypeUri)
Specified by:
fetchRelatedTopic in class AttachedDeepaMehtaObject

fetchRelatedTopics

final ResultList<RelatedTopicModel> fetchRelatedTopics(String assocTypeUri,
                                                       String myRoleTypeUri,
                                                       String othersRoleTypeUri,
                                                       String othersTopicTypeUri,
                                                       int maxResultSize)
Specified by:
fetchRelatedTopics in class AttachedDeepaMehtaObject

updateRole

private void updateRole(RoleModel newModel,
                        int nr)
Parameters:
nr - used only for logging

createAttachedRole

private Role createAttachedRole(RoleModel model)

filterTopic

private void filterTopic(Role role,
                         String roleTypeUri,
                         List<Topic> topics)

reassignInstantiation

private void reassignInstantiation()

fetchInstantiation

private Association fetchInstantiation()


Copyright © 2014. All Rights Reserved.