Class OBDao


  • public class OBDao
    extends Object
    Util class for DAL
    Author:
    gorkaion
    • Constructor Detail

      • OBDao

        public OBDao()
    • Method Detail

      • getFilteredCriteria

        public static <T extends BaseOBObjectOBCriteria<T> getFilteredCriteria​(Class<T> clazz,
                                                                                 org.hibernate.criterion.Criterion... constraints)
        Generic OBCriteria.
        Parameters:
        clazz - Class (entity).
        constraints - List of hibernate Criterion instances which are used as filters
        Returns:
        An OBCriteria object with the constraints.
      • getActiveOBObjectList

        public static <T extends BaseOBObjectList<T> getActiveOBObjectList​(BaseOBObject obj,
                                                                             String property)
        Returns a List of BaseOBOBjects of the Property identified by the property from the BaseOBObject obj. This method enables the activeFilter so inactive BaseOBObjects are not included on the returned List.
        Parameters:
        obj - BaseOBObject from which the values are requested
        property - the name of the Property for which the value is requested
      • getOBObjectListFromString

        public static <T extends BaseOBObjectList<T> getOBObjectListFromString​(Class<T> t,
                                                                                 String _IDs)
        Parses the string of comma separated id's to return a List with the BaseOBObjects of the given class. If there is an invalid id a null value is added to the List.
        Parameters:
        t - class of the BaseOBObject the id's belong to
        _IDs - String containing the comma separated list of id's
        Returns:
        a List object containing the parsed OBObjects