Class EntityUtils
- java.lang.Object
-
- com.broadleafcommerce.common.messaging.EntityUtils
-
public final class EntityUtils extends Object
Dynamically perform operations related to repository domain classes.- Author:
- Jeff Fischer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
findId(Object entity)
static Field
findIdField(Class<?> entityClass)
Find the field marked with the Spring or JPA @Id annotation in the entity class.
-
-
-
Method Detail
-
findIdField
@Nullable public static Field findIdField(Class<?> entityClass)
Find the field marked with the Spring or JPA @Id annotation in the entity class. This process will search superclasses, should an id field not be found on the provided class. Will return null if no id annotated field is found.- Parameters:
entityClass
- The class to check for the id annotated field- Returns:
- the id field or null if none found
- Throws:
IllegalArgumentException
- if unable to find an id field
-
-