Ich möchte ein FetchProfile mit meinem DAO für die Entität Beispiel verwenden.Ruhezustand enableFetchProfile -> unknow
Dies ist die Anmerkung in meiner Einheit:
@FetchProfiles({ @FetchProfile(name = "example-profile", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Example.class, association = "association1", mode = FetchMode.JOIN),
@FetchProfile.FetchOverride(entity = Example.class, association = "association2", mode = FetchMode.JOIN) })
})
Das ist mein DAO ist:
@Autowired
private SessionFactory sessionFactory;
public Example getExample(Long id) {
sessionFactory.getCurrentSession().enableFetchProfile("example-profile");
return (Example) sessionFactory.getCurrentSession().get(Example.class, id);
}
Als ich getExample nennen, ich diese Ausnahme bekam:
org.hibernate .UnknownProfileException: Unbekanntes Abrufprofil [Beispielprofil]
Fehle ich Mapping oder etwas?