Class RelationInfo<SOURCE,​TARGET>

  • All Implemented Interfaces:
    java.io.Serializable

    @Internal
    @Immutable
    public class RelationInfo<SOURCE,​TARGET>
    extends java.lang.Object
    implements java.io.Serializable
    Meta info describing a relation including source and target entity.
    See Also:
    Serialized Form
    • Field Detail

      • targetIdProperty

        public final Property targetIdProperty
        For relations based on a target ID property (null otherwise).
      • targetRelationId

        public final int targetRelationId
        For ToMany relations based on ToMany backlinks (0 otherwise).
      • toOneGetter

        public final io.objectbox.internal.ToOneGetter<TARGET> toOneGetter
        Only set for ToOne relations
      • toManyGetter

        public final io.objectbox.internal.ToManyGetter<TARGET> toManyGetter
        Only set for ToMany relations
      • backlinkToOneGetter

        public final io.objectbox.internal.ToOneGetter<SOURCE> backlinkToOneGetter
        For ToMany relations based on ToOne backlinks (null otherwise).
      • backlinkToManyGetter

        public final io.objectbox.internal.ToManyGetter<SOURCE> backlinkToManyGetter
        For ToMany relations based on ToMany backlinks (null otherwise).
      • relationId

        public final int relationId
        For stand-alone to-many relations (0 otherwise).
    • Constructor Detail

      • RelationInfo

        public RelationInfo​(EntityInfo<SOURCE> sourceInfo,
                            EntityInfo<TARGET> targetInfo,
                            io.objectbox.internal.ToManyGetter toManyGetter,
                            Property targetIdProperty,
                            io.objectbox.internal.ToOneGetter backlinkToOneGetter)
        ToMany as a ToOne backlink
      • RelationInfo

        public RelationInfo​(EntityInfo<SOURCE> sourceInfo,
                            EntityInfo<TARGET> targetInfo,
                            io.objectbox.internal.ToManyGetter toManyGetter,
                            io.objectbox.internal.ToManyGetter backlinkToManyGetter,
                            int targetRelationId)
        ToMany as a ToMany backlink
      • RelationInfo

        public RelationInfo​(EntityInfo<SOURCE> sourceInfo,
                            EntityInfo<TARGET> targetInfo,
                            io.objectbox.internal.ToManyGetter toManyGetter,
                            int relationId)
        Stand-alone ToMany.
    • Method Detail

      • isBacklink

        public boolean isBacklink()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object