trying to run a named query

Posted by dora on Stack Overflow See other posts from Stack Overflow or by dora
Published on 2010-03-16T08:40:32Z Indexed on 2010/05/16 18:00 UTC
Read the original article Hit count: 198

Filed under:
|

hi,

I’m doing the following:

@Entity
@SqlResultSetMapping(name="getxxxx",
        entities=@EntityResult(xxxx.class,
            fields = {
                    @FieldResult(name="x1", column = "x1"),
                    @FieldResult(name="x2", column = "x2")}))

@NamedNativeQuery(name=" getxxxx ",
    query="select x1, x2 from yyyy", 
    resultSetMapping=" getxxxx ")

} )public class xxxx{

    .
    .
    .
    public xxxx() {

}

i get an error: "Table "xxxx" cannot be resolved", the class xxxx is not a table mapped into my source, I’m trying to query the DB and return the results into my class is it possible?

© Stack Overflow or respective owner

Related posts about java

Related posts about jpa