Package de.xima.fc.common.utils
Class XEntityNameUtils
- java.lang.Object
-
- de.xima.fc.common.utils.XEntityNameUtils
-
public class XEntityNameUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description XEntityNameUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetJpaAttributeName(de.xima.cmn.dao.interfaces.IEntity<?> entity, String fieldName, String fallbackName)Gets the JPA attribute name for a property of an entity.static StringgetJpaAttributeNameClient(de.xima.cmn.dao.interfaces.IEntity<?> entity)Gets the JPA attribute name for theclientproperty of an entity.static StringgetJpaAttributeNameProject(de.xima.cmn.dao.interfaces.IEntity<?> entity)Gets the JPA attribute name for theprojectproperty of an entity.
-
-
-
Method Detail
-
getJpaAttributeName
public static String getJpaAttributeName(de.xima.cmn.dao.interfaces.IEntity<?> entity, String fieldName, String fallbackName)
Gets the JPA attribute name for a property of an entity. Reads the static field with the given name from the entity class, falling back to the given default name if the field is not found or not a string. Some entities redefine the static field (e.g.ATTR_MANDANT) to use the proper English attribute name (e.g.clientinstead ofmandant).- Parameters:
entity- Entity to get the attribute name for.fieldName- Name of the static field to read.fallbackName- Default attribute name to use if the field is not found or not a string.- Returns:
- The attribute name.
-
getJpaAttributeNameClient
public static String getJpaAttributeNameClient(de.xima.cmn.dao.interfaces.IEntity<?> entity)
Gets the JPA attribute name for theclientproperty of an entity. Reads the static field with the nameATTR_MANDANTfrom the entity class, falling back to the default namemandantif the field is not found or not a string. Some entities redefine the static fieldATTR_MANDANT) to use the proper English attribute nameclientinstead ofmandant.- Parameters:
entity- Entity to get the attribute name for.- Returns:
- The attribute name.
-
getJpaAttributeNameProject
public static String getJpaAttributeNameProject(de.xima.cmn.dao.interfaces.IEntity<?> entity)
Gets the JPA attribute name for theprojectproperty of an entity. Reads the static field with the nameATTR_PROJEKTfrom the entity class, falling back to the default nameprojektif the field is not found or not a string. Some entities redefine the static fieldATTR_PROJEKT) to use the proper English attribute nameprojectinstead ofprojekt.- Parameters:
entity- Entity to get the attribute name for.- Returns:
- The attribute name.
-
-