]
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}