From d229534647d51b0c3ce35326ddc846158d99d494 Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Fri, 9 Sep 2016 10:31:45 +0300 Subject: [PATCH] Add test to replicate if JOINED inheritance ends up in a Cartesian Product --- .../discriminator}/InheritingEntity.java | 2 +- .../discriminator}/JoinedInheritanceTest.java | 2 +- .../discriminator}/ParentEntity.java | 2 +- ...istChildEntitiesWithDiscriminatorTest.java | 2 +- .../discriminator}/Polygon.java | 2 +- .../discriminator}/Quadrilateral.java | 2 +- .../JoinedSubclassWithEmbeddableTest.java | 2 +- .../SingleTableWithEmbeddableTest.java | 2 +- .../TablePerClassWithEmbeddableTest.java | 2 +- .../joinedsubclass/JoinedSubclassTest.java | 2 +- .../joinedsubclass/RootEntity.java | 2 +- .../joinedsubclass/SubEntity.java | 2 +- .../joinedsubclass/SubSubEntity.java | 2 +- .../joinedsubclass/SubSubSubEntity.java | 2 +- .../JoinedInheritanceWithOneToManyTest.java | 216 ++++++++++++++++++ 15 files changed, 230 insertions(+), 14 deletions(-) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/InheritingEntity.java (93%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/JoinedInheritanceTest.java (97%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/ParentEntity.java (94%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/PersistChildEntitiesWithDiscriminatorTest.java (96%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/Polygon.java (96%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/Quadrilateral.java (97%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/embeddable/JoinedSubclassWithEmbeddableTest.java (98%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/embeddable/SingleTableWithEmbeddableTest.java (98%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/embeddable/TablePerClassWithEmbeddableTest.java (98%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/joinedsubclass/JoinedSubclassTest.java (98%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/joinedsubclass/RootEntity.java (91%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/joinedsubclass/SubEntity.java (86%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/joinedsubclass/SubSubEntity.java (86%) rename hibernate-core/src/test/java/org/hibernate/test/{inheritancediscriminator => inheritance/discriminator}/joinedsubclass/SubSubSubEntity.java (86%) create mode 100644 hibernate-core/src/test/java/org/hibernate/test/inheritance/relationship/JoinedInheritanceWithOneToManyTest.java diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/InheritingEntity.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/InheritingEntity.java similarity index 93% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/InheritingEntity.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/InheritingEntity.java index e26a118312..4e015cb940 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/InheritingEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/InheritingEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator; +package org.hibernate.test.inheritance.discriminator; import javax.persistence.Column; import javax.persistence.DiscriminatorValue; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/JoinedInheritanceTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/JoinedInheritanceTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/JoinedInheritanceTest.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/JoinedInheritanceTest.java index 62d092f401..ecf8258f8b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/JoinedInheritanceTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/JoinedInheritanceTest.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.test.inheritancediscriminator; +package org.hibernate.test.inheritance.discriminator; import org.hibernate.Session; import org.hibernate.testing.TestForIssue; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/ParentEntity.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/ParentEntity.java similarity index 94% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/ParentEntity.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/ParentEntity.java index 18c430693f..26f770ac20 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/ParentEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/ParentEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator; +package org.hibernate.test.inheritance.discriminator; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/PersistChildEntitiesWithDiscriminatorTest.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/PersistChildEntitiesWithDiscriminatorTest.java index 86ddd3c51e..e17a004fe7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/PersistChildEntitiesWithDiscriminatorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/PersistChildEntitiesWithDiscriminatorTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator; +package org.hibernate.test.inheritance.discriminator; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/Polygon.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/Polygon.java similarity index 96% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/Polygon.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/Polygon.java index 6570620201..8698e99412 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/Polygon.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/Polygon.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.test.inheritancediscriminator; +package org.hibernate.test.inheritance.discriminator; import javax.persistence.DiscriminatorColumn; import javax.persistence.Entity; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/Quadrilateral.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/Quadrilateral.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/Quadrilateral.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/Quadrilateral.java index a69587b30c..3d78770f3f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/Quadrilateral.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/Quadrilateral.java @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ -package org.hibernate.test.inheritancediscriminator; +package org.hibernate.test.inheritance.discriminator; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/JoinedSubclassWithEmbeddableTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/JoinedSubclassWithEmbeddableTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/JoinedSubclassWithEmbeddableTest.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/JoinedSubclassWithEmbeddableTest.java index e2ad083fd3..dbfec79a09 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/JoinedSubclassWithEmbeddableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/JoinedSubclassWithEmbeddableTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.embeddable; +package org.hibernate.test.inheritance.discriminator.embeddable; import javax.persistence.CollectionTable; import javax.persistence.Embeddable; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/SingleTableWithEmbeddableTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/SingleTableWithEmbeddableTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/SingleTableWithEmbeddableTest.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/SingleTableWithEmbeddableTest.java index 750f679a95..3b3c36fbaf 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/SingleTableWithEmbeddableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/SingleTableWithEmbeddableTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.embeddable; +package org.hibernate.test.inheritance.discriminator.embeddable; import javax.persistence.CollectionTable; import javax.persistence.Embeddable; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/TablePerClassWithEmbeddableTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/TablePerClassWithEmbeddableTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/TablePerClassWithEmbeddableTest.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/TablePerClassWithEmbeddableTest.java index 59483792d5..560724bc20 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/embeddable/TablePerClassWithEmbeddableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/embeddable/TablePerClassWithEmbeddableTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.embeddable; +package org.hibernate.test.inheritance.discriminator.embeddable; import javax.persistence.CollectionTable; import javax.persistence.Embeddable; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/JoinedSubclassTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/JoinedSubclassTest.java similarity index 98% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/JoinedSubclassTest.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/JoinedSubclassTest.java index 1a43a9b466..c0e9726cbe 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/JoinedSubclassTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/JoinedSubclassTest.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.joinedsubclass; +package org.hibernate.test.inheritance.discriminator.joinedsubclass; import org.hibernate.Transaction; import org.hibernate.criterion.Restrictions; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/RootEntity.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/RootEntity.java similarity index 91% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/RootEntity.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/RootEntity.java index 8cc1efa6cd..6211731747 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/RootEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/RootEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.joinedsubclass; +package org.hibernate.test.inheritance.discriminator.joinedsubclass; import javax.persistence.DiscriminatorColumn; import javax.persistence.DiscriminatorValue; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubEntity.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubEntity.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubEntity.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubEntity.java index ae3dab7335..9d15f42e54 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.joinedsubclass; +package org.hibernate.test.inheritance.discriminator.joinedsubclass; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubSubEntity.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubSubEntity.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubSubEntity.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubSubEntity.java index deeb089e7c..57967fb59c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubSubEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubSubEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.joinedsubclass; +package org.hibernate.test.inheritance.discriminator.joinedsubclass; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubSubSubEntity.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubSubSubEntity.java similarity index 86% rename from hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubSubSubEntity.java rename to hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubSubSubEntity.java index 38cb382548..f2a561e115 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/inheritancediscriminator/joinedsubclass/SubSubSubEntity.java +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/discriminator/joinedsubclass/SubSubSubEntity.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.test.inheritancediscriminator.joinedsubclass; +package org.hibernate.test.inheritance.discriminator.joinedsubclass; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; diff --git a/hibernate-core/src/test/java/org/hibernate/test/inheritance/relationship/JoinedInheritanceWithOneToManyTest.java b/hibernate-core/src/test/java/org/hibernate/test/inheritance/relationship/JoinedInheritanceWithOneToManyTest.java new file mode 100644 index 0000000000..c59716694e --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/test/inheritance/relationship/JoinedInheritanceWithOneToManyTest.java @@ -0,0 +1,216 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.test.inheritance.relationship; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.MappedSuperclass; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; + +import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; +import org.hibernate.test.annotations.inheritance.singletable.Building; +import org.junit.Test; + +import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; +import static org.junit.Assert.assertEquals; + +/** + * @author Vlad Mihalcea + */ +public class JoinedInheritanceWithOneToManyTest extends BaseNonConfigCoreFunctionalTestCase { + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[] { + BuildingList.class, + BuildingListEntry.class, + BLEHome.class, + BLENonLiving.class, + }; + } + + @Test + public void test() { + doInHibernate( this::sessionFactory, session -> { + BuildingList buildingList = new BuildingList(); + buildingList.setName( "ABC" ); + session.persist( buildingList ); + + BLEHome home = new BLEHome(); + home.setHasCtv( 123 ); + home.setList( buildingList ); + buildingList.getEntries().add( home ); + session.persist( home ); + + BLENonLiving nonLiving = new BLENonLiving(); + nonLiving.setDelayed( true ); + nonLiving.setList( buildingList ); + buildingList.getEntries().add( nonLiving ); + session.persist( nonLiving ); + } ); + doInHibernate( this::sessionFactory, session -> { + List buildingLists = session.createQuery( "from BuildingList" ).getResultList(); + BuildingList buildingList = buildingLists.get( 0 ); + assertEquals(2, buildingList.getEntries().size()); + }); + } + + @MappedSuperclass + public static class DBObject { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq") + protected Integer id; + + @Temporal(TemporalType.TIMESTAMP) + protected Date correctDate; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Date getCorrectDate() { + return correctDate; + } + + public void setCorrectDate(Date correctDate) { + this.correctDate = correctDate; + } + } + + @Entity(name = "BuildingList") + @Inheritance(strategy = InheritanceType.JOINED) + @Table(name = "TB_BUILDING_LIST") + @SequenceGenerator(name = "seq", + sequenceName = "sq_building_list_id", + allocationSize = 1) + public static class BuildingList extends DBObject implements Serializable { + + @Column + private String name; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "list") + private Collection entries = new ArrayList<>(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Collection getEntries() { + return entries; + } + + public void setEntries(Collection entries) { + this.entries = entries; + } + } + + @Entity(name = "BuildingListEntry") + @Inheritance(strategy = InheritanceType.JOINED) + @Table(name = "TB_BUILDING_LIST_ENTRY") + @SequenceGenerator(name = "seq", + sequenceName = "sq_building_list_entry_id", + allocationSize = 1) + public static class BuildingListEntry extends DBObject implements Serializable { + + + @Column + protected String comments; + + @Column + protected Integer priority; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "list_id") + protected BuildingList list; + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public Integer getPriority() { + return priority; + } + + public void setPriority(Integer priority) { + this.priority = priority; + } + + public BuildingList getList() { + return list; + } + + public void setList(BuildingList list) { + this.list = list; + } + } + + @Entity(name = "BLEHome") + @Table(name = "TB_BLE_HOME") + public static class BLEHome extends BuildingListEntry { + + @Column(name = "has_ctv") + protected Integer hasCtv; + + public Integer getHasCtv() { + return hasCtv; + } + + public void setHasCtv(Integer hasCtv) { + this.hasCtv = hasCtv; + } + } + + @Entity(name = "BLENonLiving") + @Table(name = "TB_BLE_NONLIVING ") + public static class BLENonLiving extends BuildingListEntry { + + protected boolean delayed; + + public boolean isDelayed() { + return delayed; + } + + public void setDelayed(boolean delayed) { + this.delayed = delayed; + } + } +} +