I have problem that @Loader annotation is not working for the following class definition:
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedNativeQuery;
import javax.persistence.Table;
import org.hibernate.annotations.Loader;
@Entity
@Table(name = "TESTI")
@Loader(namedQuery = "lataaTesti")
@NamedNativeQuery(name = "lataaTesti", hints = { @javax.persistence.QueryHint(name = "org.hibernate.callable", value = "true") }, query = "call lataaTestiProseduuri('50')", resultClass = Testi.class)
public class Testi implements Serializable{
...
}
The class itself works just fine and loads from database but at loading it completely ignores the @Loader definition and loads itself directly from corresponding database table and skips the procedure call...
I am using sql server and Hibernate 3.5.1-Final version (and hibernate-annotations-3.5.1-Final, hibernate-jpa-2.0-api-1.0.0.Final).
P.S. A "similar" issue has been reported at (but already at 2006...)
viewtopic.php?f=9&t=977936&view=previous