Class OrientUtils


  • public final class OrientUtils
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      OrientUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static String addPaginationParameters​(String query)  
      static void close​(com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static com.orientechnologies.orient.core.metadata.schema.OClass createClass​(String className, int clusterNb, com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static com.orientechnologies.orient.core.metadata.schema.OClass createClass​(String className, String superClassName, int clusterNb, com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static void createIndex​(String className, com.orientechnologies.orient.core.db.ODatabaseSession dbSession, String indexName, com.orientechnologies.orient.core.metadata.schema.OClass.INDEX_TYPE indexType, String... propertiesToIndex)  
      static void createProperty​(String className, com.orientechnologies.orient.core.db.ODatabaseSession dbSession, String propertyName, com.orientechnologies.orient.core.metadata.schema.OType type)  
      static void deleteVertex​(String recordId, com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static void dropClassWithData​(String className, com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static void dropdIndex​(String indexName, com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static Optional<com.orientechnologies.orient.core.record.OElement> load​(String recordId, com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static void reloadIfDirty​(com.orientechnologies.orient.core.record.OElement element)  
      static Long resultSetToCount​(com.orientechnologies.orient.core.sql.executor.OResultSet resultSet)  
      static void rollback​(com.orientechnologies.orient.core.db.ODatabaseSession dbSession)  
      static void setOnlyOnceProperty​(com.orientechnologies.orient.core.record.OElement element, String name, Object value, com.orientechnologies.orient.core.metadata.schema.OType type)  
      static void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element, String name, Object value, com.orientechnologies.orient.core.metadata.schema.OType type)  
      static void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element, String name, String value, com.orientechnologies.orient.core.metadata.schema.OType type)  
      static void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element, String name, Optional<?> value, com.orientechnologies.orient.core.metadata.schema.OType type)  
      static <T> void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element, String name, T value, Function<T,​Boolean> setCondition, com.orientechnologies.orient.core.metadata.schema.OType type)  
      static <T> void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element, String name, T value, Function<T,​Boolean> setCondition, Function<T,​Object> extractValueFunction, com.orientechnologies.orient.core.metadata.schema.OType type)  
    • Constructor Detail

      • OrientUtils

        public OrientUtils()
    • Method Detail

      • setOrRemoveProperty

        public static void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element,
                                               String name,
                                               Optional<?> value,
                                               com.orientechnologies.orient.core.metadata.schema.OType type)
      • setOrRemoveProperty

        public static <T> void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element,
                                                   String name,
                                                   T value,
                                                   Function<T,​Boolean> setCondition,
                                                   com.orientechnologies.orient.core.metadata.schema.OType type)
      • setOrRemoveProperty

        public static <T> void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element,
                                                   String name,
                                                   T value,
                                                   Function<T,​Boolean> setCondition,
                                                   Function<T,​Object> extractValueFunction,
                                                   com.orientechnologies.orient.core.metadata.schema.OType type)
      • setOrRemoveProperty

        public static void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element,
                                               String name,
                                               String value,
                                               com.orientechnologies.orient.core.metadata.schema.OType type)
      • setOrRemoveProperty

        public static void setOrRemoveProperty​(com.orientechnologies.orient.core.record.OElement element,
                                               String name,
                                               Object value,
                                               com.orientechnologies.orient.core.metadata.schema.OType type)
      • setOnlyOnceProperty

        public static void setOnlyOnceProperty​(com.orientechnologies.orient.core.record.OElement element,
                                               String name,
                                               Object value,
                                               com.orientechnologies.orient.core.metadata.schema.OType type)
      • resultSetToCount

        public static Long resultSetToCount​(com.orientechnologies.orient.core.sql.executor.OResultSet resultSet)
      • addPaginationParameters

        public static String addPaginationParameters​(String query)
      • createClass

        public static com.orientechnologies.orient.core.metadata.schema.OClass createClass​(String className,
                                                                                           String superClassName,
                                                                                           int clusterNb,
                                                                                           com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • dropClassWithData

        public static void dropClassWithData​(String className,
                                             com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • createClass

        public static com.orientechnologies.orient.core.metadata.schema.OClass createClass​(String className,
                                                                                           int clusterNb,
                                                                                           com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • close

        public static void close​(com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • rollback

        public static void rollback​(com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • load

        public static Optional<com.orientechnologies.orient.core.record.OElement> load​(String recordId,
                                                                                       com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • reloadIfDirty

        public static void reloadIfDirty​(com.orientechnologies.orient.core.record.OElement element)
      • deleteVertex

        public static void deleteVertex​(String recordId,
                                        com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • dropdIndex

        public static void dropdIndex​(String indexName,
                                      com.orientechnologies.orient.core.db.ODatabaseSession dbSession)
      • createProperty

        public static void createProperty​(String className,
                                          com.orientechnologies.orient.core.db.ODatabaseSession dbSession,
                                          String propertyName,
                                          com.orientechnologies.orient.core.metadata.schema.OType type)
      • createIndex

        public static void createIndex​(String className,
                                       com.orientechnologies.orient.core.db.ODatabaseSession dbSession,
                                       String indexName,
                                       com.orientechnologies.orient.core.metadata.schema.OClass.INDEX_TYPE indexType,
                                       String... propertiesToIndex)