Class XEntityNameUtils
java.lang.Object
de.xima.fc.common.utils.XEntityNameUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetJpaAttributeName(de.xima.cmn.dao.interfaces.IEntity<?> entity, String fieldName) 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.
-
Constructor Details
-
XEntityNameUtils
public XEntityNameUtils()
-
-
Method Details
-
getJpaAttributeName
public static String getJpaAttributeName(de.xima.cmn.dao.interfaces.IEntity<?> entity, String fieldName) Gets the JPA attribute name for a property of an entity. Reads the static field with the given name from the entity class. 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.- Returns:
- The attribute name.
-
getJpaAttributeNameClient
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
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.
-