Interface QueryNameStrategy

  • All Known Implementing Classes:
    DotQueryNameStrategy, HashQueryNameStrategy

    public interface QueryNameStrategy

    A set of rules for determining the query name to a set of methods (get, list, add, remove, update) from Repository that don't have a query object as parameter. To change the strategy implements this interface and configure at persistence.xml one property called jkniv.repository.query_namestrategy.

    Sample:

       <properties>
         <property name="jkniv.repository.query_namestrategy" value="com.acme.MyQueryNameStrategy" />
       </properties>
     
    Since:
    0.5.0
    Author:
    Alisson Gomes
    • Method Detail

      • toGetName

        String toGetName​(Object o)
        Return the default query name at XML file to retrieve an object by 'get' method.
        Parameters:
        o - instance of object that will be persisted
        Returns:
        name of query method
      • toAddName

        String toAddName​(Object o)
        Return the default query name at XML file to retrieve an object by 'add' method.
        Parameters:
        o - instance of object that will be persisted
        Returns:
        name of query method
      • toRemoveName

        String toRemoveName​(Object o)
        Return the default query name at XML file to retrieve an object by 'remove' method.
        Parameters:
        o - instance of object that will be persisted
        Returns:
        name of query method
      • toUpdateName

        String toUpdateName​(Object o)
        Return the default query name at XML file to retrieve an object by 'update' method.
        Parameters:
        o - instance of object that will be persisted
        Returns:
        name of query method
      • toListName

        String toListName​(Object o)
        Return the default query name at XML file to retrieve an object by 'list' method.
        Parameters:
        o - instance of object that will be persisted
        Returns:
        name of query method