diff --git a/project/server_core/src/main/java/dao/HibernateDao.java b/project/server_core/src/main/java/dao/HibernateDao.java index a4913d1..7bde7c0 100644 --- a/project/server_core/src/main/java/dao/HibernateDao.java +++ b/project/server_core/src/main/java/dao/HibernateDao.java @@ -127,11 +127,11 @@ public class HibernateDao { return internal_getData(AccessPoint.class); } - public boolean saveMap(final Mape mape){return internal_saveData(mape);} - public Mape getMap(int mapId){ + public boolean saveMap(final Map map){return internal_saveData(map);} + public Map getMap(int mapId){ TransactionCallBack callBack = execTransactionProcess((session)->{ TransactionCallBack reply = new TransactionCallBack(); - Query query = session.createQuery("from Mape m where m.id = :id"); + Query query = session.createQuery("from Map m where m.id = :id"); query.setParameter("id", mapId); List results = query.list(); for(Object result : results){ @@ -140,7 +140,7 @@ public class HibernateDao { } return reply; }); - return (callBack.getResults().isEmpty()?null:(Mape)callBack.getResults().get(0)); + return (callBack.getResults().isEmpty()?null:(Map)callBack.getResults().get(0)); } private interface ITransactionProcess{ diff --git a/project/server_core/src/main/java/repository/Location.java b/project/server_core/src/main/java/repository/Location.java index 5e03d99..1a43c75 100644 --- a/project/server_core/src/main/java/repository/Location.java +++ b/project/server_core/src/main/java/repository/Location.java @@ -15,7 +15,7 @@ public class Location implements Serializable { @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "id", nullable = false) - private Mape mape; + private Map map; public Location () { } @@ -40,11 +40,11 @@ public class Location implements Serializable { this.y = y; } - public Mape getMape () { - return mape; + public Map getMap() { + return map; } - public void setMape (final Mape mape) { - this.mape = mape; + public void setMap(final Map map) { + this.map = map; } } diff --git a/project/server_core/src/main/java/repository/Map.java b/project/server_core/src/main/java/repository/Map.java new file mode 100644 index 0000000..42d1486 --- /dev/null +++ b/project/server_core/src/main/java/repository/Map.java @@ -0,0 +1,68 @@ +package repository; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * Created by Guillaume on 09/05/2017. + */ +@Entity +@Table(name = "MAP") +public class Map implements Serializable{ + @Id @GeneratedValue + private int id; + private Integer px_width, px_height; + private Byte[] content; + private Double m_width, m_height; + + public Map() { + } + + public Integer getId () { + return id; + } + + public void setId (final Integer id) { + this.id = id; + } + + public Integer getPx_width () { + return px_width; + } + + public void setPx_width (final Integer px_width) { + this.px_width = px_width; + } + + public Integer getPx_height () { + return px_height; + } + + public void setPx_height (final Integer px_height) { + this.px_height = px_height; + } + + public Byte[] getContent () { + return content; + } + + public void setContent (final Byte[] content) { + this.content = content; + } + + public Double getM_width () { + return m_width; + } + + public void setM_width (final Double m_width) { + this.m_width = m_width; + } + + public Double getM_height () { + return m_height; + } + + public void setM_height (final Double m_height) { + this.m_height = m_height; + } +} diff --git a/project/server_core/src/main/java/repository/Mape.java b/project/server_core/src/main/java/repository/Mape.java deleted file mode 100644 index 1f22912..0000000 --- a/project/server_core/src/main/java/repository/Mape.java +++ /dev/null @@ -1,77 +0,0 @@ -package repository; - -import javax.persistence.*; -import java.io.Serializable; - -/** - * Created by Guillaume on 09/05/2017. - */ -@Entity -@Table(name = "MAPE") -public class Mape implements Serializable{ - @Id @GeneratedValue - private Integer id; - private Integer px_width, px_height; - private Byte[] content; - private String desc; - private Double m_width, m_height; - - public Mape () { - } - - public Integer getId () { - return id; - } - - public void setId (final Integer id) { - this.id = id; - } - - public Integer getPx_width () { - return px_width; - } - - public void setPx_width (final Integer px_width) { - this.px_width = px_width; - } - - public Integer getPx_height () { - return px_height; - } - - public void setPx_height (final Integer px_height) { - this.px_height = px_height; - } - - public Byte[] getContent () { - return content; - } - - public void setContent (final Byte[] content) { - this.content = content; - } - - public String getDesc () { - return desc; - } - - public void setDesc (final String desc) { - this.desc = desc; - } - - public Double getM_width () { - return m_width; - } - - public void setM_width (final Double m_width) { - this.m_width = m_width; - } - - public Double getM_height () { - return m_height; - } - - public void setM_height (final Double m_height) { - this.m_height = m_height; - } -} -- libgit2 0.21.4