NamedQuery in Entity design

I am wondering if I post this as a question or as an idea for enhancement.

How can we dynamically create NamedQueries while creating an Entity in entity designer.
something like this:

@NamedQuery(name="Item.findAllItemRecords" , 
                      query="SELECT item " +
                                "FROM Item item "
                                "WHERE item.itemId=:itemId),
@NamedQuery(name="Item.findItemByType" , 
                      query="SELECT item " +
                                "FROM Item item "
                                "WHERE item.itemType=:itemType)
public class Item {

   private String itemId;

   private String itemType;


Hi Mortoza,

We will consider your idea, and if we see that this functionality is useful for wide community we will include this feature in the future.


Thank you. Netbeans has this functionality when you create Entity from a database table. It should not be a lengthy work, i think a free marker program may be the solutions, but i’m not the expert!