You are on page 1of 30

Componente proyecto

Clase dominio
package pe.com.sbfi.domain;
import java.io.Serializable;
import javax.persistence.*;
import pe.com.sbfi.domain.pk.ComponenteProyectoPK;
import java.util.List;

/**
* The persistent class for the COMPONENTE_PROYECTO database table.
*
*/
@Entity
@Table(name="COMPONENTE_PROYECTO")
@NamedQuery(name="ComponenteProyecto.findAll", query="SELECT c
FROM ComponenteProyecto c")
public class ComponenteProyecto implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
private ComponenteProyectoPK id;
@Column(name="COSTO_TOTAL")
private String costoTotal;
@Column(name="FECHA_FINALIZACION")
private String fechaFinalizacion;
@Column(name="FECHA_FINALIZACION_ESTIMADO")
private String fechaFinalizacionEstimado;
@Column(name="FECHA_INICIO_EFECTIVO")
private String fechaInicioEfectivo;
@Column(name="FECHA_INICIO_PROGRMADO")
private String fechaInicioProgrmado;
private String meta;
@Column(name="NOMBRE_COMPONENTE")
private String nombreComponente;

@Column(name="TIEMPO_EJECUCION")
private String tiempoEjecucion;
@Column(name="UNIDAD_MEDIDA")
private String unidadMedida;
//bi-directional many-to-one association to ActividadProyecto
@ManyToOne
@JoinColumns({
@JoinColumn(name="ID_ACTVIDAD_PROYECTO",
referencedColumnName="ID_ACTVIDAD_PROYECTO"),
@JoinColumn(name="ID_EQUIPO",
referencedColumnName="ID_EQUIPO"),
@JoinColumn(name="ID_MATERIAL",
referencedColumnName="ID_MATERIAL"),
@JoinColumn(name="ID_PARTIDA_PROYECTO",
referencedColumnName="ID_PARTIDA_PROYECTO"),
@JoinColumn(name="ID_RECURSO_HUMANO",
referencedColumnName="ID_RECURSO_HUMANO"),
@JoinColumn(name="ID_SERVICIO",
referencedColumnName="ID_SERVICIO")
})
private ActividadProyecto actividadProyecto;
//bi-directional many-to-one association to EjecucionProyecto
@OneToMany(mappedBy="componenteProyecto")
private List<EjecucionProyecto> ejecucionProyectos;
public ComponenteProyecto() {
}
public ComponenteProyectoPK getId() {
return this.id;
}
public void setId(ComponenteProyectoPK id) {
this.id = id;
}
public String getCostoTotal() {
return this.costoTotal;
}
public void setCostoTotal(String costoTotal) {
this.costoTotal = costoTotal;
}

public String getFechaFinalizacion() {


return this.fechaFinalizacion;
}
public void setFechaFinalizacion(String fechaFinalizacion) {
this.fechaFinalizacion = fechaFinalizacion;
}
public String getFechaFinalizacionEstimado() {
return this.fechaFinalizacionEstimado;
}
public void setFechaFinalizacionEstimado(String
fechaFinalizacionEstimado) {
this.fechaFinalizacionEstimado = fechaFinalizacionEstimado;
}
public String getFechaInicioEfectivo() {
return this.fechaInicioEfectivo;
}
public void setFechaInicioEfectivo(String fechaInicioEfectivo) {
this.fechaInicioEfectivo = fechaInicioEfectivo;
}
public String getFechaInicioProgrmado() {
return this.fechaInicioProgrmado;
}
public void setFechaInicioProgrmado(String fechaInicioProgrmado) {
this.fechaInicioProgrmado = fechaInicioProgrmado;
}
public String getMeta() {
return this.meta;
}
public void setMeta(String meta) {
this.meta = meta;
}
public String getNombreComponente() {
return this.nombreComponente;
}
public void setNombreComponente(String nombreComponente) {

this.nombreComponente = nombreComponente;
}
public String getTiempoEjecucion() {
return this.tiempoEjecucion;
}
public void setTiempoEjecucion(String tiempoEjecucion) {
this.tiempoEjecucion = tiempoEjecucion;
}
public String getUnidadMedida() {
return this.unidadMedida;
}
public void setUnidadMedida(String unidadMedida) {
this.unidadMedida = unidadMedida;
}
public ActividadProyecto getActividadProyecto() {
return this.actividadProyecto;
}
public void setActividadProyecto(ActividadProyecto
actividadProyecto) {
this.actividadProyecto = actividadProyecto;
}
public List<EjecucionProyecto> getEjecucionProyectos() {
return this.ejecucionProyectos;
}
public void setEjecucionProyectos(List<EjecucionProyecto>
ejecucionProyectos) {
this.ejecucionProyectos = ejecucionProyectos;
}
public EjecucionProyecto addEjecucionProyecto(EjecucionProyecto
ejecucionProyecto) {
getEjecucionProyectos().add(ejecucionProyecto);
ejecucionProyecto.setComponenteProyecto(this);
return ejecucionProyecto;
}
public EjecucionProyecto
removeEjecucionProyecto(EjecucionProyecto ejecucionProyecto) {

getEjecucionProyectos().remove(ejecucionProyecto);
ejecucionProyecto.setComponenteProyecto(null);
return ejecucionProyecto;
}
}
Clase Modelo
package pe.com.sbfi.model;
import java.util.List;
import pe.com.sbfi.domain.PartidaProyecto;
public interface ComponenteProyectoModel {
public List<Object[]>
listComponenteProyecto(ComponenteProyectoModel
componenteProyectoModel);
public Integer countComponenteProyecto(ComponenteProyectoModel
componenteProyectoModel);
public void insertComponenteProyecto(ComponenteProyectoModel
componenteProyectoModel);
}
Clase modelo implementacin
package pe.com.sbfi.model.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import pe.com.sbfi.model.ComponenteProyectoModel;
@Repository
@Transactional("sbfiTM")
public class ComponenteProyectoModelImpl implements
ComponenteProyectoModel {
Logger logger = Logger.getLogger(PartidaProyectoModelImpl.class);

@PersistenceContext(unitName = "sbfiJpa")
private EntityManager em;

@Override
public List<Object[]> listComponenteProyecto(
ComponenteProyectoModel componenteProyectoModel)
{
// TODO Auto-generated method stub
return null;
}
@Override
public Integer countComponenteProyecto(
ComponenteProyectoModel componenteProyectoModel)
{
// TODO Auto-generated method stub
return null;
}
@Override
public void insertComponenteProyecto(
ComponenteProyectoModel componenteProyectoModel)
{
// TODO Auto-generated method stub
}
}
Ejecucin proyecto
Clase dominio
package pe.com.sbfi.domain;
import java.io.Serializable;
import javax.persistence.*;
import pe.com.sbfi.domain.pk.EjecucionProyectoPK;

/**
* The persistent class for the EJECUCION_PROYECTO database table.
*
*/
@Entity
@Table(name="EJECUCION_PROYECTO")
@NamedQuery(name="EjecucionProyecto.findAll", query="SELECT e FROM
EjecucionProyecto e")

public class EjecucionProyecto implements Serializable {


private static final long serialVersionUID = 1L;
@EmbeddedId
private EjecucionProyectoPK id;
@Column(name="COSTO_DIRECTO")
private String costoDirecto;
@Column(name="COSTO_TOTAL_PROYECTO")
private String costoTotalProyecto;
@Column(name="GASTO_SUPERVISION")
private String gastoSupervision;
@Column(name="GASTOS_GENERALES")
private String gastosGenerales;
//bi-directional many-to-one association to ComponenteProyecto
@ManyToOne
@JoinColumns({
@JoinColumn(name="ID_ACTVIDAD_PROYECTO",
referencedColumnName="ID_ACTVIDAD_PROYECTO"),
@JoinColumn(name="ID_COMPONENTE",
referencedColumnName="ID_COMPONENTE"),
@JoinColumn(name="ID_EQUIPO",
referencedColumnName="ID_EQUIPO"),
@JoinColumn(name="ID_MATERIAL",
referencedColumnName="ID_MATERIAL"),
@JoinColumn(name="ID_PARTIDA_PROYECTO",
referencedColumnName="ID_PARTIDA_PROYECTO"),
@JoinColumn(name="ID_RECURSO_HUMANO",
referencedColumnName="ID_RECURSO_HUMANO"),
@JoinColumn(name="ID_SERVICIO",
referencedColumnName="ID_SERVICIO")
})
private ComponenteProyecto componenteProyecto;
//bi-directional many-to-one association to HorizonteEjecucion
@ManyToOne
@JoinColumn(name="ID_HORIZONTE")
private HorizonteEjecucion horizonteEjecucion;
public EjecucionProyecto() {
}
public EjecucionProyectoPK getId() {

return this.id;
}
public void setId(EjecucionProyectoPK id) {
this.id = id;
}
public String getCostoDirecto() {
return this.costoDirecto;
}
public void setCostoDirecto(String costoDirecto) {
this.costoDirecto = costoDirecto;
}
public String getCostoTotalProyecto() {
return this.costoTotalProyecto;
}
public void setCostoTotalProyecto(String costoTotalProyecto) {
this.costoTotalProyecto = costoTotalProyecto;
}
public String getGastoSupervision() {
return this.gastoSupervision;
}
public void setGastoSupervision(String gastoSupervision) {
this.gastoSupervision = gastoSupervision;
}
public String getGastosGenerales() {
return this.gastosGenerales;
}
public void setGastosGenerales(String gastosGenerales) {
this.gastosGenerales = gastosGenerales;
}
public ComponenteProyecto getComponenteProyecto() {
return this.componenteProyecto;
}
public void setComponenteProyecto(ComponenteProyecto
componenteProyecto) {
this.componenteProyecto = componenteProyecto;
}

public HorizonteEjecucion getHorizonteEjecucion() {


return this.horizonteEjecucion;
}
public void setHorizonteEjecucion(HorizonteEjecucion
horizonteEjecucion) {
this.horizonteEjecucion = horizonteEjecucion;
}
}
Clase modelo
package pe.com.sbfi.model;
import java.util.List;
import pe.com.sbfi.domain.EjecucionProyecto;
public interface EjecucionProyectoModel {
public List<Object[]> listEjecucionProyecto(EjecucionProyecto
componenteProyectoModel);
public Integer countEjecucionProyecto(EjecucionProyecto
componenteProyectoModel);
public void insertEjecucionProyecto(EjecucionProyecto
componenteProyectoModel);
}
Clase modelo implementacin
package pe.com.sbfi.model.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import pe.com.sbfi.domain.EjecucionProyecto;
import pe.com.sbfi.model.EjecucionProyectoModel;
@Repository
@Transactional("sbfiTM")
public class EjecucionProyectoModelImpl implements

EjecucionProyectoModel {
Logger logger = Logger.getLogger(PartidaProyectoModelImpl.class);

@PersistenceContext(unitName = "sbfiJpa")
private EntityManager em;
@Override
public List<Object[]> listEjecucionProyecto(
EjecucionProyecto componenteProyectoModel) {
// TODO Auto-generated method stub
return null;
}
@Override
public Integer countEjecucionProyecto(
EjecucionProyecto componenteProyectoModel) {
// TODO Auto-generated method stub
return null;
}
@Override
public void insertEjecucionProyecto(
EjecucionProyecto componenteProyectoModel) {
// TODO Auto-generated method stub
}
}
Expediente tcnico
Clase dominio
package pe.com.sbfi.domain;
import
import
import
import

java.io.Serializable;
javax.persistence.*;
java.net.URL;
java.util.Date;

/**
* The persistent class for the EXPEDIENTE_TECNICO database table.
*
*/
@Entity
@Table(name="EXPEDIENTE_TECNICO")

@NamedQuery(name="ExpedienteTecnico.findAll", query="SELECT e FROM


ExpedienteTecnico e")
public class ExpedienteTecnico implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="ID_EXPEDIENTE_TECNICO")
private String idExpedienteTecnico;
@Column(name="COSTO_EXPEDIENTE")
private double costoExpediente;
@Temporal(TemporalType.DATE)
@Column(name="FECHA_APROBACION")
private Date fechaAprobacion;
@Column(name="FUENTE_FINANCIAMIENTO_EXP")
private String fuenteFinanciamientoExp;
@Column(name="MODALIDAD_FORM_EXPEDIENTE")
private URL modalidadFormExpediente;
@Column(name="RAZON_SOCIAL_FORM_EXP")
private String razonSocialFormExp;
public ExpedienteTecnico() {
}
public String getIdExpedienteTecnico() {
return this.idExpedienteTecnico;
}
public void setIdExpedienteTecnico(String idExpedienteTecnico) {
this.idExpedienteTecnico = idExpedienteTecnico;
}
public double getCostoExpediente() {
return this.costoExpediente;
}
public void setCostoExpediente(double costoExpediente) {
this.costoExpediente = costoExpediente;
}
public Date getFechaAprobacion() {
return this.fechaAprobacion;
}

public void setFechaAprobacion(Date fechaAprobacion) {


this.fechaAprobacion = fechaAprobacion;
}
public String getFuenteFinanciamientoExp() {
return this.fuenteFinanciamientoExp;
}
public void setFuenteFinanciamientoExp(String
fuenteFinanciamientoExp) {
this.fuenteFinanciamientoExp = fuenteFinanciamientoExp;
}
public URL getModalidadFormExpediente() {
return this.modalidadFormExpediente;
}
public void setModalidadFormExpediente(URL
modalidadFormExpediente) {
this.modalidadFormExpediente = modalidadFormExpediente;
}
public String getRazonSocialFormExp() {
return this.razonSocialFormExp;
}
public void setRazonSocialFormExp(String razonSocialFormExp) {
this.razonSocialFormExp = razonSocialFormExp;
}
}
Clase modelo
package pe.com.sbfi.model;
import java.util.List;
import pe.com.sbfi.domain.EjecucionProyecto;
import pe.com.sbfi.domain.ExpedienteTecnico;
public interface ExpedienteTecnicoModel {
public List<Object[]> listExpedienteTecnico(ExpedienteTecnico
expedienteTecnico);
public Integer countExpedienteTecnico(ExpedienteTecnico
expedienteTecnico);

public void insertExpedienteTecnico(ExpedienteTecnico


expedienteTecnico);
}
Clase modelo implementacin
package pe.com.sbfi.model.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import pe.com.sbfi.domain.ExpedienteTecnico;
import pe.com.sbfi.model.ExpedienteTecnicoModel;
@Repository
@Transactional("sbfiTM")
public class ExpedienteTecnicoModelImpl implements
ExpedienteTecnicoModel {
Logger logger = Logger.getLogger(PartidaProyectoModelImpl.class);

@PersistenceContext(unitName = "sbfiJpa")
private EntityManager em;
@Override
public List<Object[]> listExpedienteTecnico(
ExpedienteTecnico expedienteTecnico) {
// TODO Auto-generated method stub
return null;
}
@Override
public Integer countExpedienteTecnico(ExpedienteTecnico
expedienteTecnico) {
// TODO Auto-generated method stub
return null;
}
@Override
public void insertExpedienteTecnico(ExpedienteTecnico
expedienteTecnico) {
// TODO Auto-generated method stub
}

}
Objetivo proyecto
Clase dominio
package pe.com.sbfi.domain;
import java.io.Serializable;
import javax.persistence.*;
import pe.com.sbfi.domain.pk.ObjetivoProyectoPK;

/**
* The persistent class for the OBJETIVO_PROYECTO database table.
*
*/
@Entity
@Table(name="OBJETIVO_PROYECTO")
@NamedQuery(name="ObjetivoProyecto.findAll", query="SELECT o FROM
ObjetivoProyecto o")
public class ObjetivoProyecto implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
private ObjetivoProyectoPK id;
@Column(name="NOMBRE_OBJETIVO")
private String nombreObjetivo;
//bi-directional many-to-one association to ObjetivoEspecifico
@ManyToOne
@JoinColumn(name="ID_OBJ_ESPECIFICO")
private ObjetivoEspecifico objetivoEspecifico;
public ObjetivoProyecto() {
}
public ObjetivoProyectoPK getId() {
return this.id;
}
public void setId(ObjetivoProyectoPK id) {
this.id = id;
}

public String getNombreObjetivo() {


return this.nombreObjetivo;
}
public void setNombreObjetivo(String nombreObjetivo) {
this.nombreObjetivo = nombreObjetivo;
}
public ObjetivoEspecifico getObjetivoEspecifico() {
return this.objetivoEspecifico;
}
public void setObjetivoEspecifico(ObjetivoEspecifico
objetivoEspecifico) {
this.objetivoEspecifico = objetivoEspecifico;
}
}
Clase modelo
package pe.com.sbfi.model;
import java.util.List;
import pe.com.sbfi.domain.PartidaProyecto;
public interface ObjetivoProyectoModel {
public List<Object[]>
listObjetivoProyectoModel(ObjetivoProyectoModel objetivoProyectoModel);
public Integer countObjetivoProyectoModel(ObjetivoProyectoModel
objetivoProyectoModel);
public void insertObjetivoProyectoModel(ObjetivoProyectoModel
objetivoProyectoModel);
}
Clase modelo implementacin
package pe.com.sbfi.model.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import org.springframework.transaction.annotation.Transactional;
import pe.com.sbfi.model.ObjetivoProyectoModel;
@Repository
@Transactional("sbfiTM")
public class ObjetivoProyectoModelImpl implements
ObjetivoProyectoModel{
Logger logger = Logger.getLogger(ObjetivoProyectoModelImpl.class);

@PersistenceContext(unitName = "sbfiJpa")
private EntityManager em;

@Override
public List<Object[]> listObjetivoProyectoModel(
ObjetivoProyectoModel objetivoProyectoModel) {
// TODO Auto-generated method stub
return null;
}
@Override
public Integer countObjetivoProyectoModel(
ObjetivoProyectoModel objetivoProyectoModel) {
// TODO Auto-generated method stub
return null;
}
@Override
public void insertObjetivoProyectoModel(
ObjetivoProyectoModel objetivoProyectoModel) {
// TODO Auto-generated method stub
}
}
Partida Proyecto
Clase dominio
package pe.com.sbfi.domain;
import java.io.Serializable;

import javax.persistence.*;
import pe.com.sbfi.domain.pk.PartidaProyectoPK;
import java.util.List;

/**
* The persistent class for the PARTIDA_PROYECTO database table.
*
*/
@Entity
@Table(name="PARTIDA_PROYECTO")
@NamedQuery(name="PartidaProyecto.findAll", query="SELECT p FROM
PartidaProyecto p")
public class PartidaProyecto implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
private PartidaProyectoPK id;
@Column(name="NOMBRE_PARTIDA")
private String nombrePartida;
//bi-directional many-to-one association to ActividadProyecto
@OneToMany(mappedBy="partidaProyecto")
private List<ActividadProyecto> actividadProyectos;
//bi-directional many-to-one association to Equipo
@ManyToOne
@JoinColumn(name="ID_EQUIPO")
private Equipo equipo;
//bi-directional many-to-one association to Materiale
@ManyToOne
@JoinColumn(name="ID_MATERIAL")
private Materiale materiale;
//bi-directional many-to-one association to RecursoHumano
@ManyToOne
@JoinColumn(name="ID_RECURSO_HUMANO")
private RecursoHumano recursoHumano;
//bi-directional many-to-one association to Servicio
@ManyToOne
@JoinColumn(name="ID_SERVICIO")
private Servicio servicio;

public PartidaProyecto() {
}
public PartidaProyectoPK getId() {
return this.id;
}
public void setId(PartidaProyectoPK id) {
this.id = id;
}
public String getNombrePartida() {
return this.nombrePartida;
}
public void setNombrePartida(String nombrePartida) {
this.nombrePartida = nombrePartida;
}
public List<ActividadProyecto> getActividadProyectos() {
return this.actividadProyectos;
}
public void setActividadProyectos(List<ActividadProyecto>
actividadProyectos) {
this.actividadProyectos = actividadProyectos;
}
public ActividadProyecto addActividadProyecto(ActividadProyecto
actividadProyecto) {
getActividadProyectos().add(actividadProyecto);
actividadProyecto.setPartidaProyecto(this);
return actividadProyecto;
}
public ActividadProyecto removeActividadProyecto(ActividadProyecto
actividadProyecto) {
getActividadProyectos().remove(actividadProyecto);
actividadProyecto.setPartidaProyecto(null);
return actividadProyecto;
}
public Equipo getEquipo() {
return this.equipo;

}
public void setEquipo(Equipo equipo) {
this.equipo = equipo;
}
public Materiale getMateriale() {
return this.materiale;
}
public void setMateriale(Materiale materiale) {
this.materiale = materiale;
}
public RecursoHumano getRecursoHumano() {
return this.recursoHumano;
}
public void setRecursoHumano(RecursoHumano recursoHumano) {
this.recursoHumano = recursoHumano;
}
public Servicio getServicio() {
return this.servicio;
}
public void setServicio(Servicio servicio) {
this.servicio = servicio;
}
}
Clase modelo
package pe.com.sbfi.model;
import java.util.List;
import pe.com.sbfi.domain.PartidaProyecto;
public interface PartidaProyectoModel {

public List<Object[]> listPartidaProyectoModel(PartidaProyecto


partidaProyecto);
public Integer countPartidaProyectoModel(PartidaProyecto
partidaProyecto);

public void insertPartidaProyectoModel(PartidaProyecto


partidaProyecto);
}
Clase modelo implementacin
package pe.com.sbfi.model.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import pe.com.sbfi.domain.PartidaProyecto;
import pe.com.sbfi.model.PartidaProyectoModel;

@Repository
@Transactional("sbfiTM")
public class PartidaProyectoModelImpl implements PartidaProyectoModel{
Logger logger = Logger.getLogger(PartidaProyectoModelImpl.class);

@PersistenceContext(unitName = "sbfiJpa")
private EntityManager em;
@Override
public List<Object[]> listPartidaProyectoModel(
PartidaProyecto partidaProyecto) {
// TODO Auto-generated method stub
return null;
}
@Override
public Integer countPartidaProyectoModel(PartidaProyecto
partidaProyecto) {
// TODO Auto-generated method stub
return null;
}
@Override

public void insertPartidaProyectoModel(PartidaProyecto


partidaProyecto) {
// TODO Auto-generated method stub
}

}
Recurso humano
Clase dominio
package pe.com.sbfi.domain;
import
import
import
import

java.io.Serializable;
javax.persistence.*;
java.math.BigDecimal;
java.util.List;

/**
* The persistent class for the RECURSO_HUMANO database table.
*
*/
@Entity
@Table(name="RECURSO_HUMANO")
@NamedQuery(name="RecursoHumano.findAll", query="SELECT r FROM
RecursoHumano r")
public class RecursoHumano implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name="ID_RECURSO_HUMANO")
private String idRecursoHumano;
@Column(name="CANTIDAD_RRHH")
private BigDecimal cantidadRrhh;
private double costo;
@Column(name="NOMBRE_RRHH")
private String nombreRrhh;
@Column(name="UNIDAD_RRHH")
private String unidadRrhh;

//bi-directional many-to-one association to PartidaProyecto


@OneToMany(mappedBy="recursoHumano")
private List<PartidaProyecto> partidaProyectos;
public RecursoHumano() {
}
public String getIdRecursoHumano() {
return this.idRecursoHumano;
}
public void setIdRecursoHumano(String idRecursoHumano) {
this.idRecursoHumano = idRecursoHumano;
}
public BigDecimal getCantidadRrhh() {
return this.cantidadRrhh;
}
public void setCantidadRrhh(BigDecimal cantidadRrhh) {
this.cantidadRrhh = cantidadRrhh;
}
public double getCosto() {
return this.costo;
}
public void setCosto(double costo) {
this.costo = costo;
}
public String getNombreRrhh() {
return this.nombreRrhh;
}
public void setNombreRrhh(String nombreRrhh) {
this.nombreRrhh = nombreRrhh;
}
public String getUnidadRrhh() {
return this.unidadRrhh;
}
public void setUnidadRrhh(String unidadRrhh) {
this.unidadRrhh = unidadRrhh;
}

public List<PartidaProyecto> getPartidaProyectos() {


return this.partidaProyectos;
}
public void setPartidaProyectos(List<PartidaProyecto>
partidaProyectos) {
this.partidaProyectos = partidaProyectos;
}
public PartidaProyecto addPartidaProyecto(PartidaProyecto
partidaProyecto) {
getPartidaProyectos().add(partidaProyecto);
partidaProyecto.setRecursoHumano(this);
return partidaProyecto;
}
public PartidaProyecto removePartidaProyecto(PartidaProyecto
partidaProyecto) {
getPartidaProyectos().remove(partidaProyecto);
partidaProyecto.setRecursoHumano(null);
return partidaProyecto;
}
}
Clase modelo
package pe.com.sbfi.model;
import java.util.List;
import pe.com.sbfi.domain.ExpedienteTecnico;
import pe.com.sbfi.domain.RecursoHumano;
public interface RecursoHumanoModel {
public List<Object[]> listRecursoHumano(RecursoHumano
recursoHumano);
public Integer countRecursoHumano(RecursoHumano
recursoHumano);
public void insertRecursoHumano(RecursoHumano recursoHumano);
}
Clase modelo implementacin

package pe.com.sbfi.model.impl;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import pe.com.sbfi.domain.RecursoHumano;
import pe.com.sbfi.model.RecursoHumanoModel;
@Repository
@Transactional("sbfiTM")
public class RecursoHumanoModelImpl implements RecursoHumanoModel {
Logger logger = Logger.getLogger(PartidaProyectoModelImpl.class);

@PersistenceContext(unitName = "sbfiJpa")
private EntityManager em;
@Override
public List<Object[]> listRecursoHumano(RecursoHumano
recursoHumano) {
// TODO Auto-generated method stub
return null;
}
@Override
public Integer countRecursoHumano(RecursoHumano
recursoHumano) {
// TODO Auto-generated method stub
return null;
}
@Override
public void insertRecursoHumano(RecursoHumano recursoHumano) {
// TODO Auto-generated method stub
}
}
Conexin a base de datos
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-3.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd
">
<context:component-scan base-package="pe.com.sbfi" />
<context:annotation-config/>
<task:annotation-driven/>
<context:property-placeholder
location="classpath:pe/com/sbfi/resource/sbfi-jdbc.properties,
classpath:pe/com/sbfi/resource/sbfi-email.properties" />
<!-- Inicio config cache -->
<cache:annotation-driven cache-manager="sbfiCacheManager" />
<bean id="sbfiCacheManager"
class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="sbfiEhcache"/>
</bean>
<bean id="sbfiEhcache"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation"
value="classpath:pe/com/sbfi/resource/sbfi-ehcache.xml"/>
</bean>
<!-- Fin config cache -->
<!-Setup local data source -->
<bean id="sbfiDS"

class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="$
{database.driver}"></property>
<property name="url" value="${database.url}"></property>
<property name="username" value="$
{database.username}"></property>
<property name="password" value="$
{database.password}"></property>
</bean>
<import resource="classpath:pe/com/sbfi/resource/sbfi-jpa-entitymanager.xml" />
<!-- -->
<import resource="classpath:pe/com/sbfi/resource/sbfi-transactionaop.xml" />
<import resource="classpath:pe/com/sbfi/resource/sbfi-email.xml" />

</beans>

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-3.2.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd
">

<context:component-scan base-package="pe.com.sbfi" />


<task:annotation-driven/>
<context:property-placeholder
location="classpath:pe/gob/mef/sbfi/resource/sbfi-jdbc.properties,
classpath:pe/gob/mef/sbfi/resource/sbfi-email.properties" />
<!-- Inicio config cache -->
<cache:annotation-driven cache-manager="sbfiCacheManager" />
<bean id="sbfiCacheManager"
class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="sbfiEhcache"/>
</bean>
<bean id="sbfiEhcache"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation"
value="classpath:pe/gob/mef/sbfi/resource/sbfi-ehcache.xml"/>
</bean>
<!-- Fin config cache -->

<import resource="classpath:pe/gob/mef/sbfi/resource/sbfi-datasource.xml" />


<import resource="classpath:pe/gob/mef/sbfi/resource/sbfi-jpa-entitymanager.xml" />
<import resource="classpath:pe/gob/mef/sbfi/resource/sbfi-transactionaop.xml" />
<import resource="classpath:pe/gob/mef/sbfi/resource/sbfi-email.xml" />
<import resource="classpath:pe/gob/mef/util/resource/mefutil-model.xml"
/>
</beans>

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.2.xsd">
<!-- Setup local data source -->
<jee:jndi-lookup id="sbfiDS" jndi-name="java:sbfiDS" />
</beans>

<?xml version="1.0" encoding="UTF-8"?>

<ehcache>
<defaultCache eternal="false" maxElementsInMemory="100"
overflowToDisk="false" />
<cache name="sbfiCache"
maxElementsInMemory="10000"
maxElementsOnDisk="10000000"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="600"
timeToLiveSeconds="1800"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>

#
#
#
#
#

Properties file with JDBC and JPA settings.


Applied by <context:property-placeholder location="jdbc.properties"/> from
various application context XML files (e.g., "applicationContext-*.xml").
Targeted at system administrators, to avoid touching the context XML files.

#------------------------------------------------------------------------------# Common Settings


hibernate.generate_statistics=true
hibernate.show_sql=true
jpa.showSql=false
jpa.generateDdl=false
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
#------------------------------------------------------------------------------# Oracle Settings desarrollo
#database.driver=oracle.jdbc.driver.OracleDriver
#database.url=jdbc:oracle:thin:@192.9.200.151:1522:desa
#database.username=cisma
#database.password=bezoar

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

<!-- Transaction Management -->


<bean id="sbfiTransactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="dataSource" ref="sbfiDS" />
<property name="entityManagerFactory"
ref="sbfiEntityManagerFactory" />
<qualifier value="sbfiTM"/>
</bean>
<!-- Recognizing Transaction Notations for Unit Test only -->
<tx:annotation-driven transaction-manager="sbfiTransactionManager" />
<!-- Setup JPA -->
<bean id="sbfiEntityManagerFactory"

class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="sbfiDS" />
<property name="persistenceXmlLocation" value="classpath:METAINF/sbfi-persistence.xml"/>
<property name="persistenceUnitName"
value="sbfiJpa"></property>
<property name="jpaProperties">
<props>
<prop key="hibernate.validator.apply_to_ddl">false</prop>
<prop
key="hibernate.validator.autoregister_listeners">false</prop>
</props>
</property>
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="$
{jpa.showSql}"></property>
<property name="generateDdl" value="$
{jpa.generateDdl}"></property>
<property name="databasePlatform" value="$
{hibernate.dialect}"></property>
</bean>
</property>
</bean>
<!-- Spring acting as JPA container for creation of Entity Manager -->

<!-- Annotation @PersistenceContext would be recognized -->


<bean id="sbfiPersistenceAnnotation"

class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProce
ssor" />
<!-<bean id="fonafeJpaTemplate"
class="org.springframework.orm.jpa.JpaTemplate">
<property name="entityManagerFactory"
ref="fonafeEntityManagerFactory" />
</bean>
-->
</beans>

You might also like