|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.AbstractDBEntry
com.antelmann.db.DefaultEntryRelationship
public class DefaultEntryRelationship
a default implementation for an EntryRelationship
| Field Summary |
|---|
| Fields inherited from interface com.antelmann.db.DBEntry |
|---|
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR |
| Constructor Summary | |
|---|---|
DefaultEntryRelationship(Object id,
DBReference fromReference,
DBReference toReference,
Object type)
|
|
DefaultEntryRelationship(Object id,
DBReference fromReference,
DBReference toReference,
Object type,
boolean bidirectional)
|
|
DefaultEntryRelationship(Object id,
EntryRelationship er)
subclasses are strongly encouraged to provide a constructor with this same signature |
|
| Method Summary | |
|---|---|
Date |
getBeginTime()
|
String |
getComment()
specifies a comment for this relationship |
Date |
getEndTime()
|
DBReference |
getFromReference()
represents the first entry of this relationship |
String |
getFromReferenceString()
|
Object |
getRelationOption()
optionally allows to specify an option along with this relationship |
Object |
getRelationType()
defines the kind of relationship |
EntryRelationship |
getReverseRelationship()
if this relationship is bidirectional, the reversed relationship (swapped to-/from references) is returned with the same ID as this one; otherwise null is returned. |
DBReference |
getToReference()
represents the second entry of this relationship |
String |
getToReferenceString()
|
boolean |
isBidirectional()
determines whether this relationship also applies when swapping to- and fromReference |
boolean |
isBroken(Database<?> db)
a relationship is NOT broken only if the following applies for both, the from-reference and the to-reference: there is a store in the database for the specified type there exists an entry with the id of the reference in the store |
boolean |
sameAs(EntryRelationship rel,
boolean allFields)
if allFields is false, only the references and the type are checked |
void |
setBeginTime(Date beginTime)
|
void |
setComment(String comment)
|
void |
setEndTime(Date endTime)
|
void |
setRelationOption(Object option)
|
String |
toString()
|
| Methods inherited from class com.antelmann.db.AbstractDBEntry |
|---|
equals, getID, hashCode, hashEntry, sameEntry |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.antelmann.db.DBEntry |
|---|
getID |
| Constructor Detail |
|---|
public DefaultEntryRelationship(Object id,
EntryRelationship er)
throws IllegalArgumentException
IllegalArgumentException
public DefaultEntryRelationship(Object id,
DBReference fromReference,
DBReference toReference,
Object type)
public DefaultEntryRelationship(Object id,
DBReference fromReference,
DBReference toReference,
Object type,
boolean bidirectional)
| Method Detail |
|---|
public boolean isBroken(Database<?> db)
throws DatabaseException
db - the database where the references need to be resolved
DatabaseException - if
public boolean sameAs(EntryRelationship rel,
boolean allFields)
public EntryRelationship getReverseRelationship()
public String toString()
toString in class AbstractDBEntrypublic boolean isBidirectional()
EntryRelationship
isBidirectional in interface EntryRelationshippublic void setComment(String comment)
public String getComment()
EntryRelationship
getComment in interface EntryRelationshippublic DBReference getFromReference()
EntryRelationship
getFromReference in interface EntryRelationshippublic String getFromReferenceString()
public Object getRelationType()
EntryRelationship
getRelationType in interface EntryRelationshippublic DBReference getToReference()
EntryRelationship
getToReference in interface EntryRelationshippublic String getToReferenceString()
public Object getRelationOption()
EntryRelationship
getRelationOption in interface EntryRelationship
public void setRelationOption(Object option)
throws IllegalArgumentException,
UnsupportedOperationException
IllegalArgumentException
UnsupportedOperationExceptionpublic Date getBeginTime()
getBeginTime in interface LifeCycleObjectpublic void setBeginTime(Date beginTime)
public Date getEndTime()
getEndTime in interface LifeCycleObjectpublic void setEndTime(Date endTime)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||