Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Out of Date
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The query interface allows for easy usage of JPA queries. Basically you annotate an interface as follows:

      public interface QueryInterface {
      		@QueryMethod("person.query.all")
      		List<Person> getAll();
      
      		@QueryMethod("person.select.by.name")
      		Person getPersonByName(@QueryParam("name") String name);
      
      		@QueryMethod(value = "person.select.by.name", nullable = true)
      		Person findPersonByName(@QueryParam("name") String name);
      
      		@QueryMethod("person.query.all")
      		Query getAllQuery();
      		
      		@QueryMethod(query = "SELECT COUNT(*) FROM Person")
      		Long countAll();
      	}
      

      Using some inject QueryInterfaceFactory you can get a proxy on this interface that will interpret the annotations towards JPA queries. See attached patch for a basic implementation.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fcorneli Frank Cornelis
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: