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

George Gastaldi (JIRA) issues at jboss.org
Sun Nov 9 15:05:29 EST 2014


    [ https://issues.jboss.org/browse/FORGE-2138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018481#comment-13018481 ] 

George Gastaldi commented on FORGE-2138:
----------------------------------------

The query needs to quoted: eg. {{jpa-new-named-query --named findAll --query "select B from Book B"}}

> 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