[forge-issues] [JBoss JIRA] (FORGE-2138) Being able to add a @NamedQuery to an existing entity

Antonio Goncalves (JIRA) issues at jboss.org
Sun Nov 9 12:27:29 EST 2014


Antonio Goncalves created FORGE-2138:
----------------------------------------

             Summary: Being able to add a @NamedQuery to an existing entity
                 Key: FORGE-2138
                 URL: https://issues.jboss.org/browse/FORGE-2138
             Project: Forge
          Issue Type: Sub-task
          Components: Java EE
    Affects Versions: 2.12.2.Final
            Reporter: Antonio Goncalves
             Fix For: 2.x Future


It would be useful to have a command to add a new JPA NamedQuery to an existing entity. A command such as : 

{code}
jpa-new-named-query --named findAll --query select b from Book b
{code}

Would add to an existing entity the following code :

{code}
@Entity
@NamedQueries({
         @NamedQuery(name = Book.FIND_ALL, query = "SELECT b FROM Book b")
})
public class Book implements Serializable
{
   public static final String FIND_ALL = "Book.findAll";
   ...
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the forge-issues mailing list