Package org.openbravo.dal.service
Class OBDao
- java.lang.Object
-
- org.openbravo.dal.service.OBDao
-
public class OBDao extends Object
Util class for DAL- Author:
- gorkaion
-
-
Constructor Summary
Constructors Constructor Description OBDao()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends BaseOBObject>
List<T>getActiveOBObjectList(BaseOBObject obj, String property)
Returns a List of BaseOBOBjects of the Property identified by the property from the BaseOBObject obj.static <T extends BaseOBObject>
OBCriteria<T>getFilteredCriteria(Class<T> clazz, org.hibernate.criterion.Criterion... constraints)
Generic OBCriteria.static <T extends BaseOBObject>
List<String>getIDListFromOBObject(List<T> list)
static <T extends BaseOBObject>
List<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.
-
-
-
Method Detail
-
getFilteredCriteria
public static <T extends BaseOBObject> OBCriteria<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 BaseOBObject> List<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 requestedproperty
- the name of the Property for which the value is requested
-
getOBObjectListFromString
public static <T extends BaseOBObject> List<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
-
getIDListFromOBObject
public static <T extends BaseOBObject> List<String> getIDListFromOBObject(List<T> list)
-
-