Say I have a Foo entity -
package com.some.company.model;
@Entity
public class Foo{
@Id
private Long id;
}
so when working with Entity through HQL, I prefer to reference Entity using the fully qualified class name, for example -
entityManager.createQuery(String.format("delete from %s where id = :id", Foo.class.getName()))
.setParameter("id", fooId)
.executeUpdate();
I noticed one thing in the annotation @Entity- by default, the name property has an unqualified name for the entity class. what makes me think why an unconditional name?
What should I use in an unqualified HQL name or fully qualified name?
source
share