Package io.objectbox

Class Property<ENTITY>

  • All Implemented Interfaces:
    java.io.Serializable

    public class Property<ENTITY>
    extends java.lang.Object
    implements java.io.Serializable
    Meta data describing a property of an ObjectBox entity. Properties are typically used to define query criteria using QueryBuilder.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Property​(EntityInfo<ENTITY> entity, int ordinal, int id, java.lang.Class<?> type, java.lang.String name)  
      Property​(EntityInfo<ENTITY> entity, int ordinal, int id, java.lang.Class<?> type, java.lang.String name, boolean isVirtual)  
      Property​(EntityInfo<ENTITY> entity, int ordinal, int id, java.lang.Class<?> type, java.lang.String name, boolean isId, boolean isVirtual, java.lang.String dbName, java.lang.Class<? extends PropertyConverter> converterClass, java.lang.Class customType)  
      Property​(EntityInfo<ENTITY> entity, int ordinal, int id, java.lang.Class<?> type, java.lang.String name, boolean isId, java.lang.String dbName)  
      Property​(EntityInfo<ENTITY> entity, int ordinal, int id, java.lang.Class<?> type, java.lang.String name, boolean isId, java.lang.String dbName, java.lang.Class<? extends PropertyConverter> converterClass, java.lang.Class customType)  
    • Field Detail

      • ordinal

        public final int ordinal
      • id

        public final int id
      • type

        public final java.lang.Class<?> type
        One of the supported types to be mapped to the DB.
      • name

        public final java.lang.String name
      • isId

        public final boolean isId
      • isVirtual

        public final boolean isVirtual
      • dbName

        public final java.lang.String dbName
      • converterClass

        public final java.lang.Class<? extends PropertyConverter> converterClass
      • customType

        public final java.lang.Class customType
        Type, which is converted to a type supported by the DB.
    • Constructor Detail

      • Property

        public Property​(EntityInfo<ENTITY> entity,
                        int ordinal,
                        int id,
                        java.lang.Class<?> type,
                        java.lang.String name)
      • Property

        public Property​(EntityInfo<ENTITY> entity,
                        int ordinal,
                        int id,
                        java.lang.Class<?> type,
                        java.lang.String name,
                        boolean isVirtual)
      • Property

        public Property​(EntityInfo<ENTITY> entity,
                        int ordinal,
                        int id,
                        java.lang.Class<?> type,
                        java.lang.String name,
                        boolean isId,
                        @Nullable
                        java.lang.String dbName)
      • Property

        public Property​(EntityInfo<ENTITY> entity,
                        int ordinal,
                        int id,
                        java.lang.Class<?> type,
                        java.lang.String name,
                        boolean isId,
                        @Nullable
                        java.lang.String dbName,
                        @Nullable
                        java.lang.Class<? extends PropertyConverter> converterClass,
                        @Nullable
                        java.lang.Class customType)
      • Property

        public Property​(EntityInfo<ENTITY> entity,
                        int ordinal,
                        int id,
                        java.lang.Class<?> type,
                        java.lang.String name,
                        boolean isId,
                        boolean isVirtual,
                        @Nullable
                        java.lang.String dbName,
                        @Nullable
                        java.lang.Class<? extends PropertyConverter> converterClass,
                        @Nullable
                        java.lang.Class customType)
    • Method Detail

      • eq

        public QueryCondition eq​(java.lang.Object value)
        Creates an "equal ('=')" condition for this property.
      • notEq

        public QueryCondition notEq​(java.lang.Object value)
        Creates an "not equal ('<>')" condition for this property.
      • between

        public QueryCondition between​(java.lang.Object value1,
                                      java.lang.Object value2)
        Creates an "BETWEEN ... AND ..." condition for this property.
      • in

        public QueryCondition in​(java.lang.Object... inValues)
        Creates an "IN (..., ..., ...)" condition for this property.
      • in

        public QueryCondition in​(java.util.Collection<?> inValues)
        Creates an "IN (..., ..., ...)" condition for this property.
      • gt

        public QueryCondition gt​(java.lang.Object value)
        Creates an "greater than ('>')" condition for this property.
      • lt

        public QueryCondition lt​(java.lang.Object value)
        Creates an "less than ('<')" condition for this property.
      • isNull

        public QueryCondition isNull()
        Creates an "IS NULL" condition for this property.
      • isNotNull

        public QueryCondition isNotNull()
        Creates an "IS NOT NULL" condition for this property.
      • getEntityId

        @Internal
        public int getEntityId()
      • toString

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