Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

When generating facelets with CRUD functionality in JSF/JPA in Netbeans 7.3, variables are created in the annotations that specify the SQL statements used to update respective view. The variables are 's', 'f' and 'm'. Where are these variables declared? My assumption was that they would be part of a managed bean with a generous scope but I can't seem to find them.

What are these variables and where do they come from?

share|improve this question

1 Answer 1

Solved. These 'variables' are so called range variables that are used in JPQL. When auto generated by Netbeans, an annotation like

@NamedQuery(name = "MyTable.findAll", query = "SELECT m FROM MyTable m") 

gets a lower case range variable based on the initial letter of the entity being queried.

These can however be changed to a variable name of one's choice. For more information, read "10.2.3.3. JPQL Range Declarations" here:

http://docs.oracle.com/html/E24396_01/ejb3_langref.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.