Class XEntityNameUtils


  • public class XEntityNameUtils
    extends Object
    • Constructor Detail

      • XEntityNameUtils

        public XEntityNameUtils()
    • Method Detail

      • 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. client instead of mandant).
        Parameters:
        entity - Entity to get the attribute name for.
        fieldName - Name of the static field to read.
        Returns:
        The attribute name.
      • getJpaAttributeNameClient

        public static String getJpaAttributeNameClient​(de.xima.cmn.dao.interfaces.IEntity<?> entity)
        Gets the JPA attribute name for the client property of an entity. Reads the static field with the name ATTR_MANDANT from the entity class, falling back to the default name mandant if the field is not found or not a string. Some entities redefine the static field ATTR_MANDANT) to use the proper English attribute name client instead of mandant.
        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 the project property of an entity. Reads the static field with the name ATTR_PROJEKT from the entity class, falling back to the default name projekt if the field is not found or not a string. Some entities redefine the static field ATTR_PROJEKT) to use the proper English attribute name project instead of projekt.
        Parameters:
        entity - Entity to get the attribute name for.
        Returns:
        The attribute name.