Package ch.helvethink.odoo4java.rpc
Interface OdooRpcClient
public interface OdooRpcClient
Interface to implement for Odoo Rpc
-
Method Summary
Modifier and TypeMethodDescriptionintcountByCriteria(Class<? extends OdooObj> objectType, Object... criteria) Count objects that respects the criteria (useful for pagination for instance)findByCriteria(int limit, int page, Class<T> classToConvert, Object... criteria) Find an Odoo object using criteria with pagination.findByCriteria(int limit, int page, String sort, Class<T> classToConvert, Object... criteria) findByCriteria(int limit, Class<T> classToConvert, Object... criteria) Find an Odoo object using criteria.findListByIds(List<OdooId> idsToFetch, Class<T> classToConvert) Same as above but with Odoo IdsfindListByIdsInt(List<Integer> idsToFetch, Class<T> classToConvert) Same asfindObjectById(OdooId, Class)but with a List<T extends OdooObj>
TfindObjectById(OdooId idToFetch, Class<T> classToConvert) Fetch an object by its id
-
Method Details
-
findByCriteria
<T extends OdooObj> List<T> findByCriteria(int limit, int page, Class<T> classToConvert, Object... criteria) Find an Odoo object using criteria with pagination. If no criteria, will send all the objects (id >=0 )- Type Parameters:
T- The target type- Parameters:
limit- Number of objects we want to retrievepage- The page we want to retrieveclassToConvert- Type of the target objectcriteria- The search criteria- Returns:
- List of corresponding objects
-
countByCriteria
Count objects that respects the criteria (useful for pagination for instance)- Parameters:
objectType- Odoo objects we want to countcriteria- Criteria of the request- Returns:
- number of objects
-
findByCriteria
Find an Odoo object using criteria. If no criteria, will send all the objects (id >=0 )- Type Parameters:
T- The target type- Parameters:
limit- Number of objects we want to retrieveclassToConvert- Type of the target objectcriteria- The search criteria- Returns:
- List of corresponding objects
-
findByCriteria
<T extends OdooObj> List<T> findByCriteria(int limit, int page, String sort, Class<T> classToConvert, Object... criteria) - Parameters:
limit- Number of objects we want to retrievepage- Page we want to retrievesort- Field to sort resultsclassToConvert- Type of the target objectcriteria- The search criteria- Returns:
- List of corresponding objects
-
findObjectById
Fetch an object by its id- Type Parameters:
T- The type of the target Object- Parameters:
idToFetch- The id of the object we want to fetchclassToConvert- The type of the target Object- Returns:
- The object fetched
-
findListByIdsInt
Same asfindObjectById(OdooId, Class)but with a List- Type Parameters:
T- The type of the target objects If an exception occured, will send back an empty list- Parameters:
idsToFetch- The ids of objects we want to fetchclassToConvert- The type of the target objects- Returns:
- List of built objects
-
findListByIds
Same as above but with Odoo Ids- Type Parameters:
T- The type of the target objects- Parameters:
idsToFetch- The ids of objects we want to fetch under the form ofOdooIdclassToConvert- The type of the target objects- Returns:
- List of built objects
-