JBoss Community

Re: Weired JPA named query @NamedQuery behaviour

created by Christian Groove in EJB3 - View the full discussion

Salut Ilja,

 

> A named query is a statically defined query with a predefined unchangeable query string.

 

i agree to this, bit Dbean1.JPQL_COMPOSITION is definitivly static and

unachnageable. For that reason i use final-static modifier. But

Jboss still think, it is not.

 

but:

@NamedQueries(

    {

        @NamedQuery(

            name=Dbean1.GET_COMPOSITION,

            query=Dbean1.JPQL_COMPOSITION)

    }

)

 

 

 

where:

 

@Entity

public class Dbean1. implements Serializable

{

   /* some code */

 

 

   final public static String GET_COMPOSITION = ".... composition " ;

   final public static String JPQL_COMPOSITION = "SELECT dbean FROM ..... " + Dbean1.dummyClass() ;

 

 


Reply to this message by going to Community

Start a new discussion in EJB3 at Community