com.atlassian.core.ofbiz.util
Class EntityUtils

java.lang.Object
  extended by com.atlassian.core.ofbiz.util.EntityUtils

Deprecated. Use EntityUtils instead. Since v5.1.

public class EntityUtils
extends Object

This was taken from atlassian-ofbiz and placed into its now rightful home of JIRA.

Since:
4.3

Constructor Summary
EntityUtils()
          Deprecated.  
 
Method Summary
static boolean contains(Collection<org.ofbiz.core.entity.GenericValue> entities, org.ofbiz.core.entity.GenericValue entity)
          Deprecated. Not used in JIRA code - please replicate this if you want to use it. Since v5.1.
static org.ofbiz.core.entity.GenericValue createValue(String entity, Map<String,?> paramMap)
          Deprecated. Use EntityUtils.createValue(String, java.util.Map) instead. Since v5.1.
static List<org.ofbiz.core.entity.GenericValue> filterByAnd(List<org.ofbiz.core.entity.GenericValue> values, List<? extends org.ofbiz.core.entity.EntityExpr> exprs)
          Deprecated. Use EntityUtil.filterByAnd(java.util.List, java.util.List) instead or write your own filter. Since v5.1.
static String getNextStringId(String entityName)
          Deprecated. Use EntityUtils.getNextStringId(String) instead. Since v5.1.
static org.ofbiz.core.entity.EntityOperator getOperator(String code)
          Deprecated. Not used in JIRA code - please replicate this if you want to use it. Since v5.1.
static boolean identical(org.ofbiz.core.entity.GenericValue v1, org.ofbiz.core.entity.GenericValue v2)
          Deprecated. Use EntityUtils.identical(org.ofbiz.core.entity.GenericValue, org.ofbiz.core.entity.GenericValue) instead. Since v5.1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityUtils

public EntityUtils()
Deprecated. 
Method Detail

getOperator

public static org.ofbiz.core.entity.EntityOperator getOperator(String code)
Deprecated. Not used in JIRA code - please replicate this if you want to use it. Since v5.1.

Small utility method to get an entity operator from it's code


createValue

public static org.ofbiz.core.entity.GenericValue createValue(String entity,
                                                             Map<String,?> paramMap)
                                                      throws org.ofbiz.core.entity.GenericEntityException
Deprecated. Use EntityUtils.createValue(String, java.util.Map) instead. Since v5.1.

Create a new entity. If there is no "id" in the parameter list, one is created using the entity sequence

Throws:
org.ofbiz.core.entity.GenericEntityException

identical

public static boolean identical(org.ofbiz.core.entity.GenericValue v1,
                                org.ofbiz.core.entity.GenericValue v2)
Deprecated. Use EntityUtils.identical(org.ofbiz.core.entity.GenericValue, org.ofbiz.core.entity.GenericValue) instead. Since v5.1.

Compare two GenericValues based on their content. This method will check the keys and values of both GenericValues. There is only a single difference between this method and GenericValue.equals(gv2), that is that if one GV has no key of a certain type, and the other has a null value for that key, they are still deemed to be identical (as GenericValue.get(key) always returns null if the key exists or not).

Returns:
true if the issues are the same, false if they are different

contains

public static boolean contains(Collection<org.ofbiz.core.entity.GenericValue> entities,
                               org.ofbiz.core.entity.GenericValue entity)
Deprecated. Not used in JIRA code - please replicate this if you want to use it. Since v5.1.

Checks if a collection of entities contains an identical entity to the one provided.

Parameters:
entities - The list of entities to search
entity - The entity to search for and compare to
Returns:
The matching entity, or null if no matching entity is found

filterByAnd

public static List<org.ofbiz.core.entity.GenericValue> filterByAnd(List<org.ofbiz.core.entity.GenericValue> values,
                                                                   List<? extends org.ofbiz.core.entity.EntityExpr> exprs)
Deprecated. Use EntityUtil.filterByAnd(java.util.List, java.util.List) instead or write your own filter. Since v5.1.

This method is analogous to the OFBiz EntityUtil.filterByAnd method except that theirs does not filter on GT, GTE, LT, LTE yet.

Parameters:
values - A collection of GenericValues
exprs - The expressions that must validate to true
Returns:
Collection of GenericValues that match the expression list

getNextStringId

public static String getNextStringId(String entityName)
                              throws org.ofbiz.core.entity.GenericEntityException
Deprecated. Use EntityUtils.getNextStringId(String) instead. Since v5.1.

Calculate a new entity ID (by basically taking one more than the max integer that exists). If there are string IDs here, they will not be affected.

Throws:
org.ofbiz.core.entity.GenericEntityException


Copyright © 2002-2014 Atlassian. All Rights Reserved.