git-svn-id: https://svn.coded.pt/svn/SIPRP@1062 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
Tiago Simão 17 years ago
parent d60d31fc13
commit f0d448ce5e

@ -344,14 +344,7 @@ public class GerirMedidasRelatorioPanel extends JPanel
if( posto != null )
{
List<HsRelatorioPostoRisco> list = posto.getHsRelatorioPostoRiscoArray();
Collections.sort( list, new Comparator<HsRelatorioPostoRisco>()
{
@Override
public int compare( HsRelatorioPostoRisco o1, HsRelatorioPostoRisco o2 )
{
return o1.getId().compareTo( o2.getId() );
}
} );
Collections.sort( list );
for( HsRelatorioPostoRisco rel : list )
{
RiscoRelatorioNode node = new RiscoRelatorioNode( rel );
@ -370,7 +363,24 @@ public class GerirMedidasRelatorioPanel extends JPanel
}
}
setEnabled();
// TreeTools.sort( root );
TreeTools.sort( root, new Comparator<DefaultMutableTreeNode>()
{
@Override
public int compare( DefaultMutableTreeNode o1, DefaultMutableTreeNode o2 )
{
Integer result = null;
if( (o1 instanceof RiscoRelatorioNode) && o2 instanceof RiscoRelatorioNode )
{
HsRelatorioPostoRisco risco1 = (HsRelatorioPostoRisco) o1.getUserObject();
HsRelatorioPostoRisco risco2 = (HsRelatorioPostoRisco) o2.getUserObject();
if( risco1 != null )
{
return risco1.compareTo( risco2 == null ? null : risco2 );
}
}
return result == null ? o1.toString().compareTo( o2.toString() ) : result;
}
});
TreeTools.refreshTree( tree, root, false );
if( selectedMedida != null )
{

@ -336,7 +336,7 @@ public class MedicinaProcessoLogic extends LeafLogic
Integer tipoID = lembretesDataProvider.getTipoLembreteIDByCodigo( LembretesConstants.CODE_REMARCACOES );
try
{
if( isConsulta )
if( isConsulta && currentEmpresa != null && currentEstabelecimento != null && currentTrabalhador != null && currentConsultaMarcacao != null )
{
lembretesDataProvider.criarLembreteConsulta( tipoID, new Date(), mensagem, null, currentEmpresa.getId(), currentEstabelecimento.getId(), currentTrabalhador.getId(), currentConsultaMarcacao.getId() );
}
@ -344,7 +344,8 @@ public class MedicinaProcessoLogic extends LeafLogic
{
lembretesDataProvider.criarLembreteExame( tipoID, new Date(), mensagem, null, currentEmpresa.getId(), currentEstabelecimento.getId(), currentTrabalhador.getId(), currentExameMarcacao.getId() );
}
} catch( Exception e )
}
catch( Exception e )
{
e.printStackTrace();
}

@ -16,7 +16,7 @@ public class V11_2_To_V11_3 implements siprp.update.Update
public String []listChanges()
{
return new String[]{
"Higiene e seguranca: a repor datas de submissao dos relatorios"
"Higiene e seguranca: restruturacao"
};
}
@ -36,35 +36,12 @@ public class V11_2_To_V11_3 implements siprp.update.Update
Executer executer = dbm.getSharedExecuter();
com.evolute.utils.sql.Update update =
new com.evolute.utils.sql.Update(
"alter table hs_relatorio_posto_risco add column id serial; " +
"create table hs_relatorio_posto_risco_temp( " +
"id serial, " +
" posto_id integer NOT NULL, " +
" risco_id integer NOT NULL, " +
" probabilidade integer, " +
" severidade integer, " +
" valor_qualitativo_id integer, " +
"CONSTRAINT hs_relatorio_posto_risco_temp_pkey PRIMARY KEY (posto_id, risco_id), " +
"CONSTRAINT hs_relatorio_posto_risco_posto_id_fkey FOREIGN KEY (posto_id) " +
"REFERENCES hs_relatorio_posto (id) MATCH SIMPLE " +
"ON UPDATE NO ACTION ON DELETE NO ACTION, " +
"CONSTRAINT hs_relatorio_posto_risco_risco_id_fkey FOREIGN KEY (risco_id) " +
"REFERENCES hs_relatorio_risco (id) MATCH SIMPLE " +
"ON UPDATE NO ACTION ON DELETE NO ACTION, " +
"CONSTRAINT hs_relatorio_posto_risco_valor_qualitativo_id_fkey FOREIGN KEY (valor_qualitativo_id) " +
"REFERENCES hs_relatorio_risco_valor_qualitativo (id) MATCH SIMPLE " +
"ON UPDATE NO ACTION ON DELETE NO ACTION " +
"); " +
"ALTER TABLE hs_relatorio_posto_risco OWNER TO postgres; " +
"insert into hs_relatorio_posto_risco_temp (posto_id,risco_id,probabilidade,severidade,valor_qualitativo_id) " +
" (select posto_id,risco_id,probabilidade,severidade,valor_qualitativo_id from hs_relatorio_posto_risco); " +
"update hs_relatorio_posto_risco set id = (select hs_relatorio_posto_risco_temp.id from hs_relatorio_posto_risco_temp " +
"where hs_relatorio_posto_risco_temp.posto_id = hs_relatorio_posto_risco.posto_id " +
"and hs_relatorio_posto_risco_temp.risco_id = hs_relatorio_posto_risco.risco_id); " +
"alter table hs_relatorio_posto_risco add constraint hs_relatorio_posto_risco_unique UNIQUE(posto_id,risco_id); " +
"alter table hs_relatorio_posto_risco drop constraint hs_relatorio_posto_risco_pkey; " +
"alter table hs_relatorio_posto_risco add constraint hs_relatorio_posto_risco_pkey PRIMARY KEY(id); " +
"drop table hs_relatorio_posto_risco_temp; "
"alter table hs_posto add column is_principal boolean; " +
"alter table hs_relatorio_posto add column is_principal boolean; " +
"alter table hs_relatorio_area add column ordem int4; " +
"alter table hs_area add column ordem int4; " +
"alter table hs_relatorio_posto_risco add column ordem int4; " +
"alter table hs_posto_risco add column ordem int4; "
);
executer.executeQuery( update );
new Importador( executer ).importar();

@ -6,6 +6,7 @@
<property name="defaultLockType" value="optimistic"/>
<property name="defaultPackage" value="siprp.database.cayenne.objects"/>
<property name="defaultSchema" value="public"/>
<property name="quoteSqlIdentifiers" value="true"/>
<db-entity name="avisos" schema="public">
<db-attribute name="data_aviso" type="DATE" isMandatory="true" length="13"/>
<db-attribute name="data_evento" type="DATE" length="13"/>
@ -189,6 +190,7 @@
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="1024"/>
<db-attribute name="empresa_id" type="INTEGER" length="10"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="ordem" type="INTEGER"/>
<db-key-generator>
<db-generator-type>ORACLE</db-generator-type>
<db-generator-name>hs_area_id_seq</db-generator-name>
@ -289,6 +291,7 @@
<db-attribute name="deleted_date" type="TIMESTAMP"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="1024"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="is_principal" type="BOOLEAN"/>
<db-key-generator>
<db-generator-type>ORACLE</db-generator-type>
<db-generator-name>hs_posto_id_seq</db-generator-name>
@ -305,6 +308,7 @@
</db-entity>
<db-entity name="hs_posto_risco" schema="public">
<db-attribute name="is_plano_actuacao" type="CHAR" length="1"/>
<db-attribute name="ordem" type="INTEGER"/>
<db-attribute name="posto_id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="probabilidade" type="INTEGER" length="10"/>
<db-attribute name="risco_id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
@ -335,6 +339,7 @@
<db-attribute name="deleted_date" type="TIMESTAMP" length="29"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="1024"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="ordem" type="INTEGER"/>
<db-attribute name="relatorio_id" type="INTEGER" length="10"/>
<db-key-generator>
<db-generator-type>ORACLE</db-generator-type>
@ -397,6 +402,7 @@
<db-attribute name="deleted_date" type="TIMESTAMP" length="29"/>
<db-attribute name="description" type="VARCHAR" isMandatory="true" length="1024"/>
<db-attribute name="id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="is_principal" type="BOOLEAN"/>
<db-key-generator>
<db-generator-type>ORACLE</db-generator-type>
<db-generator-name>hs_relatorio_posto_id_seq</db-generator-name>
@ -409,7 +415,7 @@
<db-attribute name="posto_id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
</db-entity>
<db-entity name="hs_relatorio_posto_risco" schema="public">
<db-attribute name="id" type="INTEGER" length="10"/>
<db-attribute name="ordem" type="INTEGER"/>
<db-attribute name="posto_id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="probabilidade" type="INTEGER" length="10"/>
<db-attribute name="risco_id" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
@ -951,6 +957,7 @@
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="empresaId" type="java.lang.Integer" db-attribute-path="empresa_id"/>
<obj-attribute name="order" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="HsEmail" className="siprp.database.cayenne.objects.HsEmail" dbEntityName="hs_email" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="email" type="java.lang.String" db-attribute-path="email"/>
@ -998,6 +1005,7 @@
<obj-entity name="HsPosto" className="siprp.database.cayenne.objects.HsPosto" dbEntityName="hs_posto" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="isPrincipal" type="java.lang.Boolean" db-attribute-path="is_principal"/>
</obj-entity>
<obj-entity name="HsPostoEstabelecimento" className="siprp.database.cayenne.objects.HsPostoEstabelecimento" dbEntityName="hs_posto_estabelecimento" superClassName="siprp.database.cayenne.objects.BaseObject">
</obj-entity>
@ -1005,6 +1013,7 @@
</obj-entity>
<obj-entity name="HsPostoRisco" className="siprp.database.cayenne.objects.HsPostoRisco" dbEntityName="hs_posto_risco" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="isPlanoActuacao" type="java.lang.String" db-attribute-path="is_plano_actuacao"/>
<obj-attribute name="order" type="java.lang.Integer" db-attribute-path="ordem"/>
<obj-attribute name="probabilidade" type="java.lang.Integer" db-attribute-path="probabilidade"/>
<obj-attribute name="severidade" type="java.lang.Integer" db-attribute-path="severidade"/>
<obj-attribute name="valorQualitativo" type="java.lang.Integer" db-attribute-path="valor_qualitativo"/>
@ -1026,6 +1035,7 @@
<obj-entity name="HsRelatorioArea" className="siprp.database.cayenne.objects.HsRelatorioArea" dbEntityName="hs_relatorio_area" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="order" type="java.lang.Integer" db-attribute-path="ordem"/>
</obj-entity>
<obj-entity name="HsRelatorioEquipamento" className="siprp.database.cayenne.objects.HsRelatorioEquipamento" dbEntityName="hs_relatorio_equipamento" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="hsEquipamento" type="java.lang.Integer" db-attribute-path="hs_equipamento"/>
@ -1053,12 +1063,13 @@
<obj-entity name="HsRelatorioPosto" className="siprp.database.cayenne.objects.HsRelatorioPosto" dbEntityName="hs_relatorio_posto" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="deletedDate" type="java.util.Date" db-attribute-path="deleted_date"/>
<obj-attribute name="description" type="java.lang.String" db-attribute-path="description"/>
<obj-attribute name="isPrincipal" type="java.lang.Boolean" db-attribute-path="is_principal"/>
</obj-entity>
<obj-entity name="HsRelatorioPostoMedida" className="siprp.database.cayenne.objects.HsRelatorioPostoMedida" dbEntityName="hs_relatorio_posto_medida" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="isPlanoActuacao" type="java.lang.Boolean" db-attribute-path="is_plano_actuacao"/>
</obj-entity>
<obj-entity name="HsRelatorioPostoRisco" className="siprp.database.cayenne.objects.HsRelatorioPostoRisco" dbEntityName="hs_relatorio_posto_risco" superClassName="siprp.database.cayenne.objects.BaseObject">
<obj-attribute name="id" type="java.lang.Integer" db-attribute-path="id"/>
<obj-attribute name="order" type="java.lang.Integer" db-attribute-path="ordem"/>
<obj-attribute name="probabilidade" type="java.lang.Integer" db-attribute-path="probabilidade"/>
<obj-attribute name="severidade" type="java.lang.Integer" db-attribute-path="severidade"/>
</obj-entity>
@ -1955,6 +1966,7 @@
<obj-relationship name="toHsPosto" source="HsPostoMedida" target="HsPosto" deleteRule="Nullify" db-relationship-path="toHsPosto"/>
<obj-relationship name="toHsPosto" source="HsPostoRisco" target="HsPosto" deleteRule="Nullify" db-relationship-path="toHsPosto"/>
<obj-relationship name="toHsRelatorioRiscoValorQualitativo" source="HsPostoRisco" target="HsRelatorioRiscoValorQualitativo" deleteRule="Nullify" db-relationship-path="toHsRelatorioRiscoValorQualitativo"/>
<obj-relationship name="toHsRelatorioRiscoValorQualitativo1" source="HsPostoRisco" target="HsRelatorioRiscoValorQualitativo" deleteRule="Nullify" db-relationship-path="toHsRelatorioRiscoValorQualitativo1"/>
<obj-relationship name="toHsRisco" source="HsPostoRisco" target="HsRisco" deleteRule="Nullify" db-relationship-path="toHsRisco"/>
<obj-relationship name="hsRelatorioArea" source="HsRelatorio" target="HsRelatorioArea" deleteRule="Cascade" db-relationship-path="hsRelatorioArea"/>
<obj-relationship name="hsRelatorioEquipamentoArray" source="HsRelatorio" target="HsRelatorioEquipamento" db-relationship-path="hsRelatorioEquipamentoArray"/>

@ -175,6 +175,25 @@ public class TreeTools
}
}
}
public static void sort( DefaultMutableTreeNode result, Comparator<DefaultMutableTreeNode> comparator )
{
if( result != null )
{
List<DefaultMutableTreeNode> children = new ArrayList<DefaultMutableTreeNode>(result.getChildCount());
for( int i = 0; i < result.getChildCount(); ++i )
{
children.add( (DefaultMutableTreeNode) result.getChildAt( i ) );
}
result.removeAllChildren();
Collections.sort( children, comparator );
for( DefaultMutableTreeNode child : children )
{
sort( child );
result.add( child );
}
}
}
public static TreePath getPathFor( DefaultMutableTreeNode node )
{

@ -85,7 +85,24 @@ public class BaseObject extends CayenneDataObject implements Comparable<BaseObje
@Override
public int compareTo( BaseObject object )
{
return StringPlainer.convertString( this.toString() ).compareTo( object == null ? null : StringPlainer.convertString( object.toString() ) );
int result = 0;
if( dao.hasOrder( this ) && dao.hasOrder( object ) )
{
Object o1 = this.readProperty( "ordem" );
if( o1 != null && (o1 instanceof Integer) )
{
Object o2 = this.readProperty( "ordem" );
if( o2 != null && (o2 instanceof Integer) )
{
result = ((Integer)o1).compareTo( (Integer)o2 );
}
}
}
else
{
StringPlainer.convertString( this.toString() ).compareTo( object == null ? null : StringPlainer.convertString( object.toString() ) );
}
return result;
}
}

@ -39,7 +39,7 @@ public class TrabalhadoresProcesso extends _TrabalhadoresProcesso implements Pro
@Override
public String toString()
{
return getDataInicioString() + ": " + getMotivoString() + " : " + getDescricaoEstadoProcessoByCodigo();
return getMotivoString() + " : " + getDescricaoEstadoProcessoByCodigo();
}
public HashMap<String, String> getEstados()

@ -18,6 +18,7 @@ public abstract class _HsArea extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String EMPRESA_ID_PROPERTY = "empresaId";
public static final String ORDER_PROPERTY = "order";
public static final String HS_POSTO_ARRAY_PROPERTY = "hsPostoArray";
public static final String TO_EMPRESAS_PROPERTY = "toEmpresas";
@ -44,6 +45,13 @@ public abstract class _HsArea extends BaseObject {
return (Integer)readProperty("empresaId");
}
public void setOrder(Integer order) {
writeProperty("order", order);
}
public Integer getOrder() {
return (Integer)readProperty("order");
}
public void addToHsPostoArray(HsPosto obj) {
addToManyTarget("hsPostoArray", obj, true);
}

@ -19,6 +19,7 @@ public abstract class _HsPosto extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String IS_PRINCIPAL_PROPERTY = "isPrincipal";
public static final String HS_POSTO_ESTABELECIMENTO_ARRAY_PROPERTY = "hsPostoEstabelecimentoArray";
public static final String HS_POSTO_MEDIDA_ARRAY_PROPERTY = "hsPostoMedidaArray";
public static final String HS_POSTO_RISCO_ARRAY_PROPERTY = "hsPostoRiscoArray";
@ -40,6 +41,13 @@ public abstract class _HsPosto extends BaseObject {
return (String)readProperty("description");
}
public void setIsPrincipal(Boolean isPrincipal) {
writeProperty("isPrincipal", isPrincipal);
}
public Boolean getIsPrincipal() {
return (Boolean)readProperty("isPrincipal");
}
public void addToHsPostoEstabelecimentoArray(HsPostoEstabelecimento obj) {
addToManyTarget("hsPostoEstabelecimentoArray", obj, true);
}

@ -14,11 +14,13 @@ import siprp.database.cayenne.objects.HsRisco;
public abstract class _HsPostoRisco extends BaseObject {
public static final String IS_PLANO_ACTUACAO_PROPERTY = "isPlanoActuacao";
public static final String ORDER_PROPERTY = "order";
public static final String PROBABILIDADE_PROPERTY = "probabilidade";
public static final String SEVERIDADE_PROPERTY = "severidade";
public static final String VALOR_QUALITATIVO_PROPERTY = "valorQualitativo";
public static final String TO_HS_POSTO_PROPERTY = "toHsPosto";
public static final String TO_HS_RELATORIO_RISCO_VALOR_QUALITATIVO_PROPERTY = "toHsRelatorioRiscoValorQualitativo";
public static final String TO_HS_RELATORIO_RISCO_VALOR_QUALITATIVO1_PROPERTY = "toHsRelatorioRiscoValorQualitativo1";
public static final String TO_HS_RISCO_PROPERTY = "toHsRisco";
public static final String POSTO_ID_PK_COLUMN = "posto_id";
@ -31,6 +33,13 @@ public abstract class _HsPostoRisco extends BaseObject {
return (String)readProperty("isPlanoActuacao");
}
public void setOrder(Integer order) {
writeProperty("order", order);
}
public Integer getOrder() {
return (Integer)readProperty("order");
}
public void setProbabilidade(Integer probabilidade) {
writeProperty("probabilidade", probabilidade);
}
@ -70,6 +79,15 @@ public abstract class _HsPostoRisco extends BaseObject {
}
public void setToHsRelatorioRiscoValorQualitativo1(HsRelatorioRiscoValorQualitativo toHsRelatorioRiscoValorQualitativo1) {
setToOneTarget("toHsRelatorioRiscoValorQualitativo1", toHsRelatorioRiscoValorQualitativo1, true);
}
public HsRelatorioRiscoValorQualitativo getToHsRelatorioRiscoValorQualitativo1() {
return (HsRelatorioRiscoValorQualitativo)readProperty("toHsRelatorioRiscoValorQualitativo1");
}
public void setToHsRisco(HsRisco toHsRisco) {
setToOneTarget("toHsRisco", toHsRisco, true);
}

@ -17,6 +17,7 @@ public abstract class _HsRelatorioArea extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String ORDER_PROPERTY = "order";
public static final String HS_RELATORIO_POSTO_ARRAY_PROPERTY = "hsRelatorioPostoArray";
public static final String TO_HS_RELATORIO_PROPERTY = "toHsRelatorio";
@ -36,6 +37,13 @@ public abstract class _HsRelatorioArea extends BaseObject {
return (String)readProperty("description");
}
public void setOrder(Integer order) {
writeProperty("order", order);
}
public Integer getOrder() {
return (Integer)readProperty("order");
}
public void addToHsRelatorioPostoArray(HsRelatorioPosto obj) {
addToManyTarget("hsRelatorioPostoArray", obj, true);
}

@ -18,6 +18,7 @@ public abstract class _HsRelatorioPosto extends BaseObject {
public static final String DELETED_DATE_PROPERTY = "deletedDate";
public static final String DESCRIPTION_PROPERTY = "description";
public static final String IS_PRINCIPAL_PROPERTY = "isPrincipal";
public static final String HS_RELATORIO_POSTO_MEDIDA_ARRAY_PROPERTY = "hsRelatorioPostoMedidaArray";
public static final String HS_RELATORIO_POSTO_RISCO_ARRAY_PROPERTY = "hsRelatorioPostoRiscoArray";
public static final String TO_HS_RELATORIO_AREA_PROPERTY = "toHsRelatorioArea";
@ -38,6 +39,13 @@ public abstract class _HsRelatorioPosto extends BaseObject {
return (String)readProperty("description");
}
public void setIsPrincipal(Boolean isPrincipal) {
writeProperty("isPrincipal", isPrincipal);
}
public Boolean getIsPrincipal() {
return (Boolean)readProperty("isPrincipal");
}
public void addToHsRelatorioPostoMedidaArray(HsRelatorioPostoMedida obj) {
addToManyTarget("hsRelatorioPostoMedidaArray", obj, true);
}

@ -13,7 +13,7 @@ import siprp.database.cayenne.objects.HsRelatorioRiscoValorQualitativo;
*/
public abstract class _HsRelatorioPostoRisco extends BaseObject {
public static final String ID_PROPERTY = "id";
public static final String ORDER_PROPERTY = "order";
public static final String PROBABILIDADE_PROPERTY = "probabilidade";
public static final String SEVERIDADE_PROPERTY = "severidade";
public static final String TO_HS_RELATORIO_POSTO_PROPERTY = "toHsRelatorioPosto";
@ -23,11 +23,11 @@ public abstract class _HsRelatorioPostoRisco extends BaseObject {
public static final String POSTO_ID_PK_COLUMN = "posto_id";
public static final String RISCO_ID_PK_COLUMN = "risco_id";
public void setId(Integer id) {
writeProperty("id", id);
public void setOrder(Integer order) {
writeProperty("order", order);
}
public Integer getId() {
return (Integer)readProperty("id");
public Integer getOrder() {
return (Integer)readProperty("order");
}
public void setProbabilidade(Integer probabilidade) {

@ -2,6 +2,8 @@ package siprp.database.cayenne.providers;
import org.apache.cayenne.access.DataContext;
import siprp.database.cayenne.objects.BaseObject;
public class MainDAO
{
protected static DataContext context = null;
@ -29,5 +31,10 @@ public class MainDAO
{
return context;
}
public boolean hasOrder( BaseObject baseObject )
{
return baseObject == null ? false : (null != baseObject.getObjEntity().getAttribute( "ordem" ) );
}
}

Loading…
Cancel
Save