Package nl.vpro.domain.media
Class MemberRef
java.lang.Object
nl.vpro.domain.media.MemberRef
- All Implemented Interfaces:
Serializable
,Comparable<MemberRef>
,Identifiable<Long>
,ParentChildRelation
,RecursiveParentChildRelation
,nl.vpro.domain.media.support.MutableOwnable
,nl.vpro.domain.media.support.Ownable
@Entity
public class MemberRef
extends Object
implements Identifiable<Long>, Comparable<MemberRef>, Serializable, nl.vpro.domain.media.support.MutableOwnable, RecursiveParentChildRelation
Expresses an association between MediaObjects. MediaObjects can become a member or episode of other MediaObjects. The member is the member of this relation which references the aggregating owner.
Members or episodes can have an ordering if they are a part of an ordered Group. In that case a MemberRef gets an number value denoting its position in the group. In all other cases this number should retain a null value.
Incoming XML has a member-/episodeof element for each member and references the owner by its URN. The urnRef field holds a temporary reference just for this purpose and should never be persisted.
- Author:
- roekoe
- See Also:
-
MediaObject.memberOf
Program.episodeOf
- Serialized Form
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Instant
protected String
protected MediaObject
protected @NotNull(message="nl.vpro.constraints.NotNull") Boolean
protected MediaObject
protected String
protected @Min(0L) Integer
protected MediaType
protected String
-
Constructor Summary
ConstructorDescriptionMemberRef
(Long id, MediaObject member, MediaObject parent, Integer number, nl.vpro.domain.media.support.OwnerType owner) MemberRef
(MediaObject member, MediaObject parent, Integer number, nl.vpro.domain.media.support.OwnerType owner) MemberRef
(MemberRef source, MediaObject member, nl.vpro.domain.media.support.OwnerType owner) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull MemberRef.Builder
builder()
int
static MemberRef
static MemberRef
copy
(MemberRef source, MediaObject member) boolean
getAdded()
@Nullable MediaObject
getGroup()
Returns the representing the 'group' role in this member-ref-relation.getId()
Reference to the parent.The 'parent' of this relation@NonNull nl.vpro.domain.media.support.OwnerType
getOwner()
@NonNull MediaType
getType()
The type of the parentRetrieves a reference to the owning object and parent of the association by name.int
hashCode()
boolean
The object is not serialized to the database, onlygetMediaRef()
andgetMidRef()
are filled.boolean
ownerEqualsOnRef
(MemberRef that) void
void
void
setCridRef
(String crid) void
setEpisodeOf
(SortedSet<RecursiveMemberRef> episodeOfList) void
setGroup
(MediaObject owner) setHighlighted
(Boolean highlighted) void
setMediaRef
(String mediaRef) void
setMember
(MediaObject member) void
setMemberOf
(SortedSet<RecursiveMemberRef> memberOfList) void
void
void
setOwner
(@NonNull nl.vpro.domain.media.support.OwnerType owner) void
setSegmentOf
(RecursiveMemberRef segmentOf) void
void
Set a reference to the owner by name.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.vpro.domain.media.ParentChildRelation
getParentMid
Methods inherited from interface nl.vpro.domain.media.RecursiveParentChildRelation
getOrCreate, getOrCreateEpisodeOf, getOrCreateMemberOf
-
Field Details
-
member
-
group
-
urnRef
-
cridRef
-
midRef
-
typeOfGroup
-
number
-
added
-
highlighted
@NotNull(message="nl.vpro.constraints.NotNull") protected @NotNull(message="nl.vpro.constraints.NotNull") Boolean highlighted
-
-
Constructor Details
-
MemberRef
public MemberRef() -
MemberRef
public MemberRef(MediaObject member, MediaObject parent, Integer number, nl.vpro.domain.media.support.OwnerType owner) -
MemberRef
public MemberRef(Long id, MediaObject member, MediaObject parent, Integer number, nl.vpro.domain.media.support.OwnerType owner) -
MemberRef
-
MemberRef
-
MemberRef
-
MemberRef
public MemberRef(MemberRef source, MediaObject member, nl.vpro.domain.media.support.OwnerType owner)
-
-
Method Details
-
copy
-
copy
-
ownerEqualsOnRef
-
getId
- Specified by:
getId
in interfaceIdentifiable<Long>
-
getMember
-
setMember
-
getGroup
Returns the representing the 'group' role in this member-ref-relation. Note that this likely, but not necessarily is aGroup
object, since anyMediaObject
may take members. -
setGroup
-
getMediaRef
Reference to the parent. The first non null ofgetMidRef()
,getCridRef()
,getUrnRef()
In the API this is equivalent togetMidRef()
-
setMediaRef
-
getUrnRef
Retrieves a reference to the owning object and parent of the association by name. This method is primarily here for marshaling purposes. In XML documents a MemberRef element contains an urnRef attribute referencing the owner. First this method tries to construct an urnRef based on the URN of the owner. When this fails, it tries to construct a reference bases on a CRID from the owner.- Returns:
- reference to the owner by name or null
-
setUrnRef
Set a reference to the owner by name. A reference might consist of an URN of a CRID identifying the owner. This method should only be used when unmarshalling from XML. When importing XML the import service should retrieve the owner with this name and properly initialise this association.- Parameters:
value
- a valid URN or CRID
-
getCridRef
-
setCridRef
-
getMidRef
The 'parent' of this relation- Specified by:
getMidRef
in interfaceParentChildRelation
-
getChildMid
- Specified by:
getChildMid
in interfaceParentChildRelation
-
setMidRef
-
getType
Description copied from interface:ParentChildRelation
The type of the parent- Specified by:
getType
in interfaceParentChildRelation
-
setType
-
getNumber
-
setNumber
-
getAdded
-
setAdded
-
isHighlighted
-
setHighlighted
-
isVirtual
public boolean isVirtual()The object is not serialized to the database, onlygetMediaRef()
andgetMidRef()
are filled. -
getMemberOf
- Specified by:
getMemberOf
in interfaceRecursiveParentChildRelation
- Since:
- 5.13
-
setMemberOf
- Specified by:
setMemberOf
in interfaceRecursiveParentChildRelation
-
getEpisodeOf
- Specified by:
getEpisodeOf
in interfaceRecursiveParentChildRelation
- Since:
- 5.13
-
setEpisodeOf
- Specified by:
setEpisodeOf
in interfaceRecursiveParentChildRelation
-
getSegmentOf
- Specified by:
getSegmentOf
in interfaceRecursiveParentChildRelation
- Since:
- 5.13
-
setSegmentOf
- Specified by:
setSegmentOf
in interfaceRecursiveParentChildRelation
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<MemberRef>
-
toString
-
prePersist
public void prePersist() -
getOwner
public @NonNull nl.vpro.domain.media.support.OwnerType getOwner()- Specified by:
getOwner
in interfacenl.vpro.domain.media.support.Ownable
-
setOwner
public void setOwner(@NonNull nl.vpro.domain.media.support.OwnerType owner) - Specified by:
setOwner
in interfacenl.vpro.domain.media.support.MutableOwnable
-
builder
-
getRefType
-