forked from Coded/SIPRP
git-svn-id: https://svn.coded.pt/svn/SIPRP@751 bb69d46d-e84e-40c8-a05a-06db0d633741
parent
e6ea2e43c4
commit
6a112b9eca
@ -0,0 +1,12 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._EmailPlanoDeActuacao;
|
||||
|
||||
public class EmailPlanoDeActuacao extends _EmailPlanoDeActuacao {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getDescription() == null ? "" : getDescription();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._Image;
|
||||
|
||||
public class Image extends _Image {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() == null ? "" : getName();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._Legislacao;
|
||||
|
||||
public class Legislacao extends _Legislacao {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getDescription() == null ? "" : getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._LegislacaoEstabelecimento;
|
||||
|
||||
public class LegislacaoEstabelecimento extends _LegislacaoEstabelecimento {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getToLegislacao().getDescription() == null ? "" : getToLegislacao().getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._Medida;
|
||||
|
||||
public class Medida extends _Medida {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getDescription() == null ? "" : getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._PostoDeTrabalho;
|
||||
|
||||
public class PostoDeTrabalho extends _PostoDeTrabalho {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getDescription() == null ? "" : getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._PostoDeTrabalhoEstabelecimento;
|
||||
|
||||
public class PostoDeTrabalhoEstabelecimento extends _PostoDeTrabalhoEstabelecimento {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getToPostoDeTrabalho().getDescription() == null ? "" : getToPostoDeTrabalho().getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._Risco;
|
||||
|
||||
public class Risco extends _Risco {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getDescription() == null ? "" : getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._RiscoMedida;
|
||||
|
||||
public class RiscoMedida extends _RiscoMedida {
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getToMedida().toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package siprp.database.cayenne.objects;
|
||||
|
||||
import siprp.database.cayenne.objects.auto._TrabalhadoresEcdsAnalise;
|
||||
|
||||
public class TrabalhadoresEcdsAnalise extends _TrabalhadoresEcdsAnalise {
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.Estabelecimentos;
|
||||
|
||||
/**
|
||||
* Class _EmailPlanoDeActuacao was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _EmailPlanoDeActuacao extends CayenneDataObject {
|
||||
|
||||
public static final String DESCRIPTION_PROPERTY = "description";
|
||||
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setDescription(String description) {
|
||||
writeProperty("description", description);
|
||||
}
|
||||
public String getDescription() {
|
||||
return (String)readProperty("description");
|
||||
}
|
||||
|
||||
public void setToEstabelecimentos(Estabelecimentos toEstabelecimentos) {
|
||||
setToOneTarget("toEstabelecimentos", toEstabelecimentos, true);
|
||||
}
|
||||
|
||||
public Estabelecimentos getToEstabelecimentos() {
|
||||
return (Estabelecimentos)readProperty("toEstabelecimentos");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.Empresas;
|
||||
|
||||
/**
|
||||
* Class _Image was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _Image extends CayenneDataObject {
|
||||
|
||||
public static final String IMAGE_DATA_PROPERTY = "imageData";
|
||||
public static final String NAME_PROPERTY = "name";
|
||||
public static final String EMPRESAS_ARRAY_PROPERTY = "empresasArray";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setImageData(byte[] imageData) {
|
||||
writeProperty("imageData", imageData);
|
||||
}
|
||||
public byte[] getImageData() {
|
||||
return (byte[])readProperty("imageData");
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
writeProperty("name", name);
|
||||
}
|
||||
public String getName() {
|
||||
return (String)readProperty("name");
|
||||
}
|
||||
|
||||
public void addToEmpresasArray(Empresas obj) {
|
||||
addToManyTarget("empresasArray", obj, true);
|
||||
}
|
||||
public void removeFromEmpresasArray(Empresas obj) {
|
||||
removeToManyTarget("empresasArray", obj, true);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Empresas> getEmpresasArray() {
|
||||
return (List<Empresas>)readProperty("empresasArray");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.LegislacaoEstabelecimento;
|
||||
|
||||
/**
|
||||
* Class _Legislacao was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _Legislacao extends CayenneDataObject {
|
||||
|
||||
public static final String DESCRIPTION_PROPERTY = "description";
|
||||
public static final String LEGISLACAO_ESTABELECIMENTO_ARRAY_PROPERTY = "legislacaoEstabelecimentoArray";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setDescription(String description) {
|
||||
writeProperty("description", description);
|
||||
}
|
||||
public String getDescription() {
|
||||
return (String)readProperty("description");
|
||||
}
|
||||
|
||||
public void addToLegislacaoEstabelecimentoArray(LegislacaoEstabelecimento obj) {
|
||||
addToManyTarget("legislacaoEstabelecimentoArray", obj, true);
|
||||
}
|
||||
public void removeFromLegislacaoEstabelecimentoArray(LegislacaoEstabelecimento obj) {
|
||||
removeToManyTarget("legislacaoEstabelecimentoArray", obj, true);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<LegislacaoEstabelecimento> getLegislacaoEstabelecimentoArray() {
|
||||
return (List<LegislacaoEstabelecimento>)readProperty("legislacaoEstabelecimentoArray");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.Estabelecimentos;
|
||||
import siprp.database.cayenne.objects.Legislacao;
|
||||
|
||||
/**
|
||||
* Class _LegislacaoEstabelecimento was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _LegislacaoEstabelecimento extends CayenneDataObject {
|
||||
|
||||
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
|
||||
public static final String TO_LEGISLACAO_PROPERTY = "toLegislacao";
|
||||
|
||||
public static final String ESTABELECIMENTO_ID_PK_COLUMN = "estabelecimento_id";
|
||||
public static final String LEGISLACAO_ID_PK_COLUMN = "legislacao_id";
|
||||
|
||||
public void setToEstabelecimentos(Estabelecimentos toEstabelecimentos) {
|
||||
setToOneTarget("toEstabelecimentos", toEstabelecimentos, true);
|
||||
}
|
||||
|
||||
public Estabelecimentos getToEstabelecimentos() {
|
||||
return (Estabelecimentos)readProperty("toEstabelecimentos");
|
||||
}
|
||||
|
||||
|
||||
public void setToLegislacao(Legislacao toLegislacao) {
|
||||
setToOneTarget("toLegislacao", toLegislacao, true);
|
||||
}
|
||||
|
||||
public Legislacao getToLegislacao() {
|
||||
return (Legislacao)readProperty("toLegislacao");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.RiscoMedida;
|
||||
|
||||
/**
|
||||
* Class _Medida was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _Medida extends CayenneDataObject {
|
||||
|
||||
public static final String DESCRIPTION_PROPERTY = "description";
|
||||
public static final String RISCO_MEDIDA_ARRAY_PROPERTY = "riscoMedidaArray";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setDescription(String description) {
|
||||
writeProperty("description", description);
|
||||
}
|
||||
public String getDescription() {
|
||||
return (String)readProperty("description");
|
||||
}
|
||||
|
||||
public void addToRiscoMedidaArray(RiscoMedida obj) {
|
||||
addToManyTarget("riscoMedidaArray", obj, true);
|
||||
}
|
||||
public void removeFromRiscoMedidaArray(RiscoMedida obj) {
|
||||
removeToManyTarget("riscoMedidaArray", obj, true);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<RiscoMedida> getRiscoMedidaArray() {
|
||||
return (List<RiscoMedida>)readProperty("riscoMedidaArray");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.PostoDeTrabalhoEstabelecimento;
|
||||
|
||||
/**
|
||||
* Class _PostoDeTrabalho was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _PostoDeTrabalho extends CayenneDataObject {
|
||||
|
||||
public static final String DESCRIPTION_PROPERTY = "description";
|
||||
public static final String POSTO_DE_TRABALHO_ESTABELECIMENTO_ARRAY_PROPERTY = "postoDeTrabalhoEstabelecimentoArray";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setDescription(String description) {
|
||||
writeProperty("description", description);
|
||||
}
|
||||
public String getDescription() {
|
||||
return (String)readProperty("description");
|
||||
}
|
||||
|
||||
public void addToPostoDeTrabalhoEstabelecimentoArray(PostoDeTrabalhoEstabelecimento obj) {
|
||||
addToManyTarget("postoDeTrabalhoEstabelecimentoArray", obj, true);
|
||||
}
|
||||
public void removeFromPostoDeTrabalhoEstabelecimentoArray(PostoDeTrabalhoEstabelecimento obj) {
|
||||
removeToManyTarget("postoDeTrabalhoEstabelecimentoArray", obj, true);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<PostoDeTrabalhoEstabelecimento> getPostoDeTrabalhoEstabelecimentoArray() {
|
||||
return (List<PostoDeTrabalhoEstabelecimento>)readProperty("postoDeTrabalhoEstabelecimentoArray");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.Estabelecimentos;
|
||||
import siprp.database.cayenne.objects.PostoDeTrabalho;
|
||||
|
||||
/**
|
||||
* Class _PostoDeTrabalhoEstabelecimento was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _PostoDeTrabalhoEstabelecimento extends CayenneDataObject {
|
||||
|
||||
public static final String TO_ESTABELECIMENTOS_PROPERTY = "toEstabelecimentos";
|
||||
public static final String TO_POSTO_DE_TRABALHO_PROPERTY = "toPostoDeTrabalho";
|
||||
|
||||
public static final String ESTABELECIMENTO_ID_PK_COLUMN = "estabelecimento_id";
|
||||
public static final String POSTO_DE_TRABALHO_ID_PK_COLUMN = "posto_de_trabalho_id";
|
||||
|
||||
public void setToEstabelecimentos(Estabelecimentos toEstabelecimentos) {
|
||||
setToOneTarget("toEstabelecimentos", toEstabelecimentos, true);
|
||||
}
|
||||
|
||||
public Estabelecimentos getToEstabelecimentos() {
|
||||
return (Estabelecimentos)readProperty("toEstabelecimentos");
|
||||
}
|
||||
|
||||
|
||||
public void setToPostoDeTrabalho(PostoDeTrabalho toPostoDeTrabalho) {
|
||||
setToOneTarget("toPostoDeTrabalho", toPostoDeTrabalho, true);
|
||||
}
|
||||
|
||||
public PostoDeTrabalho getToPostoDeTrabalho() {
|
||||
return (PostoDeTrabalho)readProperty("toPostoDeTrabalho");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,33 +1,38 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
/** Class _PrestadoresGruposProtocolo was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _PrestadoresGruposProtocolo extends siprp.database.cayenne.objects.BaseObject {
|
||||
import siprp.database.cayenne.objects.BaseObject;
|
||||
import siprp.database.cayenne.objects.Prestadores;
|
||||
import siprp.database.cayenne.objects.PrtGruposProtocolo;
|
||||
|
||||
/**
|
||||
* Class _PrestadoresGruposProtocolo was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _PrestadoresGruposProtocolo extends BaseObject {
|
||||
|
||||
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
|
||||
public static final String TO_PRT_GRUPOS_PROTOCOLO_PROPERTY = "toPrtGruposProtocolo";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setToPrestadores(siprp.database.cayenne.objects.Prestadores toPrestadores) {
|
||||
public void setToPrestadores(Prestadores toPrestadores) {
|
||||
setToOneTarget("toPrestadores", toPrestadores, true);
|
||||
}
|
||||
|
||||
public siprp.database.cayenne.objects.Prestadores getToPrestadores() {
|
||||
return (siprp.database.cayenne.objects.Prestadores)readProperty("toPrestadores");
|
||||
}
|
||||
|
||||
|
||||
public void setToPrtGruposProtocolo(siprp.database.cayenne.objects.PrtGruposProtocolo toPrtGruposProtocolo) {
|
||||
public Prestadores getToPrestadores() {
|
||||
return (Prestadores)readProperty("toPrestadores");
|
||||
}
|
||||
|
||||
|
||||
public void setToPrtGruposProtocolo(PrtGruposProtocolo toPrtGruposProtocolo) {
|
||||
setToOneTarget("toPrtGruposProtocolo", toPrtGruposProtocolo, true);
|
||||
}
|
||||
|
||||
public siprp.database.cayenne.objects.PrtGruposProtocolo getToPrtGruposProtocolo() {
|
||||
return (siprp.database.cayenne.objects.PrtGruposProtocolo)readProperty("toPrtGruposProtocolo");
|
||||
}
|
||||
|
||||
|
||||
public PrtGruposProtocolo getToPrtGruposProtocolo() {
|
||||
return (PrtGruposProtocolo)readProperty("toPrtGruposProtocolo");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.RiscoMedida;
|
||||
|
||||
/**
|
||||
* Class _Risco was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _Risco extends CayenneDataObject {
|
||||
|
||||
public static final String DESCRIPTION_PROPERTY = "description";
|
||||
public static final String VALUE_PROPERTY = "value";
|
||||
public static final String RISCO_MEDIDA_ARRAY_PROPERTY = "riscoMedidaArray";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setDescription(String description) {
|
||||
writeProperty("description", description);
|
||||
}
|
||||
public String getDescription() {
|
||||
return (String)readProperty("description");
|
||||
}
|
||||
|
||||
public void setValue(Integer value) {
|
||||
writeProperty("value", value);
|
||||
}
|
||||
public Integer getValue() {
|
||||
return (Integer)readProperty("value");
|
||||
}
|
||||
|
||||
public void addToRiscoMedidaArray(RiscoMedida obj) {
|
||||
addToManyTarget("riscoMedidaArray", obj, true);
|
||||
}
|
||||
public void removeFromRiscoMedidaArray(RiscoMedida obj) {
|
||||
removeToManyTarget("riscoMedidaArray", obj, true);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<RiscoMedida> getRiscoMedidaArray() {
|
||||
return (List<RiscoMedida>)readProperty("riscoMedidaArray");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.Medida;
|
||||
import siprp.database.cayenne.objects.Risco;
|
||||
|
||||
/**
|
||||
* Class _RiscoMedida was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _RiscoMedida extends CayenneDataObject {
|
||||
|
||||
public static final String TO_MEDIDA_PROPERTY = "toMedida";
|
||||
public static final String TO_RISCO_PROPERTY = "toRisco";
|
||||
|
||||
public static final String MEDIDA_ID_PK_COLUMN = "medida_id";
|
||||
public static final String RISCO_ID_PK_COLUMN = "risco_id";
|
||||
|
||||
public void setToMedida(Medida toMedida) {
|
||||
setToOneTarget("toMedida", toMedida, true);
|
||||
}
|
||||
|
||||
public Medida getToMedida() {
|
||||
return (Medida)readProperty("toMedida");
|
||||
}
|
||||
|
||||
|
||||
public void setToRisco(Risco toRisco) {
|
||||
setToOneTarget("toRisco", toRisco, true);
|
||||
}
|
||||
|
||||
public Risco getToRisco() {
|
||||
return (Risco)readProperty("toRisco");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package siprp.database.cayenne.objects.auto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
|
||||
import siprp.database.cayenne.objects.Prestadores;
|
||||
import siprp.database.cayenne.objects.PrtGruposProtocolo;
|
||||
|
||||
/**
|
||||
* Class _TrabalhadoresEcdsAnalise was generated by Cayenne.
|
||||
* It is probably a good idea to avoid changing this class manually,
|
||||
* since it may be overwritten next time code is regenerated.
|
||||
* If you need to make any customizations, please use subclass.
|
||||
*/
|
||||
public abstract class _TrabalhadoresEcdsAnalise extends CayenneDataObject {
|
||||
|
||||
public static final String DATA_PROPERTY = "data";
|
||||
public static final String TO_PRESTADORES_PROPERTY = "toPrestadores";
|
||||
public static final String TO_PRT_GRUPOS_PROTOCOLO_PROPERTY = "toPrtGruposProtocolo";
|
||||
|
||||
public static final String ID_PK_COLUMN = "id";
|
||||
|
||||
public void setData(Date data) {
|
||||
writeProperty("data", data);
|
||||
}
|
||||
public Date getData() {
|
||||
return (Date)readProperty("data");
|
||||
}
|
||||
|
||||
public void setToPrestadores(Prestadores toPrestadores) {
|
||||
setToOneTarget("toPrestadores", toPrestadores, true);
|
||||
}
|
||||
|
||||
public Prestadores getToPrestadores() {
|
||||
return (Prestadores)readProperty("toPrestadores");
|
||||
}
|
||||
|
||||
|
||||
public void setToPrtGruposProtocolo(PrtGruposProtocolo toPrtGruposProtocolo) {
|
||||
setToOneTarget("toPrtGruposProtocolo", toPrtGruposProtocolo, true);
|
||||
}
|
||||
|
||||
public PrtGruposProtocolo getToPrtGruposProtocolo() {
|
||||
return (PrtGruposProtocolo)readProperty("toPrtGruposProtocolo");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package siprp.database.cayenne.providers;
|
||||
|
||||
import org.apache.cayenne.DataObjectUtils;
|
||||
|
||||
import siprp.database.cayenne.objects.Empresas;
|
||||
import siprp.database.cayenne.objects.Image;
|
||||
import siprp.medicina.MedicinaConstants;
|
||||
|
||||
public class ImageDAO extends MainDAO implements MedicinaConstants
|
||||
{
|
||||
|
||||
public Image getImageForEmpresaID( Integer id )
|
||||
{
|
||||
Image result = null;
|
||||
Empresas empresa = (Empresas) DataObjectUtils.objectForPK( context, Empresas.class, id );
|
||||
if( empresa != null )
|
||||
{
|
||||
result = empresa.getToLogotipo();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setImageForEmpresaID( Integer id, byte [] imageData )
|
||||
{
|
||||
Empresas empresa = (Empresas) DataObjectUtils.objectForPK( context, Empresas.class, id );
|
||||
if( empresa != null )
|
||||
{
|
||||
Image logo = null;
|
||||
if( imageData != null )
|
||||
{
|
||||
logo = (Image) context.newObject( Image.class );
|
||||
logo.setImageData( imageData );
|
||||
logo.setName( "Logotipo: " + empresa.getDesignacaoSocial() );
|
||||
}
|
||||
empresa.setToLogotipo( logo );
|
||||
context.commitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,236 @@
|
||||
package siprp.database.cayenne.providers;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cayenne.CayenneDataObject;
|
||||
import org.apache.cayenne.DataObjectUtils;
|
||||
import org.apache.cayenne.query.SelectQuery;
|
||||
|
||||
import siprp.database.cayenne.objects.EmailPlanoDeActuacao;
|
||||
import siprp.database.cayenne.objects.Estabelecimentos;
|
||||
import siprp.database.cayenne.objects.Legislacao;
|
||||
import siprp.database.cayenne.objects.LegislacaoEstabelecimento;
|
||||
import siprp.database.cayenne.objects.Medida;
|
||||
import siprp.database.cayenne.objects.PostoDeTrabalho;
|
||||
import siprp.database.cayenne.objects.PostoDeTrabalhoEstabelecimento;
|
||||
import siprp.database.cayenne.objects.Risco;
|
||||
import siprp.database.cayenne.objects.RiscoMedida;
|
||||
import siprp.medicina.MedicinaConstants;
|
||||
|
||||
public class PlanoActuacaoDAO extends MainDAO implements MedicinaConstants
|
||||
{
|
||||
|
||||
public Estabelecimentos getEstabelecimentoByID( Integer id )
|
||||
{
|
||||
return (Estabelecimentos) DataObjectUtils.objectForPK( context, Estabelecimentos.class, id );
|
||||
}
|
||||
|
||||
public void commit()
|
||||
{
|
||||
context.commitChanges();
|
||||
}
|
||||
|
||||
public void delete( CayenneDataObject object )
|
||||
{
|
||||
if( object != null )
|
||||
{
|
||||
context.deleteObject( object );
|
||||
context.commitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public void addEmailToEstabelecimento( String email, Estabelecimentos estabelecimento )
|
||||
{
|
||||
EmailPlanoDeActuacao emailObject = (EmailPlanoDeActuacao) context.newObject( EmailPlanoDeActuacao.class );
|
||||
emailObject.setDescription( email );
|
||||
emailObject.setToEstabelecimentos( estabelecimento );
|
||||
context.commitChanges();
|
||||
}
|
||||
|
||||
public Legislacao createLegislacao( String legislacao )
|
||||
{
|
||||
Legislacao legislacaoObject = (Legislacao) context.newObject( Legislacao.class );
|
||||
legislacaoObject.setDescription( legislacao );
|
||||
context.commitChanges();
|
||||
return legislacaoObject;
|
||||
}
|
||||
|
||||
public PostoDeTrabalho createPostoTrabalho( String postoTrabalho )
|
||||
{
|
||||
PostoDeTrabalho postoTrabalhoObject = (PostoDeTrabalho) context.newObject( PostoDeTrabalho.class );
|
||||
postoTrabalhoObject.setDescription( postoTrabalho );
|
||||
context.commitChanges();
|
||||
return postoTrabalhoObject;
|
||||
}
|
||||
|
||||
public void addLegislacaoToEstabelecimento( Legislacao legislacao, Estabelecimentos estabelecimento )
|
||||
{
|
||||
LegislacaoEstabelecimento rel = (LegislacaoEstabelecimento) context.newObject( LegislacaoEstabelecimento.class );
|
||||
rel.setToEstabelecimentos( estabelecimento );
|
||||
rel.setToLegislacao( legislacao );
|
||||
context.commitChanges();
|
||||
}
|
||||
|
||||
public void addPostoTrabalhoToEstabelecimento( PostoDeTrabalho postoTrabalho, Estabelecimentos estabelecimento )
|
||||
{
|
||||
PostoDeTrabalhoEstabelecimento rel = (PostoDeTrabalhoEstabelecimento) context.newObject( PostoDeTrabalhoEstabelecimento.class );
|
||||
rel.setToEstabelecimentos( estabelecimento );
|
||||
rel.setToPostoDeTrabalho( postoTrabalho );
|
||||
context.commitChanges();
|
||||
}
|
||||
|
||||
private boolean containsPostoTrabalho( List<PostoDeTrabalhoEstabelecimento> rels, Estabelecimentos estabelecimento )
|
||||
{
|
||||
boolean result = false;
|
||||
for( PostoDeTrabalhoEstabelecimento rel : rels )
|
||||
{
|
||||
if( rel.getToEstabelecimentos().equals( estabelecimento ) )
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean containsLegislacao( List<LegislacaoEstabelecimento> rels, Estabelecimentos estabelecimento )
|
||||
{
|
||||
boolean result = false;
|
||||
for( LegislacaoEstabelecimento rel : rels )
|
||||
{
|
||||
if( rel.getToEstabelecimentos().equals( estabelecimento ) )
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public PostoDeTrabalho [] getAllPostosNotInEstabelecimento( Estabelecimentos estabelecimento )
|
||||
{
|
||||
List<PostoDeTrabalho> result = new LinkedList<PostoDeTrabalho>();
|
||||
SelectQuery query = new SelectQuery( PostoDeTrabalho.class );
|
||||
List<PostoDeTrabalho> res = context.performQuery( query );
|
||||
if( res != null )
|
||||
{
|
||||
for( PostoDeTrabalho posto : res )
|
||||
{
|
||||
if( !containsPostoTrabalho( posto.getPostoDeTrabalhoEstabelecimentoArray() , estabelecimento ) )
|
||||
{
|
||||
result.add( posto );
|
||||
}
|
||||
}
|
||||
Collections.sort( result, new Comparator<PostoDeTrabalho>()
|
||||
{
|
||||
@Override
|
||||
public int compare( PostoDeTrabalho o1, PostoDeTrabalho o2 )
|
||||
{
|
||||
return o1.getDescription().compareTo( o2.getDescription() );
|
||||
}
|
||||
});
|
||||
}
|
||||
return result.toArray( new PostoDeTrabalho[ result.size() ] );
|
||||
}
|
||||
|
||||
public Legislacao [] getAllLegislacoesNotInEstabelecimento( Estabelecimentos estabelecimento )
|
||||
{
|
||||
List<Legislacao> result = new LinkedList<Legislacao>();
|
||||
SelectQuery query = new SelectQuery( Legislacao.class );
|
||||
List<Legislacao> res = context.performQuery( query );
|
||||
if( res != null )
|
||||
{
|
||||
for( Legislacao legislacao : res )
|
||||
{
|
||||
if( !containsLegislacao( legislacao.getLegislacaoEstabelecimentoArray(), estabelecimento ) )
|
||||
{
|
||||
result.add( legislacao );
|
||||
}
|
||||
}
|
||||
Collections.sort( result, new Comparator<Legislacao>()
|
||||
{
|
||||
@Override
|
||||
public int compare( Legislacao o1, Legislacao o2 )
|
||||
{
|
||||
return o1.getDescription().compareTo( o2.getDescription() );
|
||||
}
|
||||
});
|
||||
}
|
||||
return result.toArray( new Legislacao[ result.size() ] );
|
||||
}
|
||||
|
||||
public Medida createMedida( String medida )
|
||||
{
|
||||
Medida medidaObject = (Medida) context.newObject( Medida.class );
|
||||
medidaObject.setDescription( medida );
|
||||
context.commitChanges();
|
||||
return medidaObject;
|
||||
}
|
||||
|
||||
private boolean containsMedidas( List<RiscoMedida> rels, Risco risco )
|
||||
{
|
||||
boolean result = false;
|
||||
for( RiscoMedida rel : rels )
|
||||
{
|
||||
if( rel.getToRisco().equals( risco ) )
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Medida[] getAllMedidasNotInRisco( Risco risco )
|
||||
{
|
||||
List<Medida> result = new LinkedList<Medida>();
|
||||
SelectQuery query = new SelectQuery( Medida.class );
|
||||
List<Medida> res = context.performQuery( query );
|
||||
if( res != null )
|
||||
{
|
||||
for( Medida medida : res )
|
||||
{
|
||||
if( !containsMedidas( medida.getRiscoMedidaArray(), risco ) )
|
||||
{
|
||||
result.add( medida );
|
||||
}
|
||||
}
|
||||
Collections.sort( result, new Comparator<Medida>()
|
||||
{
|
||||
@Override
|
||||
public int compare( Medida o1, Medida o2 )
|
||||
{
|
||||
return o1.getDescription().compareTo( o2.getDescription() );
|
||||
}
|
||||
});
|
||||
}
|
||||
return result.toArray( new Medida[ result.size() ] );
|
||||
}
|
||||
|
||||
public List<Risco> getAllRiscos()
|
||||
{
|
||||
SelectQuery query = new SelectQuery(Risco.class);
|
||||
List<Risco> result = context.performQuery( query );
|
||||
return result;
|
||||
}
|
||||
|
||||
public void addMedidaToRisco( Medida medida, Risco risco )
|
||||
{
|
||||
RiscoMedida rel = (RiscoMedida) context.newObject( RiscoMedida.class );
|
||||
rel.setToMedida( medida );
|
||||
rel.setToRisco( risco );
|
||||
context.commitChanges();
|
||||
}
|
||||
|
||||
public void createRisco( String risco, Integer valorInt )
|
||||
{
|
||||
Risco riscoObject = (Risco) context.newObject( Risco.class );
|
||||
riscoObject.setDescription( risco );
|
||||
riscoObject.setValue( valorInt );
|
||||
context.commitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* V8_1_To_V8_2.java
|
||||
*
|
||||
* Created on December 19, 2007, 3:12 PM
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package siprp.update.updates;
|
||||
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.db.DBManager;
|
||||
import com.evolute.utils.db.Executer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fpalma
|
||||
*/
|
||||
public class V8_9_To_V9_0
|
||||
implements siprp.update.Update
|
||||
{
|
||||
|
||||
public V8_9_To_V9_0()
|
||||
{
|
||||
}
|
||||
|
||||
public String []listChanges()
|
||||
{
|
||||
return new String[]{
|
||||
"Criar tabela 'posto_de_trabalho'",
|
||||
"Criar tabela 'legislacao'",
|
||||
"Criar tabela relacional 'posto_de_trabalho_estabelecimento'",
|
||||
"Criar tabela relacional 'legislacao_estabelecimento'",
|
||||
"Criar tabela 'medida'",
|
||||
"Criar tabela 'risco'",
|
||||
"Criar tabela 'medida'",
|
||||
"Criar tabela relacional 'risco_medida'",
|
||||
"Criar tabela 'image'",
|
||||
"Adicionar logotipo a empresa"
|
||||
};
|
||||
}
|
||||
|
||||
public double getStartVersion()
|
||||
{
|
||||
return 8.9;
|
||||
}
|
||||
|
||||
public double getEndVersion()
|
||||
{
|
||||
return 9.0;
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
throws Exception
|
||||
{
|
||||
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
|
||||
Executer executer = dbm.getSharedExecuter();
|
||||
com.evolute.utils.sql.Update update =
|
||||
new com.evolute.utils.sql.Update(
|
||||
"create table email_plano_de_actuacao(" +
|
||||
"id serial PRIMARY KEY," +
|
||||
"description varchar(255) NOT NULL," +
|
||||
"estabelecimento_id int4 REFERENCES estabelecimentos(id)" +
|
||||
");" +
|
||||
"create table posto_de_trabalho(" +
|
||||
"id serial PRIMARY KEY," +
|
||||
"description varchar(1024) NOT NULL" +
|
||||
");" +
|
||||
"create table legislacao(" +
|
||||
"id serial PRIMARY KEY," +
|
||||
"description varchar(1024) NOT NULL" +
|
||||
");" +
|
||||
"create table posto_de_trabalho_estabelecimento(" +
|
||||
"posto_de_trabalho_id int4 REFERENCES posto_de_trabalho(id) NOT NULL," +
|
||||
"estabelecimento_id int4 REFERENCES estabelecimentos(id) NOT NULL," +
|
||||
"CONSTRAINT posto_de_trabalho_estabelecimento_pkey PRIMARY KEY(posto_de_trabalho_id, estabelecimento_id)" +
|
||||
");" +
|
||||
"create table legislacao_estabelecimento(" +
|
||||
"legislacao_id int4 REFERENCES legislacao(id) NOT NULL," +
|
||||
"estabelecimento_id int4 REFERENCES estabelecimentos(id) NOT NULL," +
|
||||
"CONSTRAINT legislacao_estabelecimento_pkey PRIMARY KEY(legislacao_id, estabelecimento_id)" +
|
||||
");" +
|
||||
"create table risco(" +
|
||||
"id serial PRIMARY KEY," +
|
||||
"description varchar(255) NOT NULL," +
|
||||
"value int4 NOT NULL" +
|
||||
");" +
|
||||
"create table medida(" +
|
||||
"id serial PRIMARY KEY," +
|
||||
"description varchar(255) NOT NULL" +
|
||||
");" +
|
||||
"create table risco_medida(" +
|
||||
"risco_id int4 REFERENCES risco(id) NOT NULL," +
|
||||
"medida_id int4 REFERENCES medida(id) NOT NULL," +
|
||||
"CONSTRAINT risco_medida_pkey PRIMARY KEY(risco_id, medida_id)" +
|
||||
");" +
|
||||
"create table image(" +
|
||||
"id serial PRIMARY KEY," +
|
||||
"name varchar(255) NOT NULL," +
|
||||
"image_data bytea NOT NULL" +
|
||||
");" +
|
||||
"alter table empresas add column empresa_logo_id int4 REFERENCES image(id);"
|
||||
);
|
||||
executer.executeQuery( update );
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "v" + getStartVersion() + " para v" + getEndVersion();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue