Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.IllegalArgumentException with toplink and JPA
    primarykey
    data
    text
    <p>I've a problem with JPA, whenever execute this query </p> <pre><code>@NamedQuery(name = "Usuario.getUsuarioIntento", query = "SELECT u.intentos_id FROM Usuario u WHERE u.username = :username and u.borrado = 0") </code></pre> <p>i get this error:</p> <pre><code>java.lang.IllegalArgumentException: NamedQuery of name: Usuario.getUsuarioIntento not found. </code></pre> <p>But if i execute this query </p> <pre><code>@NamedQuery(name = "Usuario.getUsuarioIntento", query = "SELECT u.id FROM Usuario u WHERE u.username = :username and u.borrado = 0") </code></pre> <p>Work fine,Why?</p> <p>My table,Usuario:</p> <p><a href="http://i48.tinypic.com/4kxj03.png" rel="nofollow">MY USER TABLE</a></p> <p>i try with other column as 'superusuario','version_jpa' and doesn't work, the only columns that work fine are 'id,'borrado' and 'username'</p> <p>Class Usuario:</p> <pre><code>@Temporal(TemporalType.TIMESTAMP) private Date fechaCreacion; @Id @GeneratedValue (strategy=GenerationType.AUTO) private int id; @OneToOne(cascade = CascadeType.ALL) private Password password; @OneToMany(cascade = {CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.LAZY) private List&lt;Password&gt; clavesAntiguas; @OneToOne private Persona persona; private String sessionId; private String username; @ManyToOne(cascade = CascadeType.REFRESH) private Rol rol; @ManyToOne(cascade = CascadeType.REFRESH) private Perfil perfil; @OneToOne (cascade = CascadeType.ALL) private IntentosBloqueo intentos; private boolean superUsuario; private int borrado; private int esManager; @OneToMany ( cascade = {CascadeType.ALL} , fetch = FetchType.LAZY) private Collection&lt;UsuarioSociedad&gt; sociedades; @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH) @JoinTable (name="USR_UND_VIS", joinColumns={ @JoinColumn (name="ID_USU", table="USUARIO", referencedColumnName="ID"), }, inverseJoinColumns= @JoinColumn (name="ID_UNI", table="UND_ORG", referencedColumnName="ID") ) private List&lt;UnidadOrganizativa&gt; unidadesVisibles; @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH) @JoinTable (name="USR_UND_DIS", joinColumns={ @JoinColumn (name="ID_USU", table="USUARIO", referencedColumnName="ID"), }, inverseJoinColumns= @JoinColumn (name="ID_UNI", table="UND_ORG", referencedColumnName="ID") ) private List&lt;UnidadOrganizativa&gt; unidadesDisponibles; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload