users@glassfish.java.net

Re: EJB is confused what it is seeing?

From: <glassfish_at_javadesktop.org>
Date: Wed, 22 Aug 2007 14:28:25 PDT

First, THANK YOU VERY MUCH! I would have not seen that error.....

What I have accomplished is re-defind my namedQuery.

[code]
@Entity
@EntityListeners(ejb.bean.listener.MyAuditor.class)
@NamedQueries({
        @NamedQuery(name="findFileTypeByExtension",
                            query="SELECT ft FROM FileType ft " +
                                          "WHERE ft.extension=?1"),
        @NamedQuery(name="findFileTypeByDescription",
                            query="SELECT ft FROM FileType ft " +
                                          "WHERE ft.description=?1")
})
@Table(name="FILE_TYPE")
public class FileType implements Serializable{

        private Long fileTypeId;
        private String extension;
        private String description;
[/code]


I read you point about using positional parameters. I think what you are recommending is I use a dynamic query string instead of a positional query string as positional parameters are not allowed in NamedQueries by the Spec. Is this correct?

Thank you taking the time to read my post.

Russ
[Message sent by forum member 'russ_ray' (russ_ray)]

http://forums.java.net/jive/thread.jspa?messageID=232127