First Commit - Source Code from Reply
This commit is contained in:
11
dbcm/dbcm-dao/src/main/java/dbcm/dao/EsitoAttCessDao.java
Normal file
11
dbcm/dbcm-dao/src/main/java/dbcm/dao/EsitoAttCessDao.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import dbcm.entity.EsitoAttCessEntity;
|
||||
|
||||
public class EsitoAttCessDao extends GenericDaoImpl<EsitoAttCessEntity, Long> {
|
||||
|
||||
public EsitoAttCessDao() {
|
||||
super(EsitoAttCessEntity.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import dbcm.entity.EsitoAttCessScartiEntity;
|
||||
|
||||
public class EsitoAttCessScartiDao extends GenericDaoImpl<EsitoAttCessScartiEntity, Long> {
|
||||
|
||||
public EsitoAttCessScartiDao() {
|
||||
super(EsitoAttCessScartiEntity.class);
|
||||
}
|
||||
|
||||
}
|
||||
15
dbcm/dbcm-dao/src/main/java/dbcm/dao/GenericDao.java
Normal file
15
dbcm/dbcm-dao/src/main/java/dbcm/dao/GenericDao.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.criterion.Criterion;
|
||||
|
||||
public interface GenericDao<ClassType, IdType> {
|
||||
public IdType save(ClassType obj);
|
||||
public void merge(ClassType obj);
|
||||
public void delete(ClassType obj);
|
||||
public ClassType findById(long id);
|
||||
public List<ClassType> findByCriteria(List<Criterion> criterion);
|
||||
public List<ClassType> findByCriteria(List<Criterion> criterion, Map<String, Boolean> orderByList);
|
||||
}
|
||||
143
dbcm/dbcm-dao/src/main/java/dbcm/dao/GenericDaoImpl.java
Normal file
143
dbcm/dbcm-dao/src/main/java/dbcm/dao/GenericDaoImpl.java
Normal file
@@ -0,0 +1,143 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernate.criterion.Order;
|
||||
|
||||
import dbcm.utils.HibernateUtil;
|
||||
|
||||
public class GenericDaoImpl<ClassType, IdType> implements GenericDao<ClassType, IdType> {
|
||||
private Class<ClassType> type;
|
||||
|
||||
public GenericDaoImpl(Class<ClassType> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public IdType save(ClassType obj) {
|
||||
Transaction tx = null;
|
||||
IdType ret = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
ret = (IdType) session.save(obj);
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void merge(ClassType obj) {
|
||||
Transaction tx = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
session.merge(obj);
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(ClassType obj) {
|
||||
Transaction tx = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
session.delete(obj);
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public ClassType findById(long id) {
|
||||
Transaction tx = null;
|
||||
ClassType ret = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
ret = (ClassType) session.get(type, id);
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClassType> findByCriteria(List<Criterion> criterion) {
|
||||
return findByCriteria(criterion, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<ClassType> findByCriteria(List<Criterion> criterion, Map<String, Boolean> orderByList) {
|
||||
List<ClassType> results = new ArrayList<ClassType>();
|
||||
Transaction tx = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
Criteria criteria = session.createCriteria(type);
|
||||
for (Criterion crit : criterion) {
|
||||
criteria.add(crit);
|
||||
}
|
||||
if (orderByList != null) {
|
||||
Set<String> orderByListKeys = orderByList.keySet();
|
||||
for (String key : orderByListKeys) {
|
||||
Boolean descOrder = orderByList.get(key);
|
||||
if (descOrder) {
|
||||
criteria.addOrder(Order.desc(key));
|
||||
} else {
|
||||
criteria.addOrder(Order.asc(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
results = criteria.list();
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
try {
|
||||
return HibernateUtil.getSession();
|
||||
} catch (RuntimeException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private void commitTransaction(Transaction tx) {
|
||||
tx.commit();
|
||||
}
|
||||
|
||||
private void rollbackTransaction(Transaction tx) {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
private Transaction startTransaction(Session session) {
|
||||
return session.beginTransaction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
|
||||
import dbcm.entity.GestioneRichiestaEntity;
|
||||
import dbcm.utils.HibernateUtil;
|
||||
|
||||
public class GestioneRichiestaDao {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<GestioneRichiestaEntity> findByCriteria(List<Criterion> criterion) {
|
||||
List<GestioneRichiestaEntity> results = new ArrayList<GestioneRichiestaEntity>();
|
||||
Transaction tx = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
Criteria criteria = session.createCriteria(GestioneRichiestaEntity.class);
|
||||
for (Criterion crit : criterion) {
|
||||
criteria.add(crit);
|
||||
}
|
||||
results = criteria.list();
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
try {
|
||||
return HibernateUtil.getSession();
|
||||
} catch (RuntimeException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private void commitTransaction(Transaction tx) {
|
||||
tx.commit();
|
||||
}
|
||||
|
||||
private void rollbackTransaction(Transaction tx) {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
private Transaction startTransaction(Session session) {
|
||||
return session.beginTransaction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
|
||||
import dbcm.entity.GestioneRichiestaRecEntity;
|
||||
import dbcm.utils.HibernateUtil;
|
||||
|
||||
public class GestioneRichiestaRecDao {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<GestioneRichiestaRecEntity> findByCriteria(List<Criterion> criterion) {
|
||||
List<GestioneRichiestaRecEntity> results = new ArrayList<GestioneRichiestaRecEntity>();
|
||||
Transaction tx = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
Criteria criteria = session.createCriteria(GestioneRichiestaRecEntity.class);
|
||||
for (Criterion crit : criterion) {
|
||||
criteria.add(crit);
|
||||
}
|
||||
results = criteria.list();
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
try {
|
||||
return HibernateUtil.getSession();
|
||||
} catch (RuntimeException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private void commitTransaction(Transaction tx) {
|
||||
tx.commit();
|
||||
}
|
||||
|
||||
private void rollbackTransaction(Transaction tx) {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
private Transaction startTransaction(Session session) {
|
||||
return session.beginTransaction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package dbcm.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
|
||||
import dbcm.entity.ViewEsitoAttCessElabEntity;
|
||||
import dbcm.utils.HibernateUtil;
|
||||
|
||||
public class ViewEsitoAttCessElabDao {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ViewEsitoAttCessElabEntity> findAll() {
|
||||
Transaction tx = null;
|
||||
List<ViewEsitoAttCessElabEntity> results = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
String sqlQuery = "SELECT * FROM MNP_VIEW_ESITO_ATT_CESS_ELAB ";
|
||||
SQLQuery query = getSession().createSQLQuery(sqlQuery).addEntity(ViewEsitoAttCessElabEntity.class);
|
||||
results = query.list();
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<ViewEsitoAttCessElabEntity> findByCriteria(List<Criterion> criterion) {
|
||||
List<ViewEsitoAttCessElabEntity> results = new ArrayList<ViewEsitoAttCessElabEntity>();
|
||||
Transaction tx = null;
|
||||
try {
|
||||
Session session = getSession();
|
||||
tx = startTransaction(session);
|
||||
Criteria criteria = session.createCriteria(ViewEsitoAttCessElabEntity.class);
|
||||
for (Criterion crit : criterion) {
|
||||
criteria.add(crit);
|
||||
}
|
||||
results = criteria.list();
|
||||
commitTransaction(tx);
|
||||
} catch (RuntimeException ex) {
|
||||
rollbackTransaction(tx);
|
||||
throw ex;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
try {
|
||||
return HibernateUtil.getSession();
|
||||
} catch (RuntimeException ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private void commitTransaction(Transaction tx) {
|
||||
tx.commit();
|
||||
}
|
||||
|
||||
private void rollbackTransaction(Transaction tx) {
|
||||
if (tx != null) {
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
private Transaction startTransaction(Session session) {
|
||||
return session.beginTransaction();
|
||||
}
|
||||
}
|
||||
172
dbcm/dbcm-dao/src/main/java/dbcm/entity/EsitoAttCessEntity.java
Normal file
172
dbcm/dbcm-dao/src/main/java/dbcm/entity/EsitoAttCessEntity.java
Normal file
@@ -0,0 +1,172 @@
|
||||
package dbcm.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MNP_ESITO_ATT_CESS")
|
||||
public class EsitoAttCessEntity {
|
||||
@Id
|
||||
@Column(name = "unique_id")
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "c_generator")
|
||||
@SequenceGenerator(name = "c_generator", sequenceName = "SEQ_MNP_ESITO_ATT_CESS", allocationSize = 1)
|
||||
private Long uniqueId;
|
||||
|
||||
@Column(name = "id_richiesta", length = 23)
|
||||
private String idRichiesta;
|
||||
|
||||
@Column(name = "msisdn", length = 15, nullable = false)
|
||||
private String msisdn;
|
||||
|
||||
@Column(name = "identificativo_richiesta", length = 23)
|
||||
private String identificativoRichiesta;
|
||||
|
||||
@Column(name = "tipo_richiesta", length = 1, nullable = false)
|
||||
private String tipoRichiesta;
|
||||
|
||||
@Column(name = "data_espletamento", nullable = false)
|
||||
private Date dataEspletamento;
|
||||
|
||||
@Column(name = "tipo_linea", length = 15)
|
||||
private String tipoLinea;
|
||||
|
||||
@Column(name = "rgn", length = 3)
|
||||
private String rgn;
|
||||
|
||||
@Column(name = "imsi", length = 15)
|
||||
private String imsi;
|
||||
|
||||
@Column(name = "sistema_chiamante", length = 15, nullable = false)
|
||||
private String sistemaChiamante;
|
||||
|
||||
@Column(name = "sistema_chiamante_sec", length = 15, nullable = true)
|
||||
private String sistemaChiamanteSec;
|
||||
|
||||
@Column(name = "data_ricezione_gisp")
|
||||
private Date dataRicezioneGisp;
|
||||
|
||||
@Column(name = "data_ricezione_web")
|
||||
private Date dataRicezioneWeb;
|
||||
|
||||
@Column(name = "data_elaborazione")
|
||||
private Date dataElaborazione;
|
||||
|
||||
public Long getUniqueId() {
|
||||
return uniqueId;
|
||||
}
|
||||
|
||||
public void setUniqueId(Long uniqueId) {
|
||||
this.uniqueId = uniqueId;
|
||||
}
|
||||
|
||||
public String getIdRichiesta() {
|
||||
return idRichiesta;
|
||||
}
|
||||
|
||||
public void setIdRichiesta(String idRichiesta) {
|
||||
this.idRichiesta = idRichiesta;
|
||||
}
|
||||
|
||||
public String getMsisdn() {
|
||||
return msisdn;
|
||||
}
|
||||
|
||||
public void setMsisdn(String msisdn) {
|
||||
this.msisdn = msisdn;
|
||||
}
|
||||
|
||||
public String getIdentificativoRichiesta() {
|
||||
return identificativoRichiesta;
|
||||
}
|
||||
|
||||
public void setIdentificativoRichiesta(String identificativoRichiesta) {
|
||||
this.identificativoRichiesta = identificativoRichiesta;
|
||||
}
|
||||
|
||||
public String getTipoRichiesta() {
|
||||
return tipoRichiesta;
|
||||
}
|
||||
|
||||
public void setTipoRichiesta(String tipoRichiesta) {
|
||||
this.tipoRichiesta = tipoRichiesta;
|
||||
}
|
||||
|
||||
public Date getDataEspletamento() {
|
||||
return dataEspletamento;
|
||||
}
|
||||
|
||||
public void setDataEspletamento(Date dataEspletamento) {
|
||||
this.dataEspletamento = dataEspletamento;
|
||||
}
|
||||
|
||||
public String getTipoLinea() {
|
||||
return tipoLinea;
|
||||
}
|
||||
|
||||
public void setTipoLinea(String tipoLinea) {
|
||||
this.tipoLinea = tipoLinea;
|
||||
}
|
||||
|
||||
public String getRgn() {
|
||||
return rgn;
|
||||
}
|
||||
|
||||
public void setRgn(String rgn) {
|
||||
this.rgn = rgn;
|
||||
}
|
||||
|
||||
public String getImsi() {
|
||||
return imsi;
|
||||
}
|
||||
|
||||
public void setImsi(String imsi) {
|
||||
this.imsi = imsi;
|
||||
}
|
||||
|
||||
public String getSistemaChiamante() {
|
||||
return sistemaChiamante;
|
||||
}
|
||||
|
||||
public void setSistemaChiamante(String sistemaChiamante) {
|
||||
this.sistemaChiamante = sistemaChiamante;
|
||||
}
|
||||
|
||||
public String getSistemaChiamanteSec() {
|
||||
return sistemaChiamanteSec;
|
||||
}
|
||||
|
||||
public void setSistemaChiamanteSec(String sistemaChiamanteSec) {
|
||||
this.sistemaChiamanteSec = sistemaChiamanteSec;
|
||||
}
|
||||
|
||||
public Date getDataRicezioneGisp() {
|
||||
return dataRicezioneGisp;
|
||||
}
|
||||
|
||||
public void setDataRicezioneGisp(Date dataRicezioneGisp) {
|
||||
this.dataRicezioneGisp = dataRicezioneGisp;
|
||||
}
|
||||
|
||||
public Date getDataRicezioneWeb() {
|
||||
return dataRicezioneWeb;
|
||||
}
|
||||
|
||||
public void setDataRicezioneWeb(Date dataRicezioneWeb) {
|
||||
this.dataRicezioneWeb = dataRicezioneWeb;
|
||||
}
|
||||
|
||||
public Date getDataElaborazione() {
|
||||
return dataElaborazione;
|
||||
}
|
||||
|
||||
public void setDataElaborazione(Date dataElaborazione) {
|
||||
this.dataElaborazione = dataElaborazione;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package dbcm.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MNP_ESITO_ATT_CESS_SCARTI")
|
||||
public class EsitoAttCessScartiEntity {
|
||||
@Id
|
||||
@Column(name = "unique_id")
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "c_generator")
|
||||
@SequenceGenerator(name = "c_generator", sequenceName = "SEQ_MNP_ESITO_ATT_CESS_SCARTI", allocationSize = 1)
|
||||
private Long uniqueId;
|
||||
|
||||
@Column(name = "id_richiesta", length = 23)
|
||||
private String idRichiesta;
|
||||
|
||||
@Column(name = "msisdn", length = 15, nullable = false)
|
||||
private String msisdn;
|
||||
|
||||
@Column(name = "identificativo_richiesta", length = 23)
|
||||
private String identificativoRichiesta;
|
||||
|
||||
@Column(name = "tipo_richiesta", length = 1, nullable = false)
|
||||
private String tipoRichiesta;
|
||||
|
||||
@Column(name = "data_espletamento", nullable = false)
|
||||
private Date dataEspletamento;
|
||||
|
||||
@Column(name = "tipo_linea", length = 15)
|
||||
private String tipoLinea;
|
||||
|
||||
@Column(name = "rgn", length = 3)
|
||||
private String rgn;
|
||||
|
||||
@Column(name = "imsi", length = 15)
|
||||
private String imsi;
|
||||
|
||||
@Column(name = "sistema_chiamante", length = 15, nullable = false)
|
||||
private String sistemaChiamante;
|
||||
|
||||
@Column(name = "sistema_chiamante_sec", length = 15, nullable = true)
|
||||
private String sistemaChiamanteSec;
|
||||
|
||||
@Column(name = "data_ricezione_gisp")
|
||||
private Date dataRicezioneGisp;
|
||||
|
||||
@Column(name = "data_ricezione_web")
|
||||
private Date dataRicezioneWeb;
|
||||
|
||||
@Column(name = "data_elaborazione")
|
||||
private Date dataElaborazione;
|
||||
|
||||
public Long getUniqueId() {
|
||||
return uniqueId;
|
||||
}
|
||||
|
||||
public void setUniqueId(Long uniqueId) {
|
||||
this.uniqueId = uniqueId;
|
||||
}
|
||||
|
||||
public String getIdRichiesta() {
|
||||
return idRichiesta;
|
||||
}
|
||||
|
||||
public void setIdRichiesta(String idRichiesta) {
|
||||
this.idRichiesta = idRichiesta;
|
||||
}
|
||||
|
||||
public String getMsisdn() {
|
||||
return msisdn;
|
||||
}
|
||||
|
||||
public void setMsisdn(String msisdn) {
|
||||
this.msisdn = msisdn;
|
||||
}
|
||||
|
||||
public String getIdentificativoRichiesta() {
|
||||
return identificativoRichiesta;
|
||||
}
|
||||
|
||||
public void setIdentificativoRichiesta(String identificativoRichiesta) {
|
||||
this.identificativoRichiesta = identificativoRichiesta;
|
||||
}
|
||||
|
||||
public String getTipoRichiesta() {
|
||||
return tipoRichiesta;
|
||||
}
|
||||
|
||||
public void setTipoRichiesta(String tipoRichiesta) {
|
||||
this.tipoRichiesta = tipoRichiesta;
|
||||
}
|
||||
|
||||
public Date getDataEspletamento() {
|
||||
return dataEspletamento;
|
||||
}
|
||||
|
||||
public void setDataEspletamento(Date dataEspletamento) {
|
||||
this.dataEspletamento = dataEspletamento;
|
||||
}
|
||||
|
||||
public String getTipoLinea() {
|
||||
return tipoLinea;
|
||||
}
|
||||
|
||||
public void setTipoLinea(String tipoLinea) {
|
||||
this.tipoLinea = tipoLinea;
|
||||
}
|
||||
|
||||
public String getRgn() {
|
||||
return rgn;
|
||||
}
|
||||
|
||||
public void setRgn(String rgn) {
|
||||
this.rgn = rgn;
|
||||
}
|
||||
|
||||
public String getImsi() {
|
||||
return imsi;
|
||||
}
|
||||
|
||||
public void setImsi(String imsi) {
|
||||
this.imsi = imsi;
|
||||
}
|
||||
|
||||
public String getSistemaChiamante() {
|
||||
return sistemaChiamante;
|
||||
}
|
||||
|
||||
public void setSistemaChiamante(String sistemaChiamante) {
|
||||
this.sistemaChiamante = sistemaChiamante;
|
||||
}
|
||||
|
||||
public String getSistemaChiamanteSec() {
|
||||
return sistemaChiamanteSec;
|
||||
}
|
||||
|
||||
public void setSistemaChiamanteSec(String sistemaChiamanteSec) {
|
||||
this.sistemaChiamanteSec = sistemaChiamanteSec;
|
||||
}
|
||||
|
||||
public Date getDataRicezioneGisp() {
|
||||
return dataRicezioneGisp;
|
||||
}
|
||||
|
||||
public void setDataRicezioneGisp(Date dataRicezioneGisp) {
|
||||
this.dataRicezioneGisp = dataRicezioneGisp;
|
||||
}
|
||||
|
||||
public Date getDataRicezioneWeb() {
|
||||
return dataRicezioneWeb;
|
||||
}
|
||||
|
||||
public void setDataRicezioneWeb(Date dataRicezioneWeb) {
|
||||
this.dataRicezioneWeb = dataRicezioneWeb;
|
||||
}
|
||||
|
||||
public Date getDataElaborazione() {
|
||||
return dataElaborazione;
|
||||
}
|
||||
|
||||
public void setDataElaborazione(Date dataElaborazione) {
|
||||
this.dataElaborazione = dataElaborazione;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package dbcm.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MNP_GESTIONE_RICHIESTA")
|
||||
public class GestioneRichiestaEntity {
|
||||
@Id
|
||||
@Column(name = "id_richiesta")
|
||||
private String idRichiesta;
|
||||
|
||||
@Column(name = "msisdn")
|
||||
private String msisdn;
|
||||
|
||||
@Column(name = "data_cut_over_calc")
|
||||
private Date dataCutOverCalc;
|
||||
|
||||
@Column(name = "stato")
|
||||
private Long stato;
|
||||
|
||||
public String getIdRichiesta() {
|
||||
return idRichiesta;
|
||||
}
|
||||
|
||||
public void setIdRichiesta(String idRichiesta) {
|
||||
this.idRichiesta = idRichiesta;
|
||||
}
|
||||
|
||||
public String getMsisdn() {
|
||||
return msisdn;
|
||||
}
|
||||
|
||||
public void setMsisdn(String msisdn) {
|
||||
this.msisdn = msisdn;
|
||||
}
|
||||
|
||||
public Date getDataCutOverCalc() {
|
||||
return dataCutOverCalc;
|
||||
}
|
||||
|
||||
public void setDataCutOverCalc(Date dataCutOverCalc) {
|
||||
this.dataCutOverCalc = dataCutOverCalc;
|
||||
}
|
||||
|
||||
public Long getStato() {
|
||||
return stato;
|
||||
}
|
||||
|
||||
public void setStato(Long stato) {
|
||||
this.stato = stato;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package dbcm.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MNP_GESTIONE_RICHIESTA_REC")
|
||||
public class GestioneRichiestaRecEntity {
|
||||
@Id
|
||||
@Column(name = "id_richiesta")
|
||||
private String idRichiesta;
|
||||
|
||||
@Column(name = "msisdn")
|
||||
private String msisdn;
|
||||
|
||||
@Column(name = "data_cut_over_aom")
|
||||
private Date dataCutOverAom;
|
||||
|
||||
@Column(name = "stato")
|
||||
private Long stato;
|
||||
|
||||
@Column(name = "espletamentomss")
|
||||
private Long espletamentomss;
|
||||
|
||||
public String getIdRichiesta() {
|
||||
return idRichiesta;
|
||||
}
|
||||
|
||||
public void setIdRichiesta(String idRichiesta) {
|
||||
this.idRichiesta = idRichiesta;
|
||||
}
|
||||
|
||||
public String getMsisdn() {
|
||||
return msisdn;
|
||||
}
|
||||
|
||||
public void setMsisdn(String msisdn) {
|
||||
this.msisdn = msisdn;
|
||||
}
|
||||
|
||||
public Date getDataCutOverAom() {
|
||||
return dataCutOverAom;
|
||||
}
|
||||
|
||||
public void setDataCutOverAom(Date dataCutOverAom) {
|
||||
this.dataCutOverAom = dataCutOverAom;
|
||||
}
|
||||
|
||||
public Long getStato() {
|
||||
return stato;
|
||||
}
|
||||
|
||||
public void setStato(Long stato) {
|
||||
this.stato = stato;
|
||||
}
|
||||
|
||||
public Long getEspletamentomss() {
|
||||
return espletamentomss;
|
||||
}
|
||||
|
||||
public void setEspletamentomss(Long espletamentomss) {
|
||||
this.espletamentomss = espletamentomss;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package dbcm.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MNP_VIEW_ESITO_ATT_CESS_ELAB")
|
||||
public class ViewEsitoAttCessElabEntity {
|
||||
@Id
|
||||
@Column(name = "unique_id")
|
||||
private Long uniqueId;
|
||||
|
||||
@Column(name = "id_richiesta")
|
||||
private String idRichiesta;
|
||||
|
||||
@Column(name = "identificativo_richiesta")
|
||||
private String identificativoRichiesta;
|
||||
|
||||
@Column(name = "msisdn")
|
||||
private String msisdn;
|
||||
|
||||
@Column(name = "tipo_richiesta")
|
||||
private String tipoRichiesta;
|
||||
|
||||
@Column(name = "data_espletamento")
|
||||
private Date dataEspletamento;
|
||||
|
||||
@Column(name = "tipo_linea")
|
||||
private String tipoLinea;
|
||||
|
||||
@Column(name = "rgn")
|
||||
private String rgn;
|
||||
|
||||
@Column(name = "imsi")
|
||||
private String imsi;
|
||||
|
||||
@Column(name = "sistema_chiamante")
|
||||
private String sistemaChiamante;
|
||||
|
||||
@Column(name = "sistema_chiamante_sec")
|
||||
private String sistemaChiamanteSec;
|
||||
|
||||
@Column(name = "data_ricezione_gisp")
|
||||
private Date dataRicezioneGisp;
|
||||
|
||||
@Column(name = "data_ricezione_web")
|
||||
private Date dataRicezioneWeb;
|
||||
|
||||
@Column(name = "data_elaborazione")
|
||||
private Date dataElaborazione;
|
||||
|
||||
public Long getUniqueId() {
|
||||
return uniqueId;
|
||||
}
|
||||
|
||||
public void setUniqueId(Long uniqueId) {
|
||||
this.uniqueId = uniqueId;
|
||||
}
|
||||
|
||||
public String getIdRichiesta() {
|
||||
return idRichiesta;
|
||||
}
|
||||
|
||||
public void setIdRichiesta(String idRichiesta) {
|
||||
this.idRichiesta = idRichiesta;
|
||||
}
|
||||
|
||||
public String getIdentificativoRichiesta() {
|
||||
return identificativoRichiesta;
|
||||
}
|
||||
|
||||
public void setIdentificativoRichiesta(String identificativoRichiesta) {
|
||||
this.identificativoRichiesta = identificativoRichiesta;
|
||||
}
|
||||
|
||||
public String getMsisdn() {
|
||||
return msisdn;
|
||||
}
|
||||
|
||||
public void setMsisdn(String msisdn) {
|
||||
this.msisdn = msisdn;
|
||||
}
|
||||
|
||||
public String getTipoRichiesta() {
|
||||
return tipoRichiesta;
|
||||
}
|
||||
|
||||
public void setTipoRichiesta(String tipoRichiesta) {
|
||||
this.tipoRichiesta = tipoRichiesta;
|
||||
}
|
||||
|
||||
public Date getDataEspletamento() {
|
||||
return dataEspletamento;
|
||||
}
|
||||
|
||||
public void setDataEspletamento(Date dataEspletamento) {
|
||||
this.dataEspletamento = dataEspletamento;
|
||||
}
|
||||
|
||||
public String getTipoLinea() {
|
||||
return tipoLinea;
|
||||
}
|
||||
|
||||
public void setTipoLinea(String tipoLinea) {
|
||||
this.tipoLinea = tipoLinea;
|
||||
}
|
||||
|
||||
public String getRgn() {
|
||||
return rgn;
|
||||
}
|
||||
|
||||
public void setRgn(String rgn) {
|
||||
this.rgn = rgn;
|
||||
}
|
||||
|
||||
public String getImsi() {
|
||||
return imsi;
|
||||
}
|
||||
|
||||
public void setImsi(String imsi) {
|
||||
this.imsi = imsi;
|
||||
}
|
||||
|
||||
public String getSistemaChiamante() {
|
||||
return sistemaChiamante;
|
||||
}
|
||||
|
||||
public void setSistemaChiamante(String sistemaChiamante) {
|
||||
this.sistemaChiamante = sistemaChiamante;
|
||||
}
|
||||
|
||||
public String getSistemaChiamanteSec() {
|
||||
return sistemaChiamanteSec;
|
||||
}
|
||||
|
||||
public void setSistemaChiamanteSec(String sistemaChiamanteSec) {
|
||||
this.sistemaChiamanteSec = sistemaChiamanteSec;
|
||||
}
|
||||
|
||||
public Date getDataRicezioneGisp() {
|
||||
return dataRicezioneGisp;
|
||||
}
|
||||
|
||||
public void setDataRicezioneGisp(Date dataRicezioneGisp) {
|
||||
this.dataRicezioneGisp = dataRicezioneGisp;
|
||||
}
|
||||
|
||||
public Date getDataRicezioneWeb() {
|
||||
return dataRicezioneWeb;
|
||||
}
|
||||
|
||||
public void setDataRicezioneWeb(Date dataRicezioneWeb) {
|
||||
this.dataRicezioneWeb = dataRicezioneWeb;
|
||||
}
|
||||
|
||||
public Date getDataElaborazione() {
|
||||
return dataElaborazione;
|
||||
}
|
||||
|
||||
public void setDataElaborazione(Date dataElaborazione) {
|
||||
this.dataElaborazione = dataElaborazione;
|
||||
}
|
||||
}
|
||||
38
dbcm/dbcm-dao/src/main/java/dbcm/utils/HibernateUtil.java
Normal file
38
dbcm/dbcm-dao/src/main/java/dbcm/utils/HibernateUtil.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package dbcm.utils;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
|
||||
public class HibernateUtil {
|
||||
private static final SessionFactory sessionFactory;
|
||||
|
||||
static {
|
||||
try {
|
||||
System.err.println("Create the SessionFactory dbcm from hibernate.cfg.xml ");
|
||||
|
||||
// Create the SessionFactory from hibernate.cfg.xml
|
||||
sessionFactory = new Configuration().configure().buildSessionFactory();
|
||||
} catch (Throwable ex) {
|
||||
// Make sure you log the exception, as it might be swallowed
|
||||
System.err.println("Initial SessionFactory creation failed." + ex.toString());
|
||||
System.err.println("Initial SessionFactory creation failed." + ex.getStackTrace().toString());
|
||||
|
||||
throw new ExceptionInInitializerError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static SessionFactory getSessionFactory() {
|
||||
return sessionFactory;
|
||||
}
|
||||
|
||||
public static Session getSession() {
|
||||
return sessionFactory.getCurrentSession();
|
||||
}
|
||||
|
||||
public static void shutdown() {
|
||||
// Close caches and connection pools
|
||||
getSessionFactory().close();
|
||||
}
|
||||
|
||||
}
|
||||
26
dbcm/dbcm-dao/src/main/resources/hibernate.cfg.xml
Normal file
26
dbcm/dbcm-dao/src/main/resources/hibernate.cfg.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
|
||||
<hibernate-configuration>
|
||||
<session-factory>
|
||||
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>
|
||||
<property name="connection.datasource">jdbc/mnpDS</property>
|
||||
<!-- <property name="transaction.factory_class"> org.hibernate.transaction.JTATransactionFactory </property> <property name="transaction.manager_lookup_class"> org.hibernate.transaction.WeblogicTransactionManagerLookup </property> <property name="current_session_context_class"> jta </property> -->
|
||||
<!-- Chooses the HQL parser implementation -->
|
||||
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
|
||||
<property name="hibernate.current_session_context_class">thread</property>
|
||||
<property name="cache.use_second_level_cache">false</property>
|
||||
<!-- <property name="dialect">org.hibernate.dialect.OracleDialect</property> -->
|
||||
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
|
||||
<property name="connection.password"></property>
|
||||
<property name="jta.UserTransaction">javax.transaction.UserTransaction</property>
|
||||
<property name="transaction.auto_close_session">true</property>
|
||||
<property name="show_sql">false</property>
|
||||
<!--<property name="hibernate.generate_statistics">true</property> -->
|
||||
|
||||
<mapping class="dbcm.entity.EsitoAttCessEntity" />
|
||||
<mapping class="dbcm.entity.EsitoAttCessScartiEntity" />
|
||||
<mapping class="dbcm.entity.GestioneRichiestaEntity" />
|
||||
<mapping class="dbcm.entity.GestioneRichiestaRecEntity" />
|
||||
<mapping class="dbcm.entity.ViewEsitoAttCessElabEntity" />
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
Reference in New Issue
Block a user