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 String
getJpaAttributeName(de.xima.cmn.dao.interfaces.IEntity<?> entity, String fieldName, String fallbackName)
Gets the JPA attribute name for a property of an entity.static String
getJpaAttributeNameClient(de.xima.cmn.dao.interfaces.IEntity<?> entity)
Gets the JPA attribute name for theclient
property of an entity.static String
getJpaAttributeNameProject(de.xima.cmn.dao.interfaces.IEntity<?> entity)
Gets the JPA attribute name for theproject
property 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.client
instead 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 theclient
property of an entity. Reads the static field with the nameATTR_MANDANT
from the entity class, falling back to the default namemandant
if the field is not found or not a string. Some entities redefine the static fieldATTR_MANDANT
) to use the proper English attribute nameclient
instead 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 theproject
property of an entity. Reads the static field with the nameATTR_PROJEKT
from the entity class, falling back to the default nameprojekt
if the field is not found or not a string. Some entities redefine the static fieldATTR_PROJEKT
) to use the proper English attribute nameproject
instead ofprojekt
.- Parameters:
entity
- Entity to get the attribute name for.- Returns:
- The attribute name.
-
-