com.atlassian.jira.crowd.embedded.ofbiz.db
Class OfBizHelper

java.lang.Object
  extended by com.atlassian.jira.crowd.embedded.ofbiz.db.OfBizHelper

public class OfBizHelper
extends Object

Wrapper around GenericDelegator to add Generics, and wrap GenericEntityException in a RuntimeException (DataAccessException).


Constructor Summary
OfBizHelper(org.ofbiz.core.entity.DelegatorInterface genericDelegator)
           
 
Method Summary
static Timestamp convertToSqlTimestamp(Date date)
          Converts a java.util.Date to a java.sql.Timestamp.
static Date convertToUtilDate(Timestamp timestamp)
          Converts a java.sql.Timestamp to a java.util.Date.
 org.ofbiz.core.entity.GenericValue createValue(String entity, Map<String,Object> paramMap)
          Create a new entity.
 List<org.ofbiz.core.entity.GenericValue> findAll(String entityName)
           
 List<org.ofbiz.core.entity.GenericValue> findByAnd(String entityName, Map<String,Object> fields)
           
 List<org.ofbiz.core.entity.GenericValue> findByAnd(String entityName, Map<String,Object> fields, List<String> orderBy)
           
 List<org.ofbiz.core.entity.GenericValue> findByCondition(String entityName, org.ofbiz.core.entity.EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy)
           
 String getEntityHelperName(String entityName)
           
 org.ofbiz.core.entity.model.ModelEntity getModelEntity(String entityName)
           
 org.ofbiz.core.entity.GenericValue makeValue(String entityName, Map<String,Object> fields)
           
 int removeByAnd(String entityName, Map<String,Object> fields)
           
 void removeValue(org.ofbiz.core.entity.GenericValue genericValue)
           
 void store(org.ofbiz.core.entity.GenericValue genericValue)
           
 void storeAll(List<org.ofbiz.core.entity.GenericValue> values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfBizHelper

public OfBizHelper(org.ofbiz.core.entity.DelegatorInterface genericDelegator)
Method Detail

findAll

public List<org.ofbiz.core.entity.GenericValue> findAll(String entityName)

findByAnd

public List<org.ofbiz.core.entity.GenericValue> findByAnd(String entityName,
                                                          Map<String,Object> fields)

findByAnd

public List<org.ofbiz.core.entity.GenericValue> findByAnd(String entityName,
                                                          Map<String,Object> fields,
                                                          List<String> orderBy)

findByCondition

public List<org.ofbiz.core.entity.GenericValue> findByCondition(String entityName,
                                                                org.ofbiz.core.entity.EntityCondition entityCondition,
                                                                Collection<String> fieldsToSelect,
                                                                List<String> orderBy)

makeValue

public org.ofbiz.core.entity.GenericValue makeValue(String entityName,
                                                    Map<String,Object> fields)

store

public void store(org.ofbiz.core.entity.GenericValue genericValue)

storeAll

public void storeAll(List<org.ofbiz.core.entity.GenericValue> values)

removeValue

public void removeValue(org.ofbiz.core.entity.GenericValue genericValue)

removeByAnd

public int removeByAnd(String entityName,
                       Map<String,Object> fields)

getModelEntity

public org.ofbiz.core.entity.model.ModelEntity getModelEntity(String entityName)

getEntityHelperName

public String getEntityHelperName(String entityName)

createValue

public org.ofbiz.core.entity.GenericValue createValue(String entity,
                                                      Map<String,Object> paramMap)
Create a new entity. If there is no "id" in the parameter list, one is created using the entity sequence


convertToUtilDate

public static Date convertToUtilDate(Timestamp timestamp)
Converts a java.sql.Timestamp to a java.util.Date.

Parameters:
timestamp - The java.sql.Timestamp
Returns:
the java.util.Date.

convertToSqlTimestamp

public static Timestamp convertToSqlTimestamp(Date date)
Converts a java.util.Date to a java.sql.Timestamp.

Parameters:
date - The java.util.Date
Returns:
the java.sql.Timestamp.


Copyright © 2002-2013 Atlassian. All Rights Reserved.