From 3a67a7caa5af3f717485d505863ea1e579127e8d Mon Sep 17 00:00:00 2001 From: Kavoos Bojnourdi Date: Thu, 13 Aug 2015 21:28:24 +0200 Subject: [PATCH] Code cleanup --- projects/GDE_App/GDE-ejb/src/conf/persistence.xml | 1 + .../GDE-ejb/src/java/com/edf/gde/dao/AttributeDao.java | 10 +--------- .../src/java/com/edf/gde/entities/Attribute.java | 4 ---- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/projects/GDE_App/GDE-ejb/src/conf/persistence.xml b/projects/GDE_App/GDE-ejb/src/conf/persistence.xml index 775e749..b2b1d79 100644 --- a/projects/GDE_App/GDE-ejb/src/conf/persistence.xml +++ b/projects/GDE_App/GDE-ejb/src/conf/persistence.xml @@ -6,6 +6,7 @@ false + diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/AttributeDao.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/AttributeDao.java index 07f0b92..93aeab6 100644 --- a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/AttributeDao.java +++ b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/dao/AttributeDao.java @@ -16,7 +16,7 @@ import javax.persistence.EntityManager; */ public class AttributeDao { - private EntityManager em; + private final EntityManager em; public AttributeDao(EntityManager em) { this.em = em; @@ -26,14 +26,6 @@ public class AttributeDao { Attribute a = Attribute.fromAttributeTO(em,ato); em.persist(a); em.flush(); - /* - if (a.getAttributeGroup()!= null) { - Query q = em.createNativeQuery("INSERT INTO attribute_group_attribute (attributeCollection_id,attribute_id) values (?,?)"); - q.setParameter(1, a.getAttributeGroup().getId()); - q.setParameter(2, a.getId()); - q.executeUpdate(); - } - */ return a.toAttributeTO(); } diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Attribute.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Attribute.java index 8b3f599..27325b8 100644 --- a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Attribute.java +++ b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Attribute.java @@ -60,10 +60,6 @@ public class Attribute implements Serializable { private String value; @Column(name = "mandatory") private Boolean mandatory; - /* - @Column(name = "attribute_group_id") - private long attributeGroupId; - */ @ManyToOne(optional = true) @JoinColumn(name = "attribute_group_id", referencedColumnName = "id") private AttributeGroup attributeGroup; -- 2.39.2