Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-163

Add ability to generate Entity Query classes with Persistence plugin (using Named Queries)

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.0.0.Beta1
    • Fix Version/s: None
    • Component/s: Builtin Plugins, Java EE
    • Labels:
      None

      Gliffy Diagrams

        Activity

        Hide
        pmuir Pete Muir added a comment -

        Where would that name get injected from?

        Show
        pmuir Pete Muir added a comment - Where would that name get injected from?
        Hide
        lincolnthree Lincoln Baxter III added a comment -

        Ah, I think I am thinking about something else.

        You would:

        @Inject UserQuery query;
        

        then call:

        User user = query.getUserByName("blah");
        

        But the code to actually instantiate and execute the query would be abstracted away. It gives you a typesafe way of referencing queries.

        Your approach has benefits as well, since you could just:

        @Inject @All List<User> users;

        So I get that, too. I think both compliment each other. The query I defined would not @Produce anything, though.

        Show
        lincolnthree Lincoln Baxter III added a comment - Ah, I think I am thinking about something else. You would: @Inject UserQuery query; then call: User user = query.getUserByName("blah"); But the code to actually instantiate and execute the query would be abstracted away. It gives you a typesafe way of referencing queries. Your approach has benefits as well, since you could just: @Inject @All List<User> users; So I get that, too. I think both compliment each other. The query I defined would not @Produce anything, though.
        Hide
        pmuir Pete Muir added a comment -

        Yes, this approach works very well if you just want to inject the query. I was wondering how this would work from something like EL. But probably with method parameters it's not a problem, assuming you can cache the result of the query in a context.

        Show
        pmuir Pete Muir added a comment - Yes, this approach works very well if you just want to inject the query. I was wondering how this would work from something like EL. But probably with method parameters it's not a problem, assuming you can cache the result of the query in a context.
        Hide
        lincolnthree Lincoln Baxter III added a comment -

        This would be horrible in EL without caching

        Show
        lincolnthree Lincoln Baxter III added a comment - This would be horrible in EL without caching
        Hide
        gastaldi George Gastaldi added a comment -

        This should belong to a specific framework addon

        Show
        gastaldi George Gastaldi added a comment - This should belong to a specific framework addon

          People

          • Assignee:
            Unassigned
            Reporter:
            lightguard Jason Porter
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development