From d8b28040a9c8330db974641737769ff923662b33 Mon Sep 17 00:00:00 2001 From: Markus Kreth Date: Mon, 6 Apr 2020 22:23:13 +0200 Subject: [PATCH] Test Hibernate configuration fixed, searching for Entity Annotation --- .../vaadin/clubhelper/AbstractHibernateConfiguration.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/kreth/vaadin/clubhelper/AbstractHibernateConfiguration.java b/src/test/java/de/kreth/vaadin/clubhelper/AbstractHibernateConfiguration.java index a0ae9cf..f9cac20 100644 --- a/src/test/java/de/kreth/vaadin/clubhelper/AbstractHibernateConfiguration.java +++ b/src/test/java/de/kreth/vaadin/clubhelper/AbstractHibernateConfiguration.java @@ -4,12 +4,14 @@ import java.io.InputStream; import java.util.HashSet; import java.util.Set; +import javax.persistence.Entity; + import org.hibernate.cfg.Configuration; import org.reflections.Reflections; -import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.BaseEntity; import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubeventHasPerson; import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.CompetitionType; +import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.PersonNote; public abstract class AbstractHibernateConfiguration implements HibernateConfiguration { @@ -17,9 +19,11 @@ public abstract class AbstractHibernateConfiguration implements HibernateConfigu public AbstractHibernateConfiguration() { Reflections reflections = new Reflections("de.kreth.vaadin.clubhelper.vaadinclubhelper.data"); - entityClasses = new HashSet<>(reflections.getSubTypesOf(BaseEntity.class)); + entityClasses = new HashSet<>(reflections.getTypesAnnotatedWith(Entity.class)); entityClasses.add(ClubeventHasPerson.class); entityClasses.add(CompetitionType.class); + entityClasses.add(PersonNote.class); + } @Override