diff --git a/trunk/AnaliseAcidentesTrabalho/.classpath b/trunk/AnaliseAcidentesTrabalho/.classpath new file mode 100644 index 00000000..bbf0b277 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.classpath @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/.project b/trunk/AnaliseAcidentesTrabalho/.project index 8122ace0..bb90c2fe 100644 --- a/trunk/AnaliseAcidentesTrabalho/.project +++ b/trunk/AnaliseAcidentesTrabalho/.project @@ -5,7 +5,32 @@ + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/.jsdtscope b/trunk/AnaliseAcidentesTrabalho/.settings/.jsdtscope new file mode 100644 index 00000000..1db10bca --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.jdt.core.prefs b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..8000cd6c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.component b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..fcf6d3bd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.component @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 00000000..9b4b9fcf --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.project.facet.core.xml b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..ba69a57e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.jsdt.ui.superType.container b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 00000000..3bd5d0a4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.jsdt.ui.superType.name b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 00000000..05bd71b6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Acesso.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Acesso.java new file mode 100644 index 00000000..568fba74 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Acesso.java @@ -0,0 +1,329 @@ +/* + * Acesso.java + * + * Created on Oct 15, 2008, 9:49:21 AM + */ + +package analiseacidentestrabalho; + +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.StaticText; +import db.providers.AnalisesDataProvider; +import db.providers.UtilizadoresDataProvider; +import global.Global; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import utils.JSFUtils; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ * + * @author lluis + */ +public class Acesso extends AbstractPageBean +{ + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + + } + private StaticText stWelcome = new StaticText(); + + public StaticText getStWelcome() + { + return stWelcome; + } + + public void setStWelcome(StaticText st) + { + this.stWelcome = st; + } + private DropDown drpEstabelecimentos = new DropDown(); + + public DropDown getDrpEstabelecimentos() + { + return drpEstabelecimentos; + } + + public void setDrpEstabelecimentos(DropDown dd) + { + this.drpEstabelecimentos = dd; + } + private HtmlPanelGrid gridEstabelecimento = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridEstabelecimento() + { + return gridEstabelecimento; + } + + public void setGridEstabelecimento(HtmlPanelGrid hpg) + { + this.gridEstabelecimento = hpg; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public Acesso() + { + + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log("Acesso Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + Utilizador u = getSessionBean1().getCurrentUser(); + String nomeHtml = Utils.unicodeToHTML( u.getNome() ); + stWelcome.setText("Bem vindo(a) " + nomeHtml); + + if ( u.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR ) + { + initializeEstabelecimentos(); + } + else + { + gridEstabelecimento.setRendered( false ); + } + + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ * + */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean("ApplicationBean1"); + } + + + + public String lnkAnalisesAcidente_action() { + // TODO: Replace with your code + return null; + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + return null; + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + return null; + } + + public String lnkAjuda_action() { + // TODO: Replace with your code + return null; + } + + public String lnkLogout_action() + { + FacesContext fc = getFacesContext(); + try + { + JSFUtils.logout( fc, false ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + return "login"; + } + + public String lnkAnalises_action() + { + String page = "gestor"; + + Utilizador u = getSessionBean1().getCurrentUser(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Integer permissao = udp.getPermissionCode( u.getId() ); + if ( permissao != null ) + { + switch ( permissao.intValue() ) + { + case 1: //seguranca + page = "form_seguranca"; + break; + case 2: //rh + page = "form_rh"; + break; + case 3: //hs + page = "form_hs"; + break; + case 6: //gestor + Integer estabelecimento = null; + if(u.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR) + { + estabelecimento = (Integer) drpEstabelecimentos.getSelected(); + u.setEstabelecimento_gestor( estabelecimento ); + } + page = "form_gestor"; + break; + case 7: //dir ger rh + page = "form_dir_ger_rh"; + break; + case 8: //dir_siprp + page = "form_dir_siprp"; + break; + default: + page = "gestor"; + break; + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + page = "gestor"; + } + + return page; + } + + public String lnkPlanos_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); + FacesContext fc = getFacesContext().getCurrentInstance(); + + Integer estabelecimento = null; + if ( u.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR ) + { + estabelecimento = ( Integer ) drpEstabelecimentos.getSelected(); + u.setEstabelecimento_gestor( estabelecimento ); + } + + Global.redirectToPlanos( fc, u ); + return null; + } + + private void initializeEstabelecimentos() + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + com.sun.rave.web.ui.model.Option[] listGestorOptions = adp.getEstabelecimentosGestorList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean( true ) ); + getSessionBean1().setEstabelecimentosGestorOptions( listGestorOptions ); + drpEstabelecimentos.setSelected( new Integer( 0 ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java new file mode 100644 index 00000000..d09cad9e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java @@ -0,0 +1,15730 @@ +/* + * AnaliseAcidenteTrabalho.java + * + * Created on September 28, 2007, 3:56 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Estabelecimento; +import beans.Recomendacao; +import beans.Seccao; +import beans.Causa; +import beans.Medico; +import beans.Medida; +import beans.Trabalhador; +import beans.Utilizador; +import beans.Acidentado; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.evolute.utils.strings.StringPlainer; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Checkbox; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.ImageHyperlink; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.RadioButton; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextArea; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.DefaultTableDataProvider; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; +import db.providers.AnalisesDataProvider; +import db.providers.TrabalhadoresListDataProvider; +import db.providers.UtilizadoresDataProvider; +import global.Global; +import java.io.File; +import java.sql.Time; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.ListIterator; +import java.util.Properties; +import javax.activation.DataHandler; +import javax.faces.FacesException; +import javax.faces.FactoryFinder; +import javax.faces.application.ApplicationFactory; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.el.MethodBinding; +import javax.faces.event.ActionEvent; +import javax.faces.event.ValueChangeEvent; +import javax.mail.*; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; +import javax.mail.util.ByteArrayDataSource; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import org.apache.commons.validator.EmailValidator; +import pagestate.AnaliseAcidenteTrabalhoState; +import pdf.PdfGenerator; +import shst.companydataloaders.SIPRPPropertiesLoader; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class AnaliseAcidenteTrabalho extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridMsg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg() + { + return gridMsg; + } + + public void setGridMsg( HtmlPanelGrid hpg ) + { + this.gridMsg = hpg; + } + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() + { + return txtMsg; + } + + public void setTxtMsg( StaticText st ) + { + this.txtMsg = st; + } + private HtmlPanelGrid gridCabecalho = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCabecalho() + { + return gridCabecalho; + } + + public void setGridCabecalho( HtmlPanelGrid hpg ) + { + this.gridCabecalho = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText lblEmpresa1 = new StaticText(); + + public StaticText getLblEmpresa1() + { + return lblEmpresa1; + } + + public void setLblEmpresa1( StaticText st ) + { + this.lblEmpresa1 = st; + } + private StaticText txtEmpresa = new StaticText(); + + public StaticText getTxtEmpresa() + { + return txtEmpresa; + } + + public void setTxtEmpresa( StaticText st ) + { + this.txtEmpresa = st; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private StaticText txtEstabelecimento = new StaticText(); + + public StaticText getTxtEstabelecimento() + { + return txtEstabelecimento; + } + + public void setTxtEstabelecimento( StaticText st ) + { + this.txtEstabelecimento = st; + } + private StaticText txtTrabalhador = new StaticText(); + + public StaticText getTxtTrabalhador() + { + return txtTrabalhador; + } + + public void setTxtTrabalhador( StaticText st ) + { + this.txtTrabalhador = st; + } + private HtmlPanelGrid gridTrabalhadores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTrabalhadores() + { + return gridTrabalhadores; + } + + public void setGridTrabalhadores( HtmlPanelGrid hpg ) + { + this.gridTrabalhadores = hpg; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private HtmlPanelGrid gridSiprp = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSiprp() + { + return gridSiprp; + } + + public void setGridSiprp( HtmlPanelGrid hpg ) + { + this.gridSiprp = hpg; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() + { + return staticText9; + } + + public void setStaticText9( StaticText st ) + { + this.staticText9 = st; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() + { + return staticText10; + } + + public void setStaticText10( StaticText st ) + { + this.staticText10 = st; + } + private StaticText txtCap = new StaticText(); + + public StaticText getTxtCap() + { + return txtCap; + } + + public void setTxtCap( StaticText st ) + { + this.txtCap = st; + } + //
+ //private String IMAGE_URL = "/resources/images"; +// private final static int ESTADO_SEG = 1; +// private final static int ESTADO_RH1 = 2; +// private final static int ESTADO_HS = 3; +// private final static int ESTADO_RH2 = 4; +// private final static int ESTADO_MEDICO = 5; +// private final static int ESTADO_ASSINATURAS = 6; +// private final static int ESTADO_IMPRESSAO = 7; +// private final static int ESTADO_FECHAR = 8; +// private final static int ESTADO_CONCLUIDO = 9; + private final static int ESTADO_ASSINATURA_1 = 1; + private final static int ESTADO_ASSINATURA_2 = 2; + private final static int ESTADO_ASSINATURA_3 = 3; +// private final static int ESTADO_ASSINATURA_RESP_SEG = 1; +// private final static int ESTADO_ASSINATURA_SEG = 2; +// private final static int ESTADO_ASSINATURA_HS = 3; +// private final static int ESTADO_ASSINATURA_MED = 4; +// private final static int ESTADO_ASSINATURA_RH = 5; +// private final static int ESTADO_ASSINATURA_RESP_RH = 6; + private final static int IMAGE_WIDTH = 48; + private final static int IMAGE_HEIGHT = 48; + private static final String PDFS_FOLDER_URL = "/resources/pdfs"; + private Hyperlink lnkLblTrabalhador = new Hyperlink(); + + public Hyperlink getLnkLblTrabalhador() + { + return lnkLblTrabalhador; + } + + public void setLnkLblTrabalhador( Hyperlink h ) + { + this.lnkLblTrabalhador = h; + } + private HtmlPanelGrid gridAcidentado = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentado() + { + return gridAcidentado; + } + + public void setGridAcidentado( HtmlPanelGrid hpg ) + { + this.gridAcidentado = hpg; + } + private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel23() + { + return gridPanel23; + } + + public void setGridPanel23( HtmlPanelGrid hpg ) + { + this.gridPanel23 = hpg; + } + private StaticText staticText29 = new StaticText(); + + public StaticText getStaticText29() + { + return staticText29; + } + + public void setStaticText29( StaticText st ) + { + this.staticText29 = st; + } + private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel24() + { + return gridPanel24; + } + + public void setGridPanel24( HtmlPanelGrid hpg ) + { + this.gridPanel24 = hpg; + } + private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel25() + { + return gridPanel25; + } + + public void setGridPanel25( HtmlPanelGrid hpg ) + { + this.gridPanel25 = hpg; + } + private StaticText staticText30 = new StaticText(); + + public StaticText getStaticText30() + { + return staticText30; + } + + public void setStaticText30( StaticText st ) + { + this.staticText30 = st; + } + private StaticText txtNomeAcidentado = new StaticText(); + + public StaticText getTxtNomeAcidentado() + { + return txtNomeAcidentado; + } + + public void setTxtNomeAcidentado( StaticText st ) + { + this.txtNomeAcidentado = st; + } + private StaticText staticText31 = new StaticText(); + + public StaticText getStaticText31() + { + return staticText31; + } + + public void setStaticText31( StaticText st ) + { + this.staticText31 = st; + } + private StaticText txtDataNascimento = new StaticText(); + + public StaticText getTxtDataNascimento() + { + return txtDataNascimento; + } + + public void setTxtDataNascimento( StaticText st ) + { + this.txtDataNascimento = st; + } + private StaticText staticText32 = new StaticText(); + + public StaticText getStaticText32() + { + return staticText32; + } + + public void setStaticText32( StaticText st ) + { + this.staticText32 = st; + } + private TextField txtBI = new TextField(); + + public TextField getTxtBI() + { + return txtBI; + } + + public void setTxtBI( TextField tf ) + { + this.txtBI = tf; + } + private StaticText staticText33 = new StaticText(); + + public StaticText getStaticText33() + { + return staticText33; + } + + public void setStaticText33( StaticText st ) + { + this.staticText33 = st; + } + private TextField txtMorada = new TextField(); + + public TextField getTxtMorada() + { + return txtMorada; + } + + public void setTxtMorada( TextField tf ) + { + this.txtMorada = tf; + } + private StaticText staticText34 = new StaticText(); + + public StaticText getStaticText34() + { + return staticText34; + } + + public void setStaticText34( StaticText st ) + { + this.staticText34 = st; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private TextField txtCodPostal1 = new TextField(); + + public TextField getTxtCodPostal1() + { + return txtCodPostal1; + } + + public void setTxtCodPostal1( TextField tf ) + { + this.txtCodPostal1 = tf; + } + private StaticText staticText35 = new StaticText(); + + public StaticText getStaticText35() + { + return staticText35; + } + + public void setStaticText35( StaticText st ) + { + this.staticText35 = st; + } + private TextField txtCodPostal2 = new TextField(); + + public TextField getTxtCodPostal2() + { + return txtCodPostal2; + } + + public void setTxtCodPostal2( TextField tf ) + { + this.txtCodPostal2 = tf; + } + private StaticText staticText36 = new StaticText(); + + public StaticText getStaticText36() + { + return staticText36; + } + + public void setStaticText36( StaticText st ) + { + this.staticText36 = st; + } + private TextField txtLocalidade = new TextField(); + + public TextField getTxtLocalidade() + { + return txtLocalidade; + } + + public void setTxtLocalidade( TextField tf ) + { + this.txtLocalidade = tf; + } + private StaticText staticText37 = new StaticText(); + + public StaticText getStaticText37() + { + return staticText37; + } + + public void setStaticText37( StaticText st ) + { + this.staticText37 = st; + } + private TextField txtContactoTelefonico = new TextField(); + + public TextField getTxtContactoTelefonico() + { + return txtContactoTelefonico; + } + + public void setTxtContactoTelefonico( TextField tf ) + { + this.txtContactoTelefonico = tf; + } + private StaticText staticText38 = new StaticText(); + + public StaticText getStaticText38() + { + return staticText38; + } + + public void setStaticText38( StaticText st ) + { + this.staticText38 = st; + } + private StaticText stDataAdmissao = new StaticText(); + + public StaticText getStDataAdmissao() + { + return stDataAdmissao; + } + + public void setStDataAdmissao( StaticText st ) + { + this.stDataAdmissao = st; + } + private StaticText staticText39 = new StaticText(); + + public StaticText getStaticText39() + { + return staticText39; + } + + public void setStaticText39( StaticText st ) + { + this.staticText39 = st; + } + private StaticText stFuncao = new StaticText(); + + public StaticText getStFuncao() + { + return stFuncao; + } + + public void setStFuncao( StaticText st ) + { + this.stFuncao = st; + } + private StaticText staticText40 = new StaticText(); + + public StaticText getStaticText40() + { + return staticText40; + } + + public void setStaticText40( StaticText st ) + { + this.staticText40 = st; + } + private HtmlPanelGrid gridDadosAcidenteSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteSeg() + { + return gridDadosAcidenteSeg; + } + + public void setGridDadosAcidenteSeg( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteSeg = hpg; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } + + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() + { + return staticText13; + } + + public void setStaticText13( StaticText st ) + { + this.staticText13 = st; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } + + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel11() + { + return gridPanel11; + } + + public void setGridPanel11( HtmlPanelGrid hpg ) + { + this.gridPanel11 = hpg; + } + private PanelGroup groupPanel10 = new PanelGroup(); + + public PanelGroup getGroupPanel10() + { + return groupPanel10; + } + + public void setGroupPanel10( PanelGroup pg ) + { + this.groupPanel10 = pg; + } + private StaticText staticText17 = new StaticText(); + + public StaticText getStaticText17() + { + return staticText17; + } + + public void setStaticText17( StaticText st ) + { + this.staticText17 = st; + } + private PanelGroup groupPanel11 = new PanelGroup(); + + public PanelGroup getGroupPanel11() + { + return groupPanel11; + } + + public void setGroupPanel11( PanelGroup pg ) + { + this.groupPanel11 = pg; + } + private StaticText staticText18 = new StaticText(); + + public StaticText getStaticText18() + { + return staticText18; + } + + public void setStaticText18( StaticText st ) + { + this.staticText18 = st; + } + private TextField txtLocal = new TextField(); + + public TextField getTxtLocal() + { + return txtLocal; + } + + public void setTxtLocal( TextField tf ) + { + this.txtLocal = tf; + } + private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel12() + { + return gridPanel12; + } + + public void setGridPanel12( HtmlPanelGrid hpg ) + { + this.gridPanel12 = hpg; + } + private StaticText staticText19 = new StaticText(); + + public StaticText getStaticText19() + { + return staticText19; + } + + public void setStaticText19( StaticText st ) + { + this.staticText19 = st; + } + private TextField txtTarefa = new TextField(); + + public TextField getTxtTarefa() + { + return txtTarefa; + } + + public void setTxtTarefa( TextField tf ) + { + this.txtTarefa = tf; + } + private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel13() + { + return gridPanel13; + } + + public void setGridPanel13( HtmlPanelGrid hpg ) + { + this.gridPanel13 = hpg; + } + private StaticText staticText20 = new StaticText(); + + public StaticText getStaticText20() + { + return staticText20; + } + + public void setStaticText20( StaticText st ) + { + this.staticText20 = st; + } + private TextField txtSubstancias = new TextField(); + + public TextField getTxtSubstancias() + { + return txtSubstancias; + } + + public void setTxtSubstancias( TextField tf ) + { + this.txtSubstancias = tf; + } + private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel15() + { + return gridPanel15; + } + + public void setGridPanel15( HtmlPanelGrid hpg ) + { + this.gridPanel15 = hpg; + } + private StaticText staticText22 = new StaticText(); + + public StaticText getStaticText22() + { + return staticText22; + } + + public void setStaticText22( StaticText st ) + { + this.staticText22 = st; + } + private TextField txtCondicoes = new TextField(); + + public TextField getTxtCondicoes() + { + return txtCondicoes; + } + + public void setTxtCondicoes( TextField tf ) + { + this.txtCondicoes = tf; + } + private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel16() + { + return gridPanel16; + } + + public void setGridPanel16( HtmlPanelGrid hpg ) + { + this.gridPanel16 = hpg; + } + private StaticText staticText23 = new StaticText(); + + public StaticText getStaticText23() + { + return staticText23; + } + + public void setStaticText23( StaticText st ) + { + this.staticText23 = st; + } + private TextField txtTestemunhas = new TextField(); + + public TextField getTxtTestemunhas() + { + return txtTestemunhas; + } + + public void setTxtTestemunhas( TextField tf ) + { + this.txtTestemunhas = tf; + } + private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel17() + { + return gridPanel17; + } + + public void setGridPanel17( HtmlPanelGrid hpg ) + { + this.gridPanel17 = hpg; + } + private StaticText staticText24 = new StaticText(); + + public StaticText getStaticText24() + { + return staticText24; + } + + public void setStaticText24( StaticText st ) + { + this.staticText24 = st; + } + private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel18() + { + return gridPanel18; + } + + public void setGridPanel18( HtmlPanelGrid hpg ) + { + this.gridPanel18 = hpg; + } + private StaticText staticText25 = new StaticText(); + + public StaticText getStaticText25() + { + return staticText25; + } + + public void setStaticText25( StaticText st ) + { + this.staticText25 = st; + } + private TextField txtDescricao = new TextField(); + + public TextField getTxtDescricao() + { + return txtDescricao; + } + + public void setTxtDescricao( TextField tf ) + { + this.txtDescricao = tf; + } + private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel19() + { + return gridPanel19; + } + + public void setGridPanel19( HtmlPanelGrid hpg ) + { + this.gridPanel19 = hpg; + } + private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel20() + { + return gridPanel20; + } + + public void setGridPanel20( HtmlPanelGrid hpg ) + { + this.gridPanel20 = hpg; + } + private StaticText staticText26 = new StaticText(); + + public StaticText getStaticText26() + { + return staticText26; + } + + public void setStaticText26( StaticText st ) + { + this.staticText26 = st; + } + private Button butImagem = new Button(); + + public Button getButImagem() + { + return butImagem; + } + + public void setButImagem( Button b ) + { + this.butImagem = b; + } + private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages() + { + return gridImages; + } + + public void setGridImages( HtmlPanelGrid hpg ) + { + this.gridImages = hpg; + } + private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel21() + { + return gridPanel21; + } + + public void setGridPanel21( HtmlPanelGrid hpg ) + { + this.gridPanel21 = hpg; + } + private StaticText staticText27 = new StaticText(); + + public StaticText getStaticText27() + { + return staticText27; + } + + public void setStaticText27( StaticText st ) + { + this.staticText27 = st; + } + private TextArea txtConclusoes = new TextArea(); + + public TextArea getTxtConclusoes() + { + return txtConclusoes; + } + + public void setTxtConclusoes( TextArea ta ) + { + this.txtConclusoes = ta; + } + private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel26() + { + return gridPanel26; + } + + public void setGridPanel26( HtmlPanelGrid hpg ) + { + this.gridPanel26 = hpg; + } + private StaticText staticText28 = new StaticText(); + + public StaticText getStaticText28() + { + return staticText28; + } + + public void setStaticText28( StaticText st ) + { + this.staticText28 = st; + } + private TextArea txtAccoes = new TextArea(); + + public TextArea getTxtAccoes() + { + return txtAccoes; + } + + public void setTxtAccoes( TextArea ta ) + { + this.txtAccoes = ta; + } + private HtmlPanelGrid gridDadosAcidenteRh = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRh() + { + return gridDadosAcidenteRh; + } + + public void setGridDadosAcidenteRh( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteRh = hpg; + } + private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel27() + { + return gridPanel27; + } + + public void setGridPanel27( HtmlPanelGrid hpg ) + { + this.gridPanel27 = hpg; + } + private StaticText staticText46 = new StaticText(); + + public StaticText getStaticText46() + { + return staticText46; + } + + public void setStaticText46( StaticText st ) + { + this.staticText46 = st; + } + private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel28() + { + return gridPanel28; + } + + public void setGridPanel28( HtmlPanelGrid hpg ) + { + this.gridPanel28 = hpg; + } + private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel29() + { + return gridPanel29; + } + + public void setGridPanel29( HtmlPanelGrid hpg ) + { + this.gridPanel29 = hpg; + } + private StaticText staticText47 = new StaticText(); + + public StaticText getStaticText47() + { + return staticText47; + } + + public void setStaticText47( StaticText st ) + { + this.staticText47 = st; + } + private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel30() + { + return gridPanel30; + } + + public void setGridPanel30( HtmlPanelGrid hpg ) + { + this.gridPanel30 = hpg; + } + private StaticText staticText48 = new StaticText(); + + public StaticText getStaticText48() + { + return staticText48; + } + + public void setStaticText48( StaticText st ) + { + this.staticText48 = st; + } + private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel31() + { + return gridPanel31; + } + + public void setGridPanel31( HtmlPanelGrid hpg ) + { + this.gridPanel31 = hpg; + } + private RadioButton rbFormacaoSHSTY = new RadioButton(); + + public RadioButton getRbFormacaoSHSTY() + { + return rbFormacaoSHSTY; + } + + public void setRbFormacaoSHSTY( RadioButton rb ) + { + this.rbFormacaoSHSTY = rb; + } + private StaticText staticText49 = new StaticText(); + + public StaticText getStaticText49() + { + return staticText49; + } + + public void setStaticText49( StaticText st ) + { + this.staticText49 = st; + } + private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel32() + { + return gridPanel32; + } + + public void setGridPanel32( HtmlPanelGrid hpg ) + { + this.gridPanel32 = hpg; + } + private StaticText staticText50 = new StaticText(); + + public StaticText getStaticText50() + { + return staticText50; + } + + public void setStaticText50( StaticText st ) + { + this.staticText50 = st; + } + private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel33() + { + return gridPanel33; + } + + public void setGridPanel33( HtmlPanelGrid hpg ) + { + this.gridPanel33 = hpg; + } + private RadioButton rbFormacaoSHSTN = new RadioButton(); + + public RadioButton getRbFormacaoSHSTN() + { + return rbFormacaoSHSTN; + } + + public void setRbFormacaoSHSTN( RadioButton rb ) + { + this.rbFormacaoSHSTN = rb; + } + private StaticText stFormacaoDummy = new StaticText(); + + public StaticText getStFormacaoDummy() + { + return stFormacaoDummy; + } + + public void setStFormacaoDummy( StaticText st ) + { + this.stFormacaoDummy = st; + } + private PanelGroup groupPanel12 = new PanelGroup(); + + public PanelGroup getGroupPanel12() + { + return groupPanel12; + } + + public void setGroupPanel12( PanelGroup pg ) + { + this.groupPanel12 = pg; + } + private StaticText lblFormacaoSHSTNWhy = new StaticText(); + + public StaticText getLblFormacaoSHSTNWhy() + { + return lblFormacaoSHSTNWhy; + } + + public void setLblFormacaoSHSTNWhy( StaticText st ) + { + this.lblFormacaoSHSTNWhy = st; + } + private TextField txtFormacaoSHSTNWhy = new TextField(); + + public TextField getTxtFormacaoSHSTNWhy() + { + return txtFormacaoSHSTNWhy; + } + + public void setTxtFormacaoSHSTNWhy( TextField tf ) + { + this.txtFormacaoSHSTNWhy = tf; + } + private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel34() + { + return gridPanel34; + } + + public void setGridPanel34( HtmlPanelGrid hpg ) + { + this.gridPanel34 = hpg; + } + private StaticText staticText53 = new StaticText(); + + public StaticText getStaticText53() + { + return staticText53; + } + + public void setStaticText53( StaticText st ) + { + this.staticText53 = st; + } + private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel35() + { + return gridPanel35; + } + + public void setGridPanel35( HtmlPanelGrid hpg ) + { + this.gridPanel35 = hpg; + } + private StaticText staticText54 = new StaticText(); + + public StaticText getStaticText54() + { + return staticText54; + } + + public void setStaticText54( StaticText st ) + { + this.staticText54 = st; + } + private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel36() + { + return gridPanel36; + } + + public void setGridPanel36( HtmlPanelGrid hpg ) + { + this.gridPanel36 = hpg; + } + private RadioButton rbAcidentesColaboradorY = new RadioButton(); + + public RadioButton getRbAcidentesColaboradorY() + { + return rbAcidentesColaboradorY; + } + + public void setRbAcidentesColaboradorY( RadioButton rb ) + { + this.rbAcidentesColaboradorY = rb; + } + private StaticText staticText55 = new StaticText(); + + public StaticText getStaticText55() + { + return staticText55; + } + + public void setStaticText55( StaticText st ) + { + this.staticText55 = st; + } + private PanelGroup groupPanel13 = new PanelGroup(); + + public PanelGroup getGroupPanel13() + { + return groupPanel13; + } + + public void setGroupPanel13( PanelGroup pg ) + { + this.groupPanel13 = pg; + } + private StaticText staticText56 = new StaticText(); + + public StaticText getStaticText56() + { + return staticText56; + } + + public void setStaticText56( StaticText st ) + { + this.staticText56 = st; + } + private TextField txtNrAcidentesColaborador = new TextField(); + + public TextField getTxtNrAcidentesColaborador() + { + return txtNrAcidentesColaborador; + } + + public void setTxtNrAcidentesColaborador( TextField tf ) + { + this.txtNrAcidentesColaborador = tf; + } + private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel37() + { + return gridPanel37; + } + + public void setGridPanel37( HtmlPanelGrid hpg ) + { + this.gridPanel37 = hpg; + } + private StaticText staticText57 = new StaticText(); + + public StaticText getStaticText57() + { + return staticText57; + } + + public void setStaticText57( StaticText st ) + { + this.staticText57 = st; + } + private TextField txtNrRelatorioAcidentesColaborador1 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador1() + { + return txtNrRelatorioAcidentesColaborador1; + } + + public void setTxtNrRelatorioAcidentesColaborador1( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador1 = tf; + } + private TextField txtNrRelatorioAcidentesColaborador2 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador2() + { + return txtNrRelatorioAcidentesColaborador2; + } + + public void setTxtNrRelatorioAcidentesColaborador2( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador2 = tf; + } + private TextField txtNrRelatorioAcidentesColaborador3 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador3() + { + return txtNrRelatorioAcidentesColaborador3; + } + + public void setTxtNrRelatorioAcidentesColaborador3( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador3 = tf; + } + private TextField txtNrRelatorioAcidentesColaborador4 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador4() + { + return txtNrRelatorioAcidentesColaborador4; + } + + public void setTxtNrRelatorioAcidentesColaborador4( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador4 = tf; + } + private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel38() + { + return gridPanel38; + } + + public void setGridPanel38( HtmlPanelGrid hpg ) + { + this.gridPanel38 = hpg; + } + private StaticText staticText58 = new StaticText(); + + public StaticText getStaticText58() + { + return staticText58; + } + + public void setStaticText58( StaticText st ) + { + this.staticText58 = st; + } + private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel39() + { + return gridPanel39; + } + + public void setGridPanel39( HtmlPanelGrid hpg ) + { + this.gridPanel39 = hpg; + } + private RadioButton rbAcidentesColaboradorN = new RadioButton(); + + public RadioButton getRbAcidentesColaboradorN() + { + return rbAcidentesColaboradorN; + } + + public void setRbAcidentesColaboradorN( RadioButton rb ) + { + this.rbAcidentesColaboradorN = rb; + } + private StaticText staticText59 = new StaticText(); + + public StaticText getStaticText59() + { + return staticText59; + } + + public void setStaticText59( StaticText st ) + { + this.staticText59 = st; + } + private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel40() + { + return gridPanel40; + } + + public void setGridPanel40( HtmlPanelGrid hpg ) + { + this.gridPanel40 = hpg; + } + private StaticText staticText60 = new StaticText(); + + public StaticText getStaticText60() + { + return staticText60; + } + + public void setStaticText60( StaticText st ) + { + this.staticText60 = st; + } + private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel41() + { + return gridPanel41; + } + + public void setGridPanel41( HtmlPanelGrid hpg ) + { + this.gridPanel41 = hpg; + } + private StaticText staticText61 = new StaticText(); + + public StaticText getStaticText61() + { + return staticText61; + } + + public void setStaticText61( StaticText st ) + { + this.staticText61 = st; + } + private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel42() + { + return gridPanel42; + } + + public void setGridPanel42( HtmlPanelGrid hpg ) + { + this.gridPanel42 = hpg; + } + private RadioButton rbAcidentesColaboradoresY = new RadioButton(); + + public RadioButton getRbAcidentesColaboradoresY() + { + return rbAcidentesColaboradoresY; + } + + public void setRbAcidentesColaboradoresY( RadioButton rb ) + { + this.rbAcidentesColaboradoresY = rb; + } + private StaticText staticText62 = new StaticText(); + + public StaticText getStaticText62() + { + return staticText62; + } + + public void setStaticText62( StaticText st ) + { + this.staticText62 = st; + } + private PanelGroup groupPanel14 = new PanelGroup(); + + public PanelGroup getGroupPanel14() + { + return groupPanel14; + } + + public void setGroupPanel14( PanelGroup pg ) + { + this.groupPanel14 = pg; + } + private StaticText staticText63 = new StaticText(); + + public StaticText getStaticText63() + { + return staticText63; + } + + public void setStaticText63( StaticText st ) + { + this.staticText63 = st; + } + private TextField txtNrAcidentesColaboradores = new TextField(); + + public TextField getTxtNrAcidentesColaboradores() + { + return txtNrAcidentesColaboradores; + } + + public void setTxtNrAcidentesColaboradores( TextField tf ) + { + this.txtNrAcidentesColaboradores = tf; + } + private HtmlPanelGrid gridPanel43 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel43() + { + return gridPanel43; + } + + public void setGridPanel43( HtmlPanelGrid hpg ) + { + this.gridPanel43 = hpg; + } + private StaticText staticText64 = new StaticText(); + + public StaticText getStaticText64() + { + return staticText64; + } + + public void setStaticText64( StaticText st ) + { + this.staticText64 = st; + } + private TextField txtNrRelatorioAcidentesColaboradores1 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores1() + { + return txtNrRelatorioAcidentesColaboradores1; + } + + public void setTxtNrRelatorioAcidentesColaboradores1( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores1 = tf; + } + private TextField txtNrRelatorioAcidentesColaboradores2 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores2() + { + return txtNrRelatorioAcidentesColaboradores2; + } + + public void setTxtNrRelatorioAcidentesColaboradores2( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores2 = tf; + } + private TextField txtNrRelatorioAcidentesColaboradores3 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores3() + { + return txtNrRelatorioAcidentesColaboradores3; + } + + public void setTxtNrRelatorioAcidentesColaboradores3( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores3 = tf; + } + private TextField txtNrRelatorioAcidentesColaboradores4 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores4() + { + return txtNrRelatorioAcidentesColaboradores4; + } + + public void setTxtNrRelatorioAcidentesColaboradores4( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores4 = tf; + } + private HtmlPanelGrid gridPanel44 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel44() + { + return gridPanel44; + } + + public void setGridPanel44( HtmlPanelGrid hpg ) + { + this.gridPanel44 = hpg; + } + private StaticText staticText65 = new StaticText(); + + public StaticText getStaticText65() + { + return staticText65; + } + + public void setStaticText65( StaticText st ) + { + this.staticText65 = st; + } + private HtmlPanelGrid gridPanel45 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel45() + { + return gridPanel45; + } + + public void setGridPanel45( HtmlPanelGrid hpg ) + { + this.gridPanel45 = hpg; + } + private RadioButton rbAcidentesColaboradoresN = new RadioButton(); + + public RadioButton getRbAcidentesColaboradoresN() + { + return rbAcidentesColaboradoresN; + } + + public void setRbAcidentesColaboradoresN( RadioButton rb ) + { + this.rbAcidentesColaboradoresN = rb; + } + private StaticText staticText66 = new StaticText(); + + public StaticText getStaticText66() + { + return staticText66; + } + + public void setStaticText66( StaticText st ) + { + this.staticText66 = st; + } + private HtmlPanelGrid gridRecomendacoesHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesHS() + { + return gridRecomendacoesHS; + } + + public void setGridRecomendacoesHS( HtmlPanelGrid hpg ) + { + this.gridRecomendacoesHS = hpg; + } + private HtmlPanelGrid gridPanel46 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel46() + { + return gridPanel46; + } + + public void setGridPanel46( HtmlPanelGrid hpg ) + { + this.gridPanel46 = hpg; + } + private StaticText staticText67 = new StaticText(); + + public StaticText getStaticText67() + { + return staticText67; + } + + public void setStaticText67( StaticText st ) + { + this.staticText67 = st; + } + private HtmlPanelGrid gridRecomendacoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoes() + { + return gridRecomendacoes; + } + + public void setGridRecomendacoes( HtmlPanelGrid hpg ) + { + this.gridRecomendacoes = hpg; + } + private HtmlPanelGrid gridPanel48 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel48() + { + return gridPanel48; + } + + public void setGridPanel48( HtmlPanelGrid hpg ) + { + this.gridPanel48 = hpg; + } + private StaticText stNrRecomendacao1 = new StaticText(); + + public StaticText getStNrRecomendacao1() + { + return stNrRecomendacao1; + } + + public void setStNrRecomendacao1( StaticText st ) + { + this.stNrRecomendacao1 = st; + } + private ImageHyperlink lnkMoreRec1 = new ImageHyperlink(); + + public ImageHyperlink getLnkMoreRec1() + { + return lnkMoreRec1; + } + + public void setLnkMoreRec1( ImageHyperlink ih ) + { + this.lnkMoreRec1 = ih; + } + private Hyperlink lnkDelImageTmp = new Hyperlink(); + + public Hyperlink getLnkDelImageTmp() + { + return lnkDelImageTmp; + } + + public void setLnkDelImageTmp( Hyperlink lnkDelImageTmp ) + { + this.lnkDelImageTmp = lnkDelImageTmp; + } + private HtmlPanelGrid gridSiprpView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSiprpView() + { + return gridSiprpView; + } + + public void setGridSiprpView( HtmlPanelGrid hpg ) + { + this.gridSiprpView = hpg; + } + private HtmlPanelGrid gridPanel49 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel49() + { + return gridPanel49; + } + + public void setGridPanel49( HtmlPanelGrid hpg ) + { + this.gridPanel49 = hpg; + } + private StaticText staticText69 = new StaticText(); + + public StaticText getStaticText69() + { + return staticText69; + } + + public void setStaticText69( StaticText st ) + { + this.staticText69 = st; + } + private HtmlPanelGrid gridPanel50 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel50() + { + return gridPanel50; + } + + public void setGridPanel50( HtmlPanelGrid hpg ) + { + this.gridPanel50 = hpg; + } + private HtmlPanelGrid gridPanel51 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel51() + { + return gridPanel51; + } + + public void setGridPanel51( HtmlPanelGrid hpg ) + { + this.gridPanel51 = hpg; + } + private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentadoView() + { + return gridAcidentadoView; + } + + public void setGridAcidentadoView( HtmlPanelGrid hpg ) + { + this.gridAcidentadoView = hpg; + } + private HtmlPanelGrid gridPanel52 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel52() + { + return gridPanel52; + } + + public void setGridPanel52( HtmlPanelGrid hpg ) + { + this.gridPanel52 = hpg; + } + private StaticText staticText78 = new StaticText(); + + public StaticText getStaticText78() + { + return staticText78; + } + + public void setStaticText78( StaticText st ) + { + this.staticText78 = st; + } + private HtmlPanelGrid gridPanel53 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel53() + { + return gridPanel53; + } + + public void setGridPanel53( HtmlPanelGrid hpg ) + { + this.gridPanel53 = hpg; + } + private HtmlPanelGrid gridPanel54 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel54() + { + return gridPanel54; + } + + public void setGridPanel54( HtmlPanelGrid hpg ) + { + this.gridPanel54 = hpg; + } + private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRhView() + { + return gridDadosAcidenteRhView; + } + + public void setGridDadosAcidenteRhView( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteRhView = hpg; + } + private HtmlPanelGrid gridPanel55 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel55() + { + return gridPanel55; + } + + public void setGridPanel55( HtmlPanelGrid hpg ) + { + this.gridPanel55 = hpg; + } + private StaticText staticText88 = new StaticText(); + + public StaticText getStaticText88() + { + return staticText88; + } + + public void setStaticText88( StaticText st ) + { + this.staticText88 = st; + } + private HtmlPanelGrid gridPanel56 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel56() + { + return gridPanel56; + } + + public void setGridPanel56( HtmlPanelGrid hpg ) + { + this.gridPanel56 = hpg; + } + private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSHST() + { + return gridSHST; + } + + public void setGridSHST( HtmlPanelGrid hpg ) + { + this.gridSHST = hpg; + } + private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaborador() + { + return gridColaborador; + } + + public void setGridColaborador( HtmlPanelGrid hpg ) + { + this.gridColaborador = hpg; + } + private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaboradores() + { + return gridColaboradores; + } + + public void setGridColaboradores( HtmlPanelGrid hpg ) + { + this.gridColaboradores = hpg; + } + private SingleSelectOptionsList drpHoursDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpHoursDefaultOptions() + { + return drpHoursDefaultOptions; + } + + public void setDrpHoursDefaultOptions( SingleSelectOptionsList ssol ) + { + this.drpHoursDefaultOptions = ssol; + } + private SingleSelectOptionsList drpMinutesDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpMinutesDefaultOptions() + { + return drpMinutesDefaultOptions; + } + + public void setDrpMinutesDefaultOptions( SingleSelectOptionsList ssol ) + { + this.drpMinutesDefaultOptions = ssol; + } + private TextArea txtRecomendacao1 = new TextArea(); + + public TextArea getTxtRecomendacao1() + { + return txtRecomendacao1; + } + + public void setTxtRecomendacao1( TextArea ta ) + { + this.txtRecomendacao1 = ta; + } + private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesViewHS() + { + return gridRecomendacoesViewHS; + } + + public void setGridRecomendacoesViewHS( HtmlPanelGrid hpg ) + { + this.gridRecomendacoesViewHS = hpg; + } + private HtmlPanelGrid gridPanel47 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel47() + { + return gridPanel47; + } + + public void setGridPanel47( HtmlPanelGrid hpg ) + { + this.gridPanel47 = hpg; + } + private StaticText staticText51 = new StaticText(); + + public StaticText getStaticText51() + { + return staticText51; + } + + public void setStaticText51( StaticText st ) + { + this.staticText51 = st; + } + private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesView() + { + return gridRecomendacoesView; + } + + public void setGridRecomendacoesView( HtmlPanelGrid hpg ) + { + this.gridRecomendacoesView = hpg; + } + private HtmlPanelGrid gridMedidasRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasRH() + { + return gridMedidasRH; + } + + public void setGridMedidasRH( HtmlPanelGrid hpg ) + { + this.gridMedidasRH = hpg; + } + private HtmlPanelGrid gridPanel57 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel57() + { + return gridPanel57; + } + + public void setGridPanel57( HtmlPanelGrid hpg ) + { + this.gridPanel57 = hpg; + } + private StaticText staticText68 = new StaticText(); + + public StaticText getStaticText68() + { + return staticText68; + } + + public void setStaticText68( StaticText st ) + { + this.staticText68 = st; + } + private HtmlPanelGrid gridMedidas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidas() + { + return gridMedidas; + } + + public void setGridMedidas( HtmlPanelGrid hpg ) + { + this.gridMedidas = hpg; + } + private HtmlPanelGrid gridPanel58 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel58() + { + return gridPanel58; + } + + public void setGridPanel58( HtmlPanelGrid hpg ) + { + this.gridPanel58 = hpg; + } + private StaticText stNrMedida1 = new StaticText(); + + public StaticText getStNrMedida1() + { + return stNrMedida1; + } + + public void setStNrMedida1( StaticText st ) + { + this.stNrMedida1 = st; + } + private TextArea txtMedida1 = new TextArea(); + + public TextArea getTxtMedida1() + { + return txtMedida1; + } + + public void setTxtMedida1( TextArea ta ) + { + this.txtMedida1 = ta; + } + private ImageHyperlink lnkMoreMed1 = new ImageHyperlink(); + + public ImageHyperlink getLnkMoreMed1() + { + return lnkMoreMed1; + } + + public void setLnkMoreMed1( ImageHyperlink ih ) + { + this.lnkMoreMed1 = ih; + } + private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasViewRH() + { + return gridMedidasViewRH; + } + + public void setGridMedidasViewRH( HtmlPanelGrid hpg ) + { + this.gridMedidasViewRH = hpg; + } + private HtmlPanelGrid gridPanel59 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel59() + { + return gridPanel59; + } + + public void setGridPanel59( HtmlPanelGrid hpg ) + { + this.gridPanel59 = hpg; + } + private StaticText staticText89 = new StaticText(); + + public StaticText getStaticText89() + { + return staticText89; + } + + public void setStaticText89( StaticText st ) + { + this.staticText89 = st; + } + private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasView() + { + return gridMedidasView; + } + + public void setGridMedidasView( HtmlPanelGrid hpg ) + { + this.gridMedidasView = hpg; + } + private HtmlPanelGrid gridMedico = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedico() + { + return gridMedico; + } + + public void setGridMedico( HtmlPanelGrid hpg ) + { + this.gridMedico = hpg; + } + private HtmlPanelGrid gridPanel60 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel60() + { + return gridPanel60; + } + + public void setGridPanel60( HtmlPanelGrid hpg ) + { + this.gridPanel60 = hpg; + } + private StaticText staticText90 = new StaticText(); + + public StaticText getStaticText90() + { + return staticText90; + } + + public void setStaticText90( StaticText st ) + { + this.staticText90 = st; + } + private HtmlPanelGrid gridLesao1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao1() + { + return gridLesao1; + } + + public void setGridLesao1( HtmlPanelGrid hpg ) + { + this.gridLesao1 = hpg; + } + private StaticText staticText91 = new StaticText(); + + public StaticText getStaticText91() + { + return staticText91; + } + + public void setStaticText91( StaticText st ) + { + this.staticText91 = st; + } + private HtmlPanelGrid gridPanel61 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel61() + { + return gridPanel61; + } + + public void setGridPanel61( HtmlPanelGrid hpg ) + { + this.gridPanel61 = hpg; + } + private PanelGroup groupPanel17 = new PanelGroup(); + + public PanelGroup getGroupPanel17() + { + return groupPanel17; + } + + public void setGroupPanel17( PanelGroup pg ) + { + this.groupPanel17 = pg; + } + private Checkbox chkCabeca = new Checkbox(); + + public Checkbox getChkCabeca() + { + return chkCabeca; + } + + public void setChkCabeca( Checkbox c ) + { + this.chkCabeca = c; + } + private StaticText staticText93 = new StaticText(); + + public StaticText getStaticText93() + { + return staticText93; + } + + public void setStaticText93( StaticText st ) + { + this.staticText93 = st; + } + private PanelGroup groupPanel18 = new PanelGroup(); + + public PanelGroup getGroupPanel18() + { + return groupPanel18; + } + + public void setGroupPanel18( PanelGroup pg ) + { + this.groupPanel18 = pg; + } + private Checkbox chkMembroSupDir = new Checkbox(); + + public Checkbox getChkMembroSupDir() + { + return chkMembroSupDir; + } + + public void setChkMembroSupDir( Checkbox c ) + { + this.chkMembroSupDir = c; + } + private StaticText staticText94 = new StaticText(); + + public StaticText getStaticText94() + { + return staticText94; + } + + public void setStaticText94( StaticText st ) + { + this.staticText94 = st; + } + private HtmlPanelGrid gridPanel62 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel62() + { + return gridPanel62; + } + + public void setGridPanel62( HtmlPanelGrid hpg ) + { + this.gridPanel62 = hpg; + } + private StaticText lblEspecif1 = new StaticText(); + + public StaticText getLblEspecif1() + { + return lblEspecif1; + } + + public void setLblEspecif1( StaticText st ) + { + this.lblEspecif1 = st; + } + private TextField txtEspecif1 = new TextField(); + + public TextField getTxtEspecif1() + { + return txtEspecif1; + } + + public void setTxtEspecif1( TextField tf ) + { + this.txtEspecif1 = tf; + } + private PanelGroup groupPanel19 = new PanelGroup(); + + public PanelGroup getGroupPanel19() + { + return groupPanel19; + } + + public void setGroupPanel19( PanelGroup pg ) + { + this.groupPanel19 = pg; + } + private Checkbox chkPescoco = new Checkbox(); + + public Checkbox getChkPescoco() + { + return chkPescoco; + } + + public void setChkPescoco( Checkbox c ) + { + this.chkPescoco = c; + } + private StaticText staticText96 = new StaticText(); + + public StaticText getStaticText96() + { + return staticText96; + } + + public void setStaticText96( StaticText st ) + { + this.staticText96 = st; + } + private PanelGroup groupPanel20 = new PanelGroup(); + + public PanelGroup getGroupPanel20() + { + return groupPanel20; + } + + public void setGroupPanel20( PanelGroup pg ) + { + this.groupPanel20 = pg; + } + private Checkbox chkMembroSupEsq = new Checkbox(); + + public Checkbox getChkMembroSupEsq() + { + return chkMembroSupEsq; + } + + public void setChkMembroSupEsq( Checkbox c ) + { + this.chkMembroSupEsq = c; + } + private StaticText staticText97 = new StaticText(); + + public StaticText getStaticText97() + { + return staticText97; + } + + public void setStaticText97( StaticText st ) + { + this.staticText97 = st; + } + private HtmlPanelGrid gridPanel63 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel63() + { + return gridPanel63; + } + + public void setGridPanel63( HtmlPanelGrid hpg ) + { + this.gridPanel63 = hpg; + } + private StaticText lblEspecif2 = new StaticText(); + + public StaticText getLblEspecif2() + { + return lblEspecif2; + } + + public void setLblEspecif2( StaticText st ) + { + this.lblEspecif2 = st; + } + private TextField txtEspecif2 = new TextField(); + + public TextField getTxtEspecif2() + { + return txtEspecif2; + } + + public void setTxtEspecif2( TextField tf ) + { + this.txtEspecif2 = tf; + } + private PanelGroup groupPanel21 = new PanelGroup(); + + public PanelGroup getGroupPanel21() + { + return groupPanel21; + } + + public void setGroupPanel21( PanelGroup pg ) + { + this.groupPanel21 = pg; + } + private Checkbox chkTronco = new Checkbox(); + + public Checkbox getChkTronco() + { + return chkTronco; + } + + public void setChkTronco( Checkbox c ) + { + this.chkTronco = c; + } + private StaticText staticText99 = new StaticText(); + + public StaticText getStaticText99() + { + return staticText99; + } + + public void setStaticText99( StaticText st ) + { + this.staticText99 = st; + } + private PanelGroup groupPanel22 = new PanelGroup(); + + public PanelGroup getGroupPanel22() + { + return groupPanel22; + } + + public void setGroupPanel22( PanelGroup pg ) + { + this.groupPanel22 = pg; + } + private Checkbox chkMembroInfDir = new Checkbox(); + + public Checkbox getChkMembroInfDir() + { + return chkMembroInfDir; + } + + public void setChkMembroInfDir( Checkbox c ) + { + this.chkMembroInfDir = c; + } + private StaticText staticText100 = new StaticText(); + + public StaticText getStaticText100() + { + return staticText100; + } + + public void setStaticText100( StaticText st ) + { + this.staticText100 = st; + } + private HtmlPanelGrid gridPanel64 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel64() + { + return gridPanel64; + } + + public void setGridPanel64( HtmlPanelGrid hpg ) + { + this.gridPanel64 = hpg; + } + private StaticText lblEspecif3 = new StaticText(); + + public StaticText getLblEspecif3() + { + return lblEspecif3; + } + + public void setLblEspecif3( StaticText st ) + { + this.lblEspecif3 = st; + } + private TextField txtEspecif3 = new TextField(); + + public TextField getTxtEspecif3() + { + return txtEspecif3; + } + + public void setTxtEspecif3( TextField tf ) + { + this.txtEspecif3 = tf; + } + private StaticText staticText102 = new StaticText(); + + public StaticText getStaticText102() + { + return staticText102; + } + + public void setStaticText102( StaticText st ) + { + this.staticText102 = st; + } + private PanelGroup groupPanel23 = new PanelGroup(); + + public PanelGroup getGroupPanel23() + { + return groupPanel23; + } + + public void setGroupPanel23( PanelGroup pg ) + { + this.groupPanel23 = pg; + } + private Checkbox chkMembroInfEsq = new Checkbox(); + + public Checkbox getChkMembroInfEsq() + { + return chkMembroInfEsq; + } + + public void setChkMembroInfEsq( Checkbox c ) + { + this.chkMembroInfEsq = c; + } + private StaticText staticText103 = new StaticText(); + + public StaticText getStaticText103() + { + return staticText103; + } + + public void setStaticText103( StaticText st ) + { + this.staticText103 = st; + } + private HtmlPanelGrid gridPanel65 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel65() + { + return gridPanel65; + } + + public void setGridPanel65( HtmlPanelGrid hpg ) + { + this.gridPanel65 = hpg; + } + private StaticText lblEspecif4 = new StaticText(); + + public StaticText getLblEspecif4() + { + return lblEspecif4; + } + + public void setLblEspecif4( StaticText st ) + { + this.lblEspecif4 = st; + } + private TextField txtEspecif4 = new TextField(); + + public TextField getTxtEspecif4() + { + return txtEspecif4; + } + + public void setTxtEspecif4( TextField tf ) + { + this.txtEspecif4 = tf; + } + private HtmlPanelGrid gridPanel66 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel66() + { + return gridPanel66; + } + + public void setGridPanel66( HtmlPanelGrid hpg ) + { + this.gridPanel66 = hpg; + } + private StaticText staticText105 = new StaticText(); + + public StaticText getStaticText105() + { + return staticText105; + } + + public void setStaticText105( StaticText st ) + { + this.staticText105 = st; + } + private TextField txtTipoLesao = new TextField(); + + public TextField getTxtTipoLesao() + { + return txtTipoLesao; + } + + public void setTxtTipoLesao( TextField tf ) + { + this.txtTipoLesao = tf; + } + private HtmlPanelGrid gridPanel67 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel67() + { + return gridPanel67; + } + + public void setGridPanel67( HtmlPanelGrid hpg ) + { + this.gridPanel67 = hpg; + } + private StaticText staticText106 = new StaticText(); + + public StaticText getStaticText106() + { + return staticText106; + } + + public void setStaticText106( StaticText st ) + { + this.staticText106 = st; + } + private HtmlPanelGrid gridIncapacidade1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade1() + { + return gridIncapacidade1; + } + + public void setGridIncapacidade1( HtmlPanelGrid hpg ) + { + this.gridIncapacidade1 = hpg; + } + private HtmlPanelGrid gridPanel68 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel68() + { + return gridPanel68; + } + + public void setGridPanel68( HtmlPanelGrid hpg ) + { + this.gridPanel68 = hpg; + } + private PanelGroup groupPanel24 = new PanelGroup(); + + public PanelGroup getGroupPanel24() + { + return groupPanel24; + } + + public void setGroupPanel24( PanelGroup pg ) + { + this.groupPanel24 = pg; + } + private StaticText staticText107 = new StaticText(); + + public StaticText getStaticText107() + { + return staticText107; + } + + public void setStaticText107( StaticText st ) + { + this.staticText107 = st; + } + private RadioButton rbIncapacidadeNone = new RadioButton(); + + public RadioButton getRbIncapacidadeNone() + { + return rbIncapacidadeNone; + } + + public void setRbIncapacidadeNone( RadioButton rb ) + { + this.rbIncapacidadeNone = rb; + } + private StaticText staticText108 = new StaticText(); + + public StaticText getStaticText108() + { + return staticText108; + } + + public void setStaticText108( StaticText st ) + { + this.staticText108 = st; + } + private RadioButton rbIncapacidadeTemp = new RadioButton(); + + public RadioButton getRbIncapacidadeTemp() + { + return rbIncapacidadeTemp; + } + + public void setRbIncapacidadeTemp( RadioButton rb ) + { + this.rbIncapacidadeTemp = rb; + } + private StaticText staticText109 = new StaticText(); + + public StaticText getStaticText109() + { + return staticText109; + } + + public void setStaticText109( StaticText st ) + { + this.staticText109 = st; + } + private PanelGroup groupPanel25 = new PanelGroup(); + + public PanelGroup getGroupPanel25() + { + return groupPanel25; + } + + public void setGroupPanel25( PanelGroup pg ) + { + this.groupPanel25 = pg; + } + private StaticText staticText110 = new StaticText(); + + public StaticText getStaticText110() + { + return staticText110; + } + + public void setStaticText110( StaticText st ) + { + this.staticText110 = st; + } + private TextField txtCoefIncapacidade = new TextField(); + + public TextField getTxtCoefIncapacidade() + { + return txtCoefIncapacidade; + } + + public void setTxtCoefIncapacidade( TextField tf ) + { + this.txtCoefIncapacidade = tf; + } + private StaticText staticText111 = new StaticText(); + + public StaticText getStaticText111() + { + return staticText111; + } + + public void setStaticText111( StaticText st ) + { + this.staticText111 = st; + } + private HtmlPanelGrid gridPanel69 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel69() + { + return gridPanel69; + } + + public void setGridPanel69( HtmlPanelGrid hpg ) + { + this.gridPanel69 = hpg; + } + private StaticText staticText112 = new StaticText(); + + public StaticText getStaticText112() + { + return staticText112; + } + + public void setStaticText112( StaticText st ) + { + this.staticText112 = st; + } + + + + +// private org.apache.myfaces.custom.date.HtmlInputDate calAvaliacaoIncap = new org.apache.myfaces.custom.date.HtmlInputDate(); +// public org.apache.myfaces.custom.date.HtmlInputDate getCalAvaliacaoIncap() +// { +// return calAvaliacaoIncap; +// } +// public void setCalAvaliacaoIncap( org.apache.myfaces.custom.date.HtmlInputDate calAvaliacaoIncap ) +// { +// this.calAvaliacaoIncap = calAvaliacaoIncap; +// } + + private Date calAvaliacaoIncap = null; + public Date getCalAvaliacaoIncap() + { + return calAvaliacaoIncap; + } + public void setCalAvaliacaoIncap( Date calAvaliacaoIncap ) + { + this.calAvaliacaoIncap = calAvaliacaoIncap; + } + + + + + + private StaticText staticText113 = new StaticText(); + public StaticText getStaticText113() + { + return staticText113; + } + public void setStaticText113( StaticText st ) + { + this.staticText113 = st; + } + + +// private org.apache.myfaces.custom.date.HtmlInputDate calRevisaoIncap = new org.apache.myfaces.custom.date.HtmlInputDate(); +// public org.apache.myfaces.custom.date.HtmlInputDate getCalRevisaoIncap() +// { +// return calRevisaoIncap; +// } +// public void setCalRevisaoIncap( org.apache.myfaces.custom.date.HtmlInputDate calRevisaoIncap ) +// { +// this.calRevisaoIncap = calRevisaoIncap; +// } + private Date calRevisaoIncap = null; + public Date getCalRevisaoIncap() + { + return calRevisaoIncap; + } + public void setCalRevisaoIncap( Date calRevisaoIncap ) + { + this.calRevisaoIncap = calRevisaoIncap; + } + + + + + private HtmlPanelGrid gridPanel70 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel70() + { + return gridPanel70; + } + public void setGridPanel70( HtmlPanelGrid hpg ) + { + this.gridPanel70 = hpg; + } + + + private StaticText staticText114 = new StaticText(); + + public StaticText getStaticText114() + { + return staticText114; + } + + public void setStaticText114( StaticText st ) + { + this.staticText114 = st; + } + + + + +// private org.apache.myfaces.custom.date.HtmlInputDate calPeridoIncapDe = new org.apache.myfaces.custom.date.HtmlInputDate(); +// public org.apache.myfaces.custom.date.HtmlInputDate getCalPeridoIncapDe() +// { +// return calPeridoIncapDe; +// } +// public void setCalPeridoIncapDe( org.apache.myfaces.custom.date.HtmlInputDate calPeridoIncapDe ) +// { +// this.calPeridoIncapDe = calPeridoIncapDe; +// } + + private Date calPeriodoIncapDe = null; + public Date getCalPeriodoIncapDe() + { + return calPeriodoIncapDe; + } + public void setCalPeriodoIncapDe( Date calPeriodoIncapDe ) + { + this.calPeriodoIncapDe = calPeriodoIncapDe; + } + + + + private StaticText staticText115 = new StaticText(); + + public StaticText getStaticText115() + { + return staticText115; + } + + public void setStaticText115( StaticText st ) + { + this.staticText115 = st; + } + + + + +// private org.apache.myfaces.custom.date.HtmlInputDate calPeriodoIncapA = new org.apache.myfaces.custom.date.HtmlInputDate(); +// public org.apache.myfaces.custom.date.HtmlInputDate getCalPeriodoIncapA() +// { +// return calPeriodoIncapA; +// } +// public void setCalPeriodoIncapA( org.apache.myfaces.custom.date.HtmlInputDate calPeriodoIncapA ) +// { +// this.calPeriodoIncapA = calPeriodoIncapA; +// } + + private Date calPeriodoIncapA = null; + public Date getCalPeriodoIncapA() + { + return calPeriodoIncapA; + } + public void setCalPeriodoIncapA( Date calPeriodoIncapA ) + { + this.calPeriodoIncapA = calPeriodoIncapA; + } + + + + + private HtmlPanelGrid gridPanel71 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel71() + { + return gridPanel71; + } + + public void setGridPanel71( HtmlPanelGrid hpg ) + { + this.gridPanel71 = hpg; + } + private StaticText staticText116 = new StaticText(); + + public StaticText getStaticText116() + { + return staticText116; + } + + public void setStaticText116( StaticText st ) + { + this.staticText116 = st; + } + private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes() + { + return gridRestricoes; + } + + public void setGridRestricoes( HtmlPanelGrid hpg ) + { + this.gridRestricoes = hpg; + } + private HtmlPanelGrid gridPanel72 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel72() + { + return gridPanel72; + } + + public void setGridPanel72( HtmlPanelGrid hpg ) + { + this.gridPanel72 = hpg; + } + private HtmlPanelGrid gridPanel73 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel73() + { + return gridPanel73; + } + + public void setGridPanel73( HtmlPanelGrid hpg ) + { + this.gridPanel73 = hpg; + } + private HtmlPanelGrid gridPanel74 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel74() + { + return gridPanel74; + } + + public void setGridPanel74( HtmlPanelGrid hpg ) + { + this.gridPanel74 = hpg; + } + private HtmlPanelGrid gridPanel75 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel75() + { + return gridPanel75; + } + + public void setGridPanel75( HtmlPanelGrid hpg ) + { + this.gridPanel75 = hpg; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private ImageComponent image4 = new ImageComponent(); + + public ImageComponent getImage4() + { + return image4; + } + + public void setImage4( ImageComponent ic ) + { + this.image4 = ic; + } + private ImageComponent image5 = new ImageComponent(); + + public ImageComponent getImage5() + { + return image5; + } + + public void setImage5( ImageComponent ic ) + { + this.image5 = ic; + } + private PanelGroup groupPanel26 = new PanelGroup(); + + public PanelGroup getGroupPanel26() + { + return groupPanel26; + } + + public void setGroupPanel26( PanelGroup pg ) + { + this.groupPanel26 = pg; + } + private StaticText staticText117 = new StaticText(); + + public StaticText getStaticText117() + { + return staticText117; + } + + public void setStaticText117( StaticText st ) + { + this.staticText117 = st; + } + private Checkbox chkImgFlexao = new Checkbox(); + + public Checkbox getChkImgFlexao() + { + return chkImgFlexao; + } + + public void setChkImgFlexao( Checkbox c ) + { + this.chkImgFlexao = c; + } + private HtmlPanelGrid gridPanel76 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel76() + { + return gridPanel76; + } + + public void setGridPanel76( HtmlPanelGrid hpg ) + { + this.gridPanel76 = hpg; + } + private ImageComponent image6 = new ImageComponent(); + + public ImageComponent getImage6() + { + return image6; + } + + public void setImage6( ImageComponent ic ) + { + this.image6 = ic; + } + private HtmlPanelGrid gridPanel77 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel77() + { + return gridPanel77; + } + + public void setGridPanel77( HtmlPanelGrid hpg ) + { + this.gridPanel77 = hpg; + } + private ImageComponent image7 = new ImageComponent(); + + public ImageComponent getImage7() + { + return image7; + } + + public void setImage7( ImageComponent ic ) + { + this.image7 = ic; + } + private ImageComponent image8 = new ImageComponent(); + + public ImageComponent getImage8() + { + return image8; + } + + public void setImage8( ImageComponent ic ) + { + this.image8 = ic; + } + private PanelGroup groupPanel27 = new PanelGroup(); + + public PanelGroup getGroupPanel27() + { + return groupPanel27; + } + + public void setGroupPanel27( PanelGroup pg ) + { + this.groupPanel27 = pg; + } + private StaticText staticText118 = new StaticText(); + + public StaticText getStaticText118() + { + return staticText118; + } + + public void setStaticText118( StaticText st ) + { + this.staticText118 = st; + } + private Checkbox chkImgExt1 = new Checkbox(); + + public Checkbox getChkImgExt1() + { + return chkImgExt1; + } + + public void setChkImgExt1( Checkbox c ) + { + this.chkImgExt1 = c; + } + private PanelGroup groupPanel28 = new PanelGroup(); + + public PanelGroup getGroupPanel28() + { + return groupPanel28; + } + + public void setGroupPanel28( PanelGroup pg ) + { + this.groupPanel28 = pg; + } + private StaticText staticText119 = new StaticText(); + + public StaticText getStaticText119() + { + return staticText119; + } + + public void setStaticText119( StaticText st ) + { + this.staticText119 = st; + } + private Checkbox chkImgExt2 = new Checkbox(); + + public Checkbox getChkImgExt2() + { + return chkImgExt2; + } + + public void setChkImgExt2( Checkbox c ) + { + this.chkImgExt2 = c; + } + private HtmlPanelGrid gridPanel78 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel78() + { + return gridPanel78; + } + + public void setGridPanel78( HtmlPanelGrid hpg ) + { + this.gridPanel78 = hpg; + } + private ImageComponent image9 = new ImageComponent(); + + public ImageComponent getImage9() + { + return image9; + } + + public void setImage9( ImageComponent ic ) + { + this.image9 = ic; + } + private ImageComponent image10 = new ImageComponent(); + + public ImageComponent getImage10() + { + return image10; + } + + public void setImage10( ImageComponent ic ) + { + this.image10 = ic; + } + private PanelGroup groupPanel29 = new PanelGroup(); + + public PanelGroup getGroupPanel29() + { + return groupPanel29; + } + + public void setGroupPanel29( PanelGroup pg ) + { + this.groupPanel29 = pg; + } + private StaticText staticText120 = new StaticText(); + + public StaticText getStaticText120() + { + return staticText120; + } + + public void setStaticText120( StaticText st ) + { + this.staticText120 = st; + } + private Checkbox chkImgCab2 = new Checkbox(); + + public Checkbox getChkImgCab2() + { + return chkImgCab2; + } + + public void setChkImgCab2( Checkbox c ) + { + this.chkImgCab2 = c; + } + private PanelGroup groupPanel30 = new PanelGroup(); + + public PanelGroup getGroupPanel30() + { + return groupPanel30; + } + + public void setGroupPanel30( PanelGroup pg ) + { + this.groupPanel30 = pg; + } + private StaticText staticText121 = new StaticText(); + + public StaticText getStaticText121() + { + return staticText121; + } + + public void setStaticText121( StaticText st ) + { + this.staticText121 = st; + } + private Checkbox chkImgCab3 = new Checkbox(); + + public Checkbox getChkImgCab3() + { + return chkImgCab3; + } + + public void setChkImgCab3( Checkbox c ) + { + this.chkImgCab3 = c; + } + private HtmlPanelGrid gridPanel79 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel79() + { + return gridPanel79; + } + + public void setGridPanel79( HtmlPanelGrid hpg ) + { + this.gridPanel79 = hpg; + } + private ImageComponent image12 = new ImageComponent(); + + public ImageComponent getImage12() + { + return image12; + } + + public void setImage12( ImageComponent ic ) + { + this.image12 = ic; + } + private ImageComponent image13 = new ImageComponent(); + + public ImageComponent getImage13() + { + return image13; + } + + public void setImage13( ImageComponent ic ) + { + this.image13 = ic; + } + private ImageComponent image14 = new ImageComponent(); + + public ImageComponent getImage14() + { + return image14; + } + + public void setImage14( ImageComponent ic ) + { + this.image14 = ic; + } + private PanelGroup groupPanel31 = new PanelGroup(); + + public PanelGroup getGroupPanel31() + { + return groupPanel31; + } + + public void setGroupPanel31( PanelGroup pg ) + { + this.groupPanel31 = pg; + } + private StaticText staticText122 = new StaticText(); + + public StaticText getStaticText122() + { + return staticText122; + } + + public void setStaticText122( StaticText st ) + { + this.staticText122 = st; + } + private Checkbox chkImgMa2 = new Checkbox(); + + public Checkbox getChkImgMa2() + { + return chkImgMa2; + } + + public void setChkImgMa2( Checkbox c ) + { + this.chkImgMa2 = c; + } + private PanelGroup groupPanel32 = new PanelGroup(); + + public PanelGroup getGroupPanel32() + { + return groupPanel32; + } + + public void setGroupPanel32( PanelGroup pg ) + { + this.groupPanel32 = pg; + } + private StaticText staticText123 = new StaticText(); + + public StaticText getStaticText123() + { + return staticText123; + } + + public void setStaticText123( StaticText st ) + { + this.staticText123 = st; + } + private Checkbox chkImgMa3 = new Checkbox(); + + public Checkbox getChkImgMa3() + { + return chkImgMa3; + } + + public void setChkImgMa3( Checkbox c ) + { + this.chkImgMa3 = c; + } + private PanelGroup groupPanel33 = new PanelGroup(); + + public PanelGroup getGroupPanel33() + { + return groupPanel33; + } + + public void setGroupPanel33( PanelGroup pg ) + { + this.groupPanel33 = pg; + } + private StaticText staticText124 = new StaticText(); + + public StaticText getStaticText124() + { + return staticText124; + } + + public void setStaticText124( StaticText st ) + { + this.staticText124 = st; + } + private Checkbox chkImgMa5 = new Checkbox(); + + public Checkbox getChkImgMa5() + { + return chkImgMa5; + } + + public void setChkImgMa5( Checkbox c ) + { + this.chkImgMa5 = c; + } + private PanelGroup groupPanel34 = new PanelGroup(); + + public PanelGroup getGroupPanel34() + { + return groupPanel34; + } + + public void setGroupPanel34( PanelGroup pg ) + { + this.groupPanel34 = pg; + } + private StaticText staticText125 = new StaticText(); + + public StaticText getStaticText125() + { + return staticText125; + } + + public void setStaticText125( StaticText st ) + { + this.staticText125 = st; + } + private Checkbox chkImgMa6 = new Checkbox(); + + public Checkbox getChkImgMa6() + { + return chkImgMa6; + } + + public void setChkImgMa6( Checkbox c ) + { + this.chkImgMa6 = c; + } + private HtmlPanelGrid gridPanel80 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel80() + { + return gridPanel80; + } + + public void setGridPanel80( HtmlPanelGrid hpg ) + { + this.gridPanel80 = hpg; + } + private ImageComponent image15 = new ImageComponent(); + + public ImageComponent getImage15() + { + return image15; + } + + public void setImage15( ImageComponent ic ) + { + this.image15 = ic; + } + private ImageComponent image16 = new ImageComponent(); + + public ImageComponent getImage16() + { + return image16; + } + + public void setImage16( ImageComponent ic ) + { + this.image16 = ic; + } + private PanelGroup groupPanel35 = new PanelGroup(); + + public PanelGroup getGroupPanel35() + { + return groupPanel35; + } + + public void setGroupPanel35( PanelGroup pg ) + { + this.groupPanel35 = pg; + } + private StaticText staticText126 = new StaticText(); + + public StaticText getStaticText126() + { + return staticText126; + } + + public void setStaticText126( StaticText st ) + { + this.staticText126 = st; + } + private Checkbox chkImgMa8 = new Checkbox(); + + public Checkbox getChkImgMa8() + { + return chkImgMa8; + } + + public void setChkImgMa8( Checkbox c ) + { + this.chkImgMa8 = c; + } + private PanelGroup groupPanel36 = new PanelGroup(); + + public PanelGroup getGroupPanel36() + { + return groupPanel36; + } + + public void setGroupPanel36( PanelGroup pg ) + { + this.groupPanel36 = pg; + } + private StaticText staticText127 = new StaticText(); + + public StaticText getStaticText127() + { + return staticText127; + } + + public void setStaticText127( StaticText st ) + { + this.staticText127 = st; + } + private Checkbox chkImgMa10 = new Checkbox(); + + public Checkbox getChkImgMa10() + { + return chkImgMa10; + } + + public void setChkImgMa10( Checkbox c ) + { + this.chkImgMa10 = c; + } + private HtmlPanelGrid gridPanel81 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel81() + { + return gridPanel81; + } + + public void setGridPanel81( HtmlPanelGrid hpg ) + { + this.gridPanel81 = hpg; + } + private StaticText staticText128 = new StaticText(); + + public StaticText getStaticText128() + { + return staticText128; + } + + public void setStaticText128( StaticText st ) + { + this.staticText128 = st; + } + private PanelGroup groupPanel37 = new PanelGroup(); + + public PanelGroup getGroupPanel37() + { + return groupPanel37; + } + + public void setGroupPanel37( PanelGroup pg ) + { + this.groupPanel37 = pg; + } + private Checkbox chkRestricaoCargas = new Checkbox(); + + public Checkbox getChkRestricaoCargas() + { + return chkRestricaoCargas; + } + + public void setChkRestricaoCargas( Checkbox c ) + { + this.chkRestricaoCargas = c; + } + private StaticText staticText129 = new StaticText(); + + public StaticText getStaticText129() + { + return staticText129; + } + + public void setStaticText129( StaticText st ) + { + this.staticText129 = st; + } + private RadioButton rbKgs2 = new RadioButton(); + + public RadioButton getRbKgs2() + { + return rbKgs2; + } + + public void setRbKgs2( RadioButton rb ) + { + this.rbKgs2 = rb; + } + private StaticText stKgs2 = new StaticText(); + + public StaticText getStKgs2() + { + return stKgs2; + } + + public void setStKgs2( StaticText st ) + { + this.stKgs2 = st; + } + private RadioButton rbKgs5 = new RadioButton(); + + public RadioButton getRbKgs5() + { + return rbKgs5; + } + + public void setRbKgs5( RadioButton rb ) + { + this.rbKgs5 = rb; + } + private StaticText stKgs5 = new StaticText(); + + public StaticText getStKgs5() + { + return stKgs5; + } + + public void setStKgs5( StaticText st ) + { + this.stKgs5 = st; + } + private RadioButton rbKgs10 = new RadioButton(); + + public RadioButton getRbKgs10() + { + return rbKgs10; + } + + public void setRbKgs10( RadioButton rb ) + { + this.rbKgs10 = rb; + } + private StaticText stKgs10 = new StaticText(); + + public StaticText getStKgs10() + { + return stKgs10; + } + + public void setStKgs10( StaticText st ) + { + this.stKgs10 = st; + } + private RadioButton rbKgs15 = new RadioButton(); + + public RadioButton getRbKgs15() + { + return rbKgs15; + } + + public void setRbKgs15( RadioButton rb ) + { + this.rbKgs15 = rb; + } + private StaticText stKgs15 = new StaticText(); + + public StaticText getStKgs15() + { + return stKgs15; + } + + public void setStKgs15( StaticText st ) + { + this.stKgs15 = st; + } + private RadioButton rbKgsOutro = new RadioButton(); + + public RadioButton getRbKgsOutro() + { + return rbKgsOutro; + } + + public void setRbKgsOutro( RadioButton rb ) + { + this.rbKgsOutro = rb; + } + private StaticText stKgsOutro = new StaticText(); + + public StaticText getStKgsOutro() + { + return stKgsOutro; + } + + public void setStKgsOutro( StaticText st ) + { + this.stKgsOutro = st; + } + private TextField txtKgs = new TextField(); + + public TextField getTxtKgs() + { + return txtKgs; + } + + public void setTxtKgs( TextField tf ) + { + this.txtKgs = tf; + } + private StaticText stKg = new StaticText(); + + public StaticText getStKg() + { + return stKg; + } + + public void setStKg( StaticText st ) + { + this.stKg = st; + } + private PanelGroup groupPanel38 = new PanelGroup(); + + public PanelGroup getGroupPanel38() + { + return groupPanel38; + } + + public void setGroupPanel38( PanelGroup pg ) + { + this.groupPanel38 = pg; + } + private Checkbox chkRestricaoMotricidade = new Checkbox(); + + public Checkbox getChkRestricaoMotricidade() + { + return chkRestricaoMotricidade; + } + + public void setChkRestricaoMotricidade( Checkbox c ) + { + this.chkRestricaoMotricidade = c; + } + private StaticText staticText136 = new StaticText(); + + public StaticText getStaticText136() + { + return staticText136; + } + + public void setStaticText136( StaticText st ) + { + this.staticText136 = st; + } + private PanelGroup groupPanel39 = new PanelGroup(); + + public PanelGroup getGroupPanel39() + { + return groupPanel39; + } + + public void setGroupPanel39( PanelGroup pg ) + { + this.groupPanel39 = pg; + } + private Checkbox chkRestricaoConducao = new Checkbox(); + + public Checkbox getChkRestricaoConducao() + { + return chkRestricaoConducao; + } + + public void setChkRestricaoConducao( Checkbox c ) + { + this.chkRestricaoConducao = c; + } + private StaticText staticText137 = new StaticText(); + + public StaticText getStaticText137() + { + return staticText137; + } + + public void setStaticText137( StaticText st ) + { + this.staticText137 = st; + } + private PanelGroup groupPanel40 = new PanelGroup(); + + public PanelGroup getGroupPanel40() + { + return groupPanel40; + } + + public void setGroupPanel40( PanelGroup pg ) + { + this.groupPanel40 = pg; + } + private Checkbox chkRestricaoVibracoes = new Checkbox(); + + public Checkbox getChkRestricaoVibracoes() + { + return chkRestricaoVibracoes; + } + + public void setChkRestricaoVibracoes( Checkbox c ) + { + this.chkRestricaoVibracoes = c; + } + private StaticText staticText138 = new StaticText(); + + public StaticText getStaticText138() + { + return staticText138; + } + + public void setStaticText138( StaticText st ) + { + this.staticText138 = st; + } + private HtmlPanelGrid gridPanel82 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel82() + { + return gridPanel82; + } + + public void setGridPanel82( HtmlPanelGrid hpg ) + { + this.gridPanel82 = hpg; + } + private PanelGroup groupPanel41 = new PanelGroup(); + + public PanelGroup getGroupPanel41() + { + return groupPanel41; + } + + public void setGroupPanel41( PanelGroup pg ) + { + this.groupPanel41 = pg; + } + private Checkbox chkRestricaoOutras = new Checkbox(); + + public Checkbox getChkRestricaoOutras() + { + return chkRestricaoOutras; + } + + public void setChkRestricaoOutras( Checkbox c ) + { + this.chkRestricaoOutras = c; + } + private StaticText staticText139 = new StaticText(); + + public StaticText getStaticText139() + { + return staticText139; + } + + public void setStaticText139( StaticText st ) + { + this.staticText139 = st; + } + private TextField txtRestricaoOutras = new TextField(); + + public TextField getTxtRestricaoOutras() + { + return txtRestricaoOutras; + } + + public void setTxtRestricaoOutras( TextField tf ) + { + this.txtRestricaoOutras = tf; + } + private HtmlPanelGrid gridPanel83 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel83() + { + return gridPanel83; + } + + public void setGridPanel83( HtmlPanelGrid hpg ) + { + this.gridPanel83 = hpg; + } + private StaticText staticText140 = new StaticText(); + + public StaticText getStaticText140() + { + return staticText140; + } + + public void setStaticText140( StaticText st ) + { + this.staticText140 = st; + } + private TextField txtObservacoes = new TextField(); + + public TextField getTxtObservacoes() + { + return txtObservacoes; + } + + public void setTxtObservacoes( TextField tf ) + { + this.txtObservacoes = tf; + } + private RadioButton rbIncapacidadePerm = new RadioButton(); + + public RadioButton getRbIncapacidadePerm() + { + return rbIncapacidadePerm; + } + + public void setRbIncapacidadePerm( RadioButton rb ) + { + this.rbIncapacidadePerm = rb; + } + private StaticText staticText141 = new StaticText(); + + public StaticText getStaticText141() + { + return staticText141; + } + + public void setStaticText141( StaticText st ) + { + this.staticText141 = st; + } + private ImageComponent image17 = new ImageComponent(); + + public ImageComponent getImage17() + { + return image17; + } + + public void setImage17( ImageComponent ic ) + { + this.image17 = ic; + } + private ImageComponent image18 = new ImageComponent(); + + public ImageComponent getImage18() + { + return image18; + } + + public void setImage18( ImageComponent ic ) + { + this.image18 = ic; + } + private HtmlPanelGrid gridPanel84 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel84() + { + return gridPanel84; + } + + public void setGridPanel84( HtmlPanelGrid hpg ) + { + this.gridPanel84 = hpg; + } + private ImageComponent image19 = new ImageComponent(); + + public ImageComponent getImage19() + { + return image19; + } + + public void setImage19( ImageComponent ic ) + { + this.image19 = ic; + } + private ImageComponent image20 = new ImageComponent(); + + public ImageComponent getImage20() + { + return image20; + } + + public void setImage20( ImageComponent ic ) + { + this.image20 = ic; + } + private PanelGroup groupPanel42 = new PanelGroup(); + + public PanelGroup getGroupPanel42() + { + return groupPanel42; + } + + public void setGroupPanel42( PanelGroup pg ) + { + this.groupPanel42 = pg; + } + private StaticText staticText142 = new StaticText(); + + public StaticText getStaticText142() + { + return staticText142; + } + + public void setStaticText142( StaticText st ) + { + this.staticText142 = st; + } + private Checkbox chkImgRot1 = new Checkbox(); + + public Checkbox getChkImgRot1() + { + return chkImgRot1; + } + + public void setChkImgRot1( Checkbox c ) + { + this.chkImgRot1 = c; + } + private PanelGroup groupPanel43 = new PanelGroup(); + + public PanelGroup getGroupPanel43() + { + return groupPanel43; + } + + public void setGroupPanel43( PanelGroup pg ) + { + this.groupPanel43 = pg; + } + private StaticText staticText143 = new StaticText(); + + public StaticText getStaticText143() + { + return staticText143; + } + + public void setStaticText143( StaticText st ) + { + this.staticText143 = st; + } + private Checkbox chkImgRot2 = new Checkbox(); + + public Checkbox getChkImgRot2() + { + return chkImgRot2; + } + + public void setChkImgRot2( Checkbox c ) + { + this.chkImgRot2 = c; + } + private ImageComponent image21 = new ImageComponent(); + + public ImageComponent getImage21() + { + return image21; + } + + public void setImage21( ImageComponent ic ) + { + this.image21 = ic; + } + private ImageComponent image11 = new ImageComponent(); + + public ImageComponent getImage11() + { + return image11; + } + + public void setImage11( ImageComponent ic ) + { + this.image11 = ic; + } + private PanelGroup groupPanel44 = new PanelGroup(); + + public PanelGroup getGroupPanel44() + { + return groupPanel44; + } + + public void setGroupPanel44( PanelGroup pg ) + { + this.groupPanel44 = pg; + } + private StaticText staticText144 = new StaticText(); + + public StaticText getStaticText144() + { + return staticText144; + } + + public void setStaticText144( StaticText st ) + { + this.staticText144 = st; + } + private Checkbox chkImgCab1 = new Checkbox(); + + public Checkbox getChkImgCab1() + { + return chkImgCab1; + } + + public void setChkImgCab1( Checkbox c ) + { + this.chkImgCab1 = c; + } + private PanelGroup groupPanel45 = new PanelGroup(); + + public PanelGroup getGroupPanel45() + { + return groupPanel45; + } + + public void setGroupPanel45( PanelGroup pg ) + { + this.groupPanel45 = pg; + } + private StaticText staticText145 = new StaticText(); + + public StaticText getStaticText145() + { + return staticText145; + } + + public void setStaticText145( StaticText st ) + { + this.staticText145 = st; + } + private Checkbox chkImgCab4 = new Checkbox(); + + public Checkbox getChkImgCab4() + { + return chkImgCab4; + } + + public void setChkImgCab4( Checkbox c ) + { + this.chkImgCab4 = c; + } + private ImageComponent image22 = new ImageComponent(); + + public ImageComponent getImage22() + { + return image22; + } + + public void setImage22( ImageComponent ic ) + { + this.image22 = ic; + } + private ImageComponent image23 = new ImageComponent(); + + public ImageComponent getImage23() + { + return image23; + } + + public void setImage23( ImageComponent ic ) + { + this.image23 = ic; + } + private ImageComponent image24 = new ImageComponent(); + + public ImageComponent getImage24() + { + return image24; + } + + public void setImage24( ImageComponent ic ) + { + this.image24 = ic; + } + private PanelGroup groupPanel46 = new PanelGroup(); + + public PanelGroup getGroupPanel46() + { + return groupPanel46; + } + + public void setGroupPanel46( PanelGroup pg ) + { + this.groupPanel46 = pg; + } + private StaticText staticText146 = new StaticText(); + + public StaticText getStaticText146() + { + return staticText146; + } + + public void setStaticText146( StaticText st ) + { + this.staticText146 = st; + } + private Checkbox chkImgMa1 = new Checkbox(); + + public Checkbox getChkImgMa1() + { + return chkImgMa1; + } + + public void setChkImgMa1( Checkbox c ) + { + this.chkImgMa1 = c; + } + private PanelGroup groupPanel47 = new PanelGroup(); + + public PanelGroup getGroupPanel47() + { + return groupPanel47; + } + + public void setGroupPanel47( PanelGroup pg ) + { + this.groupPanel47 = pg; + } + private StaticText staticText147 = new StaticText(); + + public StaticText getStaticText147() + { + return staticText147; + } + + public void setStaticText147( StaticText st ) + { + this.staticText147 = st; + } + private Checkbox chkImgMa4 = new Checkbox(); + + public Checkbox getChkImgMa4() + { + return chkImgMa4; + } + + public void setChkImgMa4( Checkbox c ) + { + this.chkImgMa4 = c; + } + private ImageComponent image25 = new ImageComponent(); + + public ImageComponent getImage25() + { + return image25; + } + + public void setImage25( ImageComponent ic ) + { + this.image25 = ic; + } + private ImageComponent image26 = new ImageComponent(); + + public ImageComponent getImage26() + { + return image26; + } + + public void setImage26( ImageComponent ic ) + { + this.image26 = ic; + } + private PanelGroup groupPanel48 = new PanelGroup(); + + public PanelGroup getGroupPanel48() + { + return groupPanel48; + } + + public void setGroupPanel48( PanelGroup pg ) + { + this.groupPanel48 = pg; + } + private StaticText staticText148 = new StaticText(); + + public StaticText getStaticText148() + { + return staticText148; + } + + public void setStaticText148( StaticText st ) + { + this.staticText148 = st; + } + private Checkbox chkImgMa7 = new Checkbox(); + + public Checkbox getChkImgMa7() + { + return chkImgMa7; + } + + public void setChkImgMa7( Checkbox c ) + { + this.chkImgMa7 = c; + } + private PanelGroup groupPanel49 = new PanelGroup(); + + public PanelGroup getGroupPanel49() + { + return groupPanel49; + } + + public void setGroupPanel49( PanelGroup pg ) + { + this.groupPanel49 = pg; + } + private StaticText staticText149 = new StaticText(); + + public StaticText getStaticText149() + { + return staticText149; + } + + public void setStaticText149( StaticText st ) + { + this.staticText149 = st; + } + private Checkbox chkImgMa9 = new Checkbox(); + + public Checkbox getChkImgMa9() + { + return chkImgMa9; + } + + public void setChkImgMa9( Checkbox c ) + { + this.chkImgMa9 = c; + } + private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedicoView() + { + return gridMedicoView; + } + + public void setGridMedicoView( HtmlPanelGrid hpg ) + { + this.gridMedicoView = hpg; + } + private HtmlPanelGrid gridPanel85 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel85() + { + return gridPanel85; + } + + public void setGridPanel85( HtmlPanelGrid hpg ) + { + this.gridPanel85 = hpg; + } + private StaticText staticText150 = new StaticText(); + + public StaticText getStaticText150() + { + return staticText150; + } + + public void setStaticText150( StaticText st ) + { + this.staticText150 = st; + } + private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao() + { + return gridLesao; + } + + public void setGridLesao( HtmlPanelGrid hpg ) + { + this.gridLesao = hpg; + } + private StaticText staticText151 = new StaticText(); + + public StaticText getStaticText151() + { + return staticText151; + } + + public void setStaticText151( StaticText st ) + { + this.staticText151 = st; + } + private HtmlPanelGrid gridPanel86 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel86() + { + return gridPanel86; + } + + public void setGridPanel86( HtmlPanelGrid hpg ) + { + this.gridPanel86 = hpg; + } + private StaticText staticText152 = new StaticText(); + + public StaticText getStaticText152() + { + return staticText152; + } + + public void setStaticText152( StaticText st ) + { + this.staticText152 = st; + } + private HtmlPanelGrid gridIncapacidade2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade2() + { + return gridIncapacidade2; + } + + public void setGridIncapacidade2( HtmlPanelGrid hpg ) + { + this.gridIncapacidade2 = hpg; + } + private HtmlPanelGrid gridPanel87 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel87() + { + return gridPanel87; + } + + public void setGridPanel87( HtmlPanelGrid hpg ) + { + this.gridPanel87 = hpg; + } + private StaticText staticText153 = new StaticText(); + + public StaticText getStaticText153() + { + return staticText153; + } + + public void setStaticText153( StaticText st ) + { + this.staticText153 = st; + } + private HtmlPanelGrid gridRestricoes1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes1() + { + return gridRestricoes1; + } + + public void setGridRestricoes1( HtmlPanelGrid hpg ) + { + this.gridRestricoes1 = hpg; + } + private HtmlPanelGrid gridPanel88 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel88() + { + return gridPanel88; + } + + public void setGridPanel88( HtmlPanelGrid hpg ) + { + this.gridPanel88 = hpg; + } + private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImagesRestricoes() + { + return gridImagesRestricoes; + } + + public void setGridImagesRestricoes( HtmlPanelGrid hpg ) + { + this.gridImagesRestricoes = hpg; + } + private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridOutrasRestricoes() + { + return gridOutrasRestricoes; + } + + public void setGridOutrasRestricoes( HtmlPanelGrid hpg ) + { + this.gridOutrasRestricoes = hpg; + } + private StaticText staticText154 = new StaticText(); + + public StaticText getStaticText154() + { + return staticText154; + } + + public void setStaticText154( StaticText st ) + { + this.staticText154 = st; + } + private HtmlPanelGrid gridPanel90 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel90() + { + return gridPanel90; + } + + public void setGridPanel90( HtmlPanelGrid hpg ) + { + this.gridPanel90 = hpg; + } + private StaticText staticText155 = new StaticText(); + + public StaticText getStaticText155() + { + return staticText155; + } + + public void setStaticText155( StaticText st ) + { + this.staticText155 = st; + } + private StaticText stObservacoes = new StaticText(); + + public StaticText getStObservacoes() + { + return stObservacoes; + } + + public void setStObservacoes( StaticText st ) + { + this.stObservacoes = st; + } + private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridHeader1() + { + return gridHeader1; + } + + public void setGridHeader1( HtmlPanelGrid hpg ) + { + this.gridHeader1 = hpg; + } + private HtmlPanelGrid gridPanel114 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel114() + { + return gridPanel114; + } + + public void setGridPanel114( HtmlPanelGrid hpg ) + { + this.gridPanel114 = hpg; + } + private PanelGroup groupPanel57 = new PanelGroup(); + + public PanelGroup getGroupPanel57() + { + return groupPanel57; + } + + public void setGroupPanel57( PanelGroup pg ) + { + this.groupPanel57 = pg; + } + private ImageComponent image27 = new ImageComponent(); + + public ImageComponent getImage27() + { + return image27; + } + + public void setImage27( ImageComponent ic ) + { + this.image27 = ic; + } + private HtmlPanelGrid gridPanel115 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel115() + { + return gridPanel115; + } + + public void setGridPanel115( HtmlPanelGrid hpg ) + { + this.gridPanel115 = hpg; + } + private StaticText staticText168 = new StaticText(); + + public StaticText getStaticText168() + { + return staticText168; + } + + public void setStaticText168( StaticText st ) + { + this.staticText168 = st; + } + private HtmlPanelGrid gridPanel116 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel116() + { + return gridPanel116; + } + + public void setGridPanel116( HtmlPanelGrid hpg ) + { + this.gridPanel116 = hpg; + } + private PanelGroup groupPanel58 = new PanelGroup(); + + public PanelGroup getGroupPanel58() + { + return groupPanel58; + } + + public void setGroupPanel58( PanelGroup pg ) + { + this.groupPanel58 = pg; + } + private StaticText staticText169 = new StaticText(); + + public StaticText getStaticText169() + { + return staticText169; + } + + public void setStaticText169( StaticText st ) + { + this.staticText169 = st; + } + private StaticText stHeaderNr = new StaticText(); + + public StaticText getStHeaderNr() + { + return stHeaderNr; + } + + public void setStHeaderNr( StaticText st ) + { + this.stHeaderNr = st; + } + private PanelGroup groupPanel59 = new PanelGroup(); + + public PanelGroup getGroupPanel59() + { + return groupPanel59; + } + + public void setGroupPanel59( PanelGroup pg ) + { + this.groupPanel59 = pg; + } + private StaticText staticText170 = new StaticText(); + + public StaticText getStaticText170() + { + return staticText170; + } + + public void setStaticText170( StaticText st ) + { + this.staticText170 = st; + } + private StaticText stHeaderDate = new StaticText(); + + public StaticText getStHeaderDate() + { + return stHeaderDate; + } + + public void setStHeaderDate( StaticText st ) + { + this.stHeaderDate = st; + } + private ImageComponent image28 = new ImageComponent(); + + public ImageComponent getImage28() + { + return image28; + } + + public void setImage28( ImageComponent ic ) + { + this.image28 = ic; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private RadioButton rbTurnoManha = new RadioButton(); + + public RadioButton getRbTurnoManha() + { + return rbTurnoManha; + } + + public void setRbTurnoManha( RadioButton rb ) + { + this.rbTurnoManha = rb; + } + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() + { + return staticText1; + } + + public void setStaticText1( StaticText st ) + { + this.staticText1 = st; + } + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() + { + return staticText2; + } + + public void setStaticText2( StaticText st ) + { + this.staticText2 = st; + } + private RadioButton rbTurnoTarde = new RadioButton(); + + public RadioButton getRbTurnoTarde() + { + return rbTurnoTarde; + } + + public void setRbTurnoTarde( RadioButton rb ) + { + this.rbTurnoTarde = rb; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private StaticText staticText41 = new StaticText(); + + public StaticText getStaticText41() + { + return staticText41; + } + + public void setStaticText41( StaticText st ) + { + this.staticText41 = st; + } + private RadioButton rbTurnoNoite = new RadioButton(); + + public RadioButton getRbTurnoNoite() + { + return rbTurnoNoite; + } + + public void setRbTurnoNoite( RadioButton rb ) + { + this.rbTurnoNoite = rb; + } + private StaticText staticText42 = new StaticText(); + + public StaticText getStaticText42() + { + return staticText42; + } + + public void setStaticText42( StaticText st ) + { + this.staticText42 = st; + } + + private RadioButton rbTurnoOutro = new RadioButton(); + + public RadioButton getRbTurnoOutro() + { + return rbTurnoOutro; + } + + public void setRbTurnoOutro( RadioButton rb ) + { + this.rbTurnoOutro = rb; + } + private StaticText staticTextTurnoOutro = new StaticText(); + + public StaticText getStaticTextTurnoOutro() + { + return staticTextTurnoOutro; + } + + public void setStaticTextTurnoOutro( StaticText st ) + { + this.staticTextTurnoOutro = st; + } + + private HiddenField hidDisableEnviar = new HiddenField(); + + public HiddenField getHidDisableEnviar() + { + return hidDisableEnviar; + } + + public void setHidDisableEnviar( HiddenField hf ) + { + this.hidDisableEnviar = hf; + } + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() + { + return groupPanel2; + } + + public void setGroupPanel2( PanelGroup pg ) + { + this.groupPanel2 = pg; + } + private StaticText staticText43 = new StaticText(); + + public StaticText getStaticText43() + { + return staticText43; + } + + public void setStaticText43( StaticText st ) + { + this.staticText43 = st; + } + private TextField txtNrMecanografico = new TextField(); + + public TextField getTxtNrMecanografico() + { + return txtNrMecanografico; + } + + public void setTxtNrMecanografico( TextField tf ) + { + this.txtNrMecanografico = tf; + } + private StaticText staticText44 = new StaticText(); + + public StaticText getStaticText44() + { + return staticText44; + } + + public void setStaticText44( StaticText st ) + { + this.staticText44 = st; + } + private TextField txtNomeTrabalhador = new TextField(); + + public TextField getTxtNomeTrabalhador() + { + return txtNomeTrabalhador; + } + + public void setTxtNomeTrabalhador( TextField tf ) + { + this.txtNomeTrabalhador = tf; + } + private StaticText staticText45 = new StaticText(); + + public StaticText getStaticText45() + { + return staticText45; + } + + public void setStaticText45( StaticText st ) + { + this.staticText45 = st; + } + private Button butProcurarTrab = new Button(); + + public Button getButProcurarTrab() + { + return butProcurarTrab; + } + + public void setButProcurarTrab( Button b ) + { + this.butProcurarTrab = b; + } + private Table tblTrabalhadores = new Table(); + + public Table getTblTrabalhadores() + { + return tblTrabalhadores; + } + + public void setTblTrabalhadores( Table t ) + { + this.tblTrabalhadores = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private DefaultTableDataProvider defaultTableDataProvider = new DefaultTableDataProvider(); + + public DefaultTableDataProvider getDefaultTableDataProvider() + { + return defaultTableDataProvider; + } + + public void setDefaultTableDataProvider( DefaultTableDataProvider dtdp ) + { + this.defaultTableDataProvider = dtdp; + } + private Hyperlink lnkPOR = new Hyperlink(); + + public Hyperlink getLnkPOR() + { + return lnkPOR; + } + + public void setLnkPOR( Hyperlink h ) + { + this.lnkPOR = h; + } + private Hyperlink lnkNomeTrabalhador = new Hyperlink(); + + public Hyperlink getLnkNomeTrabalhador() + { + return lnkNomeTrabalhador; + } + + public void setLnkNomeTrabalhador( Hyperlink h ) + { + this.lnkNomeTrabalhador = h; + } + private Hyperlink lnkEstabelecimentoTrabalhador = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoTrabalhador() + { + return lnkEstabelecimentoTrabalhador; + } + + public void setLnkEstabelecimentoTrabalhador( Hyperlink h ) + { + this.lnkEstabelecimentoTrabalhador = h; + } + private StaticText stTecnicoNomeEdit = new StaticText(); + + public StaticText getStTecnicoNomeEdit() + { + return stTecnicoNomeEdit; + } + + public void setStTecnicoNomeEdit( StaticText st ) + { + this.stTecnicoNomeEdit = st; + } + private HtmlPanelGrid gridDadosAcidenteSegView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteSegView() + { + return gridDadosAcidenteSegView; + } + + public void setGridDadosAcidenteSegView( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteSegView = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private StaticText staticText95 = new StaticText(); + + public StaticText getStaticText95() + { + return staticText95; + } + + public void setStaticText95( StaticText st ) + { + this.staticText95 = st; + } + private HtmlPanelGrid gridPanel117 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel117() + { + return gridPanel117; + } + + public void setGridPanel117( HtmlPanelGrid hpg ) + { + this.gridPanel117 = hpg; + } + private HtmlPanelGrid gridTurnoSeccaoLocal = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTurnoSeccaoLocal() + { + return gridTurnoSeccaoLocal; + } + + public void setGridTurnoSeccaoLocal( HtmlPanelGrid hpg ) + { + this.gridTurnoSeccaoLocal = hpg; + } + private StaticText lblHorasTurno = new StaticText(); + + public StaticText getLblHorasTurno() + { + return lblHorasTurno; + } + + public void setLblHorasTurno( StaticText st ) + { + this.lblHorasTurno = st; + } + private StaticText txtHorasTurno2 = new StaticText(); + + public StaticText getTxtHorasTurno2() + { + return txtHorasTurno2; + } + + public void setTxtHorasTurno2( StaticText st ) + { + this.txtHorasTurno2 = st; + } + private StaticText lblSeccao = new StaticText(); + + public StaticText getLblSeccao() + { + return lblSeccao; + } + + public void setLblSeccao( StaticText st ) + { + this.lblSeccao = st; + } + private StaticText txtSeccao1 = new StaticText(); + + public StaticText getTxtSeccao1() + { + return txtSeccao1; + } + + public void setTxtSeccao1( StaticText st ) + { + this.txtSeccao1 = st; + } + private StaticText lblLocal = new StaticText(); + + public StaticText getLblLocal() + { + return lblLocal; + } + + public void setLblLocal( StaticText st ) + { + this.lblLocal = st; + } + private StaticText txtLocal1 = new StaticText(); + + public StaticText getTxtLocal1() + { + return txtLocal1; + } + + public void setTxtLocal1( StaticText st ) + { + this.txtLocal1 = st; + } + private HtmlPanelGrid gridTarefa = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTarefa() + { + return gridTarefa; + } + + public void setGridTarefa( HtmlPanelGrid hpg ) + { + this.gridTarefa = hpg; + } + private StaticText lblTarefa = new StaticText(); + + public StaticText getLblTarefa() + { + return lblTarefa; + } + + public void setLblTarefa( StaticText st ) + { + this.lblTarefa = st; + } + private StaticText txtTarefa1 = new StaticText(); + + public StaticText getTxtTarefa1() + { + return txtTarefa1; + } + + public void setTxtTarefa1( StaticText st ) + { + this.txtTarefa1 = st; + } + private HtmlPanelGrid gridSubstancias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSubstancias() + { + return gridSubstancias; + } + + public void setGridSubstancias( HtmlPanelGrid hpg ) + { + this.gridSubstancias = hpg; + } + private StaticText lblSubstancias = new StaticText(); + + public StaticText getLblSubstancias() + { + return lblSubstancias; + } + + public void setLblSubstancias( StaticText st ) + { + this.lblSubstancias = st; + } + private StaticText txtSubstancias1 = new StaticText(); + + public StaticText getTxtSubstancias1() + { + return txtSubstancias1; + } + + public void setTxtSubstancias1( StaticText st ) + { + this.txtSubstancias1 = st; + } + private HtmlPanelGrid gridCondicoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCondicoes() + { + return gridCondicoes; + } + + public void setGridCondicoes( HtmlPanelGrid hpg ) + { + this.gridCondicoes = hpg; + } + private StaticText lblCondicoes = new StaticText(); + + public StaticText getLblCondicoes() + { + return lblCondicoes; + } + + public void setLblCondicoes( StaticText st ) + { + this.lblCondicoes = st; + } + private StaticText txtCondicoes1 = new StaticText(); + + public StaticText getTxtCondicoes1() + { + return txtCondicoes1; + } + + public void setTxtCondicoes1( StaticText st ) + { + this.txtCondicoes1 = st; + } + private HtmlPanelGrid gridTestemunhas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTestemunhas() + { + return gridTestemunhas; + } + + public void setGridTestemunhas( HtmlPanelGrid hpg ) + { + this.gridTestemunhas = hpg; + } + private StaticText lblTestemunhas = new StaticText(); + + public StaticText getLblTestemunhas() + { + return lblTestemunhas; + } + + public void setLblTestemunhas( StaticText st ) + { + this.lblTestemunhas = st; + } + private StaticText txtTestemunhas1 = new StaticText(); + + public StaticText getTxtTestemunhas1() + { + return txtTestemunhas1; + } + + public void setTxtTestemunhas1( StaticText st ) + { + this.txtTestemunhas1 = st; + } + private HtmlPanelGrid gridCausas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCausas() + { + return gridCausas; + } + + public void setGridCausas( HtmlPanelGrid hpg ) + { + this.gridCausas = hpg; + } + private StaticText lblCausas = new StaticText(); + + public StaticText getLblCausas() + { + return lblCausas; + } + + public void setLblCausas( StaticText st ) + { + this.lblCausas = st; + } + private StaticText txtCausas1 = new StaticText(); + + public StaticText getTxtCausas1() + { + return txtCausas1; + } + + public void setTxtCausas1( StaticText st ) + { + this.txtCausas1 = st; + } + private HtmlPanelGrid gridDescricao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDescricao() + { + return gridDescricao; + } + + public void setGridDescricao( HtmlPanelGrid hpg ) + { + this.gridDescricao = hpg; + } + private StaticText lblDescricao = new StaticText(); + + public StaticText getLblDescricao() + { + return lblDescricao; + } + + public void setLblDescricao( StaticText st ) + { + this.lblDescricao = st; + } + private StaticText txtDescricao1 = new StaticText(); + + public StaticText getTxtDescricao1() + { + return txtDescricao1; + } + + public void setTxtDescricao1( StaticText st ) + { + this.txtDescricao1 = st; + } + private HtmlPanelGrid gridFotografias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridFotografias() + { + return gridFotografias; + } + + public void setGridFotografias( HtmlPanelGrid hpg ) + { + this.gridFotografias = hpg; + } + private HtmlPanelGrid gridPanel127 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel127() + { + return gridPanel127; + } + + public void setGridPanel127( HtmlPanelGrid hpg ) + { + this.gridPanel127 = hpg; + } + private StaticText lblFotografias = new StaticText(); + + public StaticText getLblFotografias() + { + return lblFotografias; + } + + public void setLblFotografias( StaticText st ) + { + this.lblFotografias = st; + } + private HtmlPanelGrid gridImages1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages1() + { + return gridImages1; + } + + public void setGridImages1( HtmlPanelGrid hpg ) + { + this.gridImages1 = hpg; + } + private HtmlPanelGrid gridConclusoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConclusoes() + { + return gridConclusoes; + } + + public void setGridConclusoes( HtmlPanelGrid hpg ) + { + this.gridConclusoes = hpg; + } + private StaticText lblConclusoes = new StaticText(); + + public StaticText getLblConclusoes() + { + return lblConclusoes; + } + + public void setLblConclusoes( StaticText st ) + { + this.lblConclusoes = st; + } + private StaticText txtConclusoes1 = new StaticText(); + + public StaticText getTxtConclusoes1() + { + return txtConclusoes1; + } + + public void setTxtConclusoes1( StaticText st ) + { + this.txtConclusoes1 = st; + } + private HtmlPanelGrid gridAccoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAccoes() + { + return gridAccoes; + } + + public void setGridAccoes( HtmlPanelGrid hpg ) + { + this.gridAccoes = hpg; + } + private StaticText lblAccoes = new StaticText(); + + public StaticText getLblAccoes() + { + return lblAccoes; + } + + public void setLblAccoes( StaticText st ) + { + this.lblAccoes = st; + } + private StaticText txtAccoes1 = new StaticText(); + + public StaticText getTxtAccoes1() + { + return txtAccoes1; + } + + public void setTxtAccoes1( StaticText st ) + { + this.txtAccoes1 = st; + } + private HtmlPanelGrid gridDataHora = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDataHora() + { + return gridDataHora; + } + + public void setGridDataHora( HtmlPanelGrid hpg ) + { + this.gridDataHora = hpg; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText lblDataAcidente = new StaticText(); + + public StaticText getLblDataAcidente() + { + return lblDataAcidente; + } + + public void setLblDataAcidente( StaticText st ) + { + this.lblDataAcidente = st; + } + private StaticText stDataAcidente1 = new StaticText(); + + public StaticText getStDataAcidente1() + { + return stDataAcidente1; + } + + public void setStDataAcidente1( StaticText st ) + { + this.stDataAcidente1 = st; + } + private PanelGroup groupPanel60 = new PanelGroup(); + + public PanelGroup getGroupPanel60() + { + return groupPanel60; + } + + public void setGroupPanel60( PanelGroup pg ) + { + this.groupPanel60 = pg; + } + private StaticText lblHoraAcidente = new StaticText(); + + public StaticText getLblHoraAcidente() + { + return lblHoraAcidente; + } + + public void setLblHoraAcidente( StaticText st ) + { + this.lblHoraAcidente = st; + } + private StaticText stHoraAcidente1 = new StaticText(); + + public StaticText getStHoraAcidente1() + { + return stHoraAcidente1; + } + + public void setStHoraAcidente1( StaticText st ) + { + this.stHoraAcidente1 = st; + } + private HtmlPanelGrid gridVerificacao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridVerificacao() + { + return gridVerificacao; + } + + public void setGridVerificacao( HtmlPanelGrid hpg ) + { + this.gridVerificacao = hpg; + } + private HtmlPanelGrid gridPanel131 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel131() + { + return gridPanel131; + } + + public void setGridPanel131( HtmlPanelGrid hpg ) + { + this.gridPanel131 = hpg; + } + private StaticText staticText52 = new StaticText(); + + public StaticText getStaticText52() + { + return staticText52; + } + + public void setStaticText52( StaticText st ) + { + this.staticText52 = st; + } + private HtmlPanelGrid gridPanel132 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel132() + { + return gridPanel132; + } + + public void setGridPanel132( HtmlPanelGrid hpg ) + { + this.gridPanel132 = hpg; + } + private HtmlPanelGrid gridPanel133 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel133() + { + return gridPanel133; + } + + public void setGridPanel133( HtmlPanelGrid hpg ) + { + this.gridPanel133 = hpg; + } + private PanelGroup grpVerHs = new PanelGroup(); + + public PanelGroup getGrpVerHs() + { + return grpVerHs; + } + + public void setGrpVerHs( PanelGroup pg ) + { + this.grpVerHs = pg; + } + private Checkbox chkVerHs = new Checkbox(); + + public Checkbox getChkVerHs() + { + return chkVerHs; + } + + public void setChkVerHs( Checkbox c ) + { + this.chkVerHs = c; + } + private StaticText stVerHs = new StaticText(); + + public StaticText getStVerHs() + { + return stVerHs; + } + + public void setStVerHs( StaticText st ) + { + this.stVerHs = st; + } + private PanelGroup grpVerRespSeg = new PanelGroup(); + + public PanelGroup getGrpVerRespSeg() + { + return grpVerRespSeg; + } + + public void setGrpVerRespSeg( PanelGroup pg ) + { + this.grpVerRespSeg = pg; + } + private Checkbox chkVerRespSeg = new Checkbox(); + + public Checkbox getChkVerRespSeg() + { + return chkVerRespSeg; + } + + public void setChkVerRespSeg( Checkbox c ) + { + this.chkVerRespSeg = c; + } + private StaticText stVerRespSeg = new StaticText(); + + public StaticText getStVerRespSeg() + { + return stVerRespSeg; + } + + public void setStVerRespSeg( StaticText st ) + { + this.stVerRespSeg = st; + } + private PanelGroup grpVerRespRh = new PanelGroup(); + + public PanelGroup getGrpVerRespRh() + { + return grpVerRespRh; + } + + public void setGrpVerRespRh( PanelGroup pg ) + { + this.grpVerRespRh = pg; + } + private Checkbox chkVerRespRh = new Checkbox(); + + public Checkbox getChkVerRespRh() + { + return chkVerRespRh; + } + + public void setChkVerRespRh( Checkbox c ) + { + this.chkVerRespRh = c; + } + private StaticText stVerRespRh = new StaticText(); + + public StaticText getStVerRespRh() + { + return stVerRespRh; + } + + public void setStVerRespRh( StaticText st ) + { + this.stVerRespRh = st; + } + private HtmlPanelGrid gridVerificacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridVerificacaoView() + { + return gridVerificacaoView; + } + + public void setGridVerificacaoView( HtmlPanelGrid hpg ) + { + this.gridVerificacaoView = hpg; + } + private HtmlPanelGrid gridPanel134 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel134() + { + return gridPanel134; + } + + public void setGridPanel134( HtmlPanelGrid hpg ) + { + this.gridPanel134 = hpg; + } + private StaticText staticText187 = new StaticText(); + + public StaticText getStaticText187() + { + return staticText187; + } + + public void setStaticText187( StaticText st ) + { + this.staticText187 = st; + } + private HtmlPanelGrid gridPanel135 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel135() + { + return gridPanel135; + } + + public void setGridPanel135( HtmlPanelGrid hpg ) + { + this.gridPanel135 = hpg; + } + private HtmlPanelGrid gridAssinaturasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssinaturasView() + { + return gridAssinaturasView; + } + + public void setGridAssinaturasView( HtmlPanelGrid hpg ) + { + this.gridAssinaturasView = hpg; + } + + private HtmlPanelGrid gridParticipacao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridParticipacao() + { + return gridParticipacao; + } + + public void setGridParticipacao( HtmlPanelGrid hpg ) + { + this.gridParticipacao = hpg; + } + + private PanelGroup grpParticipacao = new PanelGroup(); + + public PanelGroup getGrpParticipacao() + { + return grpParticipacao; + } + + public void setGrpParticipacao( PanelGroup pg ) + { + this.grpParticipacao = pg; + } + private Checkbox chkParticipacao = new Checkbox(); + + public Checkbox getChkParticipacao() + { + return chkParticipacao; + } + + public void setChkParticipacao( Checkbox c ) + { + this.chkParticipacao = c; + } + + private DropDown drpCausas = new DropDown(); + + public DropDown getDrpCausas() + { + return drpCausas; + } + + public void setDrpCausas( DropDown dd ) + { + this.drpCausas = dd; + } + private StaticText stObservacoesCorr = new StaticText(); + + public StaticText getStObservacoesCorr() + { + return stObservacoesCorr; + } + + public void setStObservacoesCorr( StaticText st ) + { + this.stObservacoesCorr = st; + } + private HtmlPanelGrid gridImpressao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImpressao() + { + return gridImpressao; + } + + public void setGridImpressao( HtmlPanelGrid hpg ) + { + this.gridImpressao = hpg; + } + private HtmlPanelGrid gridPanel89 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel89() + { + return gridPanel89; + } + + public void setGridPanel89( HtmlPanelGrid hpg ) + { + this.gridPanel89 = hpg; + } + private StaticText staticText73 = new StaticText(); + + public StaticText getStaticText73() + { + return staticText73; + } + + public void setStaticText73( StaticText st ) + { + this.staticText73 = st; + } + private HtmlPanelGrid gridPanel91 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel91() + { + return gridPanel91; + } + + public void setGridPanel91( HtmlPanelGrid hpg ) + { + this.gridPanel91 = hpg; + } + private HtmlPanelGrid gridPanel92 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel92() + { + return gridPanel92; + } + + public void setGridPanel92( HtmlPanelGrid hpg ) + { + this.gridPanel92 = hpg; + } + private PanelGroup grpAssSup = new PanelGroup(); + + public PanelGroup getGrpAssSup() + { + return grpAssSup; + } + + public void setGrpAssSup( PanelGroup pg ) + { + this.grpAssSup = pg; + } + private Checkbox chkAssSup = new Checkbox(); + + public Checkbox getChkAssSup() + { + return chkAssSup; + } + + public void setChkAssSup( Checkbox c ) + { + this.chkAssSup = c; + } + private StaticText stAssSup1 = new StaticText(); + + public StaticText getStAssSup1() + { + return stAssSup1; + } + + public void setStAssSup1( StaticText st ) + { + this.stAssSup1 = st; + } + private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImpressaoView() + { + return gridImpressaoView; + } + + public void setGridImpressaoView( HtmlPanelGrid hpg ) + { + this.gridImpressaoView = hpg; + } + private HtmlPanelGrid gridPanel93 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel93() + { + return gridPanel93; + } + + public void setGridPanel93( HtmlPanelGrid hpg ) + { + this.gridPanel93 = hpg; + } + private StaticText staticText76 = new StaticText(); + + public StaticText getStaticText76() + { + return staticText76; + } + + public void setStaticText76( StaticText st ) + { + this.staticText76 = st; + } + private HtmlPanelGrid gridPanel94 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel94() + { + return gridPanel94; + } + + public void setGridPanel94( HtmlPanelGrid hpg ) + { + this.gridPanel94 = hpg; + } + private HtmlPanelGrid gridAssSupView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssSupView() + { + return gridAssSupView; + } + + public void setGridAssSupView( HtmlPanelGrid hpg ) + { + this.gridAssSupView = hpg; + } + private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel22() + { + return gridPanel22; + } + + public void setGridPanel22( HtmlPanelGrid hpg ) + { + this.gridPanel22 = hpg; + } + private Button butCancelar = new Button(); + + public Button getButCancelar() + { + return butCancelar; + } + + public void setButCancelar( Button b ) + { + this.butCancelar = b; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private Button butImprimir = new Button(); + + public Button getButImprimir() + { + return butImprimir; + } + + public void setButImprimir( Button b ) + { + this.butImprimir = b; + } + private Button butGravar = new Button(); + + public Button getButGravar() + { + return butGravar; + } + + public void setButGravar( Button b ) + { + this.butGravar = b; + } + private Button butCorrecao = new Button(); + + public Button getButCorrecao() + { + return butCorrecao; + } + + public void setButCorrecao( Button b ) + { + this.butCorrecao = b; + } + private Button butEnviar = new Button(); + + public Button getButEnviar() + { + return butEnviar; + } + + public void setButEnviar( Button b ) + { + this.butEnviar = b; + } + private TextField txtAssSup = new TextField(); + + public TextField getTxtAssSup() + { + return txtAssSup; + } + + public void setTxtAssSup( TextField tf ) + { + this.txtAssSup = tf; + } + private StaticText stAssSup2 = new StaticText(); + + public StaticText getStAssSup2() + { + return stAssSup2; + } + + public void setStAssSup2( StaticText st ) + { + this.stAssSup2 = st; + } + private HtmlPanelGrid gridPanel95 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel95() + { + return gridPanel95; + } + + public void setGridPanel95( HtmlPanelGrid hpg ) + { + this.gridPanel95 = hpg; + } + private PanelGroup groupPanel50 = new PanelGroup(); + + public PanelGroup getGroupPanel50() + { + return groupPanel50; + } + + public void setGroupPanel50( PanelGroup pg ) + { + this.groupPanel50 = pg; + } + private StaticText staticText98 = new StaticText(); + + public StaticText getStaticText98() + { + return staticText98; + } + + public void setStaticText98( StaticText st ) + { + this.staticText98 = st; + } + private TextField txtAveriguador = new TextField(); + + public TextField getTxtAveriguador() + { + return txtAveriguador; + } + + public void setTxtAveriguador( TextField tf ) + { + this.txtAveriguador = tf; + } + private HtmlPanelGrid gridPanel96 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel96() + { + return gridPanel96; + } + + public void setGridPanel96( HtmlPanelGrid hpg ) + { + this.gridPanel96 = hpg; + } + private PanelGroup groupPanel51 = new PanelGroup(); + + public PanelGroup getGroupPanel51() + { + return groupPanel51; + } + + public void setGroupPanel51( PanelGroup pg ) + { + this.groupPanel51 = pg; + } + private StaticText staticText101 = new StaticText(); + + public StaticText getStaticText101() + { + return staticText101; + } + + public void setStaticText101( StaticText st ) + { + this.staticText101 = st; + } + private StaticText stAveriguador = new StaticText(); + + public StaticText getStAveriguador() + { + return stAveriguador; + } + + public void setStAveriguador( StaticText st ) + { + this.stAveriguador = st; + } + private HtmlPanelGrid gridPanel97 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel97() + { + return gridPanel97; + } + + public void setGridPanel97( HtmlPanelGrid hpg ) + { + this.gridPanel97 = hpg; + } + private PanelGroup groupPanel52 = new PanelGroup(); + + public PanelGroup getGroupPanel52() + { + return groupPanel52; + } + + public void setGroupPanel52( PanelGroup pg ) + { + this.groupPanel52 = pg; + } + private Checkbox chkAveriguacaoPosterior = new Checkbox(); + + public Checkbox getChkAveriguacaoPosterior() + { + return chkAveriguacaoPosterior; + } + + public void setChkAveriguacaoPosterior( Checkbox c ) + { + this.chkAveriguacaoPosterior = c; + } + private StaticText staticText132 = new StaticText(); + + public StaticText getStaticText132() + { + return staticText132; + } + + public void setStaticText132( StaticText st ) + { + this.staticText132 = st; + } + private HtmlPanelGrid gridPanel98 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel98() + { + return gridPanel98; + } + + public void setGridPanel98( HtmlPanelGrid hpg ) + { + this.gridPanel98 = hpg; + } + private StaticText staticText104 = new StaticText(); + + public StaticText getStaticText104() + { + return staticText104; + } + + public void setStaticText104( StaticText st ) + { + this.staticText104 = st; + } + private HtmlPanelGrid gridPanel99 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel99() + { + return gridPanel99; + } + + public void setGridPanel99( HtmlPanelGrid hpg ) + { + this.gridPanel99 = hpg; + } + private StaticText staticText131 = new StaticText(); + + public StaticText getStaticText131() + { + return staticText131; + } + + public void setStaticText131( StaticText st ) + { + this.staticText131 = st; + } + private TextArea txtAveriguacaoObs = new TextArea(); + + public TextArea getTxtAveriguacaoObs() + { + return txtAveriguacaoObs; + } + + public void setTxtAveriguacaoObs( TextArea ta ) + { + this.txtAveriguacaoObs = ta; + } + private HtmlPanelGrid gridAveriguacaoPosterior = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAveriguacaoPosterior() + { + return gridAveriguacaoPosterior; + } + + public void setGridAveriguacaoPosterior( HtmlPanelGrid hpg ) + { + this.gridAveriguacaoPosterior = hpg; + } + private StaticText lblAveriguacaoPosterior = new StaticText(); + + public StaticText getLblAveriguacaoPosterior() + { + return lblAveriguacaoPosterior; + } + + public void setLblAveriguacaoPosterior( StaticText st ) + { + this.lblAveriguacaoPosterior = st; + } + private StaticText txtAveriguacaoPosterior = new StaticText(); + + public StaticText getTxtAveriguacaoPosterior() + { + return txtAveriguacaoPosterior; + } + + public void setTxtAveriguacaoPosterior( StaticText st ) + { + this.txtAveriguacaoPosterior = st; + } + private HtmlPanelGrid gridAveriguacaoPosterior1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAveriguacaoPosterior1() + { + return gridAveriguacaoPosterior1; + } + + public void setGridAveriguacaoPosterior1( HtmlPanelGrid hpg ) + { + this.gridAveriguacaoPosterior1 = hpg; + } + private HtmlPanelGrid gridPanel101 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel101() + { + return gridPanel101; + } + + public void setGridPanel101( HtmlPanelGrid hpg ) + { + this.gridPanel101 = hpg; + } + private StaticText staticText134 = new StaticText(); + + public StaticText getStaticText134() + { + return staticText134; + } + + public void setStaticText134( StaticText st ) + { + this.staticText134 = st; + } + private HtmlPanelGrid gridPanel102 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel102() + { + return gridPanel102; + } + + public void setGridPanel102( HtmlPanelGrid hpg ) + { + this.gridPanel102 = hpg; + } + private StaticText staticText135 = new StaticText(); + + public StaticText getStaticText135() + { + return staticText135; + } + + public void setStaticText135( StaticText st ) + { + this.staticText135 = st; + } + private TextArea txtAveriguacaoObs1 = new TextArea(); + + public TextArea getTxtAveriguacaoObs1() + { + return txtAveriguacaoObs1; + } + + public void setTxtAveriguacaoObs1( TextArea ta ) + { + this.txtAveriguacaoObs1 = ta; + } + private StaticText staticText130 = new StaticText(); + + public StaticText getStaticText130() + { + return staticText130; + } + + public void setStaticText130( StaticText st ) + { + this.staticText130 = st; + } + private StaticText stEstabelecimentoOrigem = new StaticText(); + + public StaticText getStEstabelecimentoOrigem() + { + return stEstabelecimentoOrigem; + } + + public void setStEstabelecimentoOrigem( StaticText st ) + { + this.stEstabelecimentoOrigem = st; + } + private HtmlPanelGrid gridPanel100 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel100() + { + return gridPanel100; + } + + public void setGridPanel100( HtmlPanelGrid hpg ) + { + this.gridPanel100 = hpg; + } + private StaticText staticText156 = new StaticText(); + + public StaticText getStaticText156() + { + return staticText156; + } + + public void setStaticText156( StaticText st ) + { + this.staticText156 = st; + } + private HtmlPanelGrid gridPanel103 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel103() + { + return gridPanel103; + } + + public void setGridPanel103( HtmlPanelGrid hpg ) + { + this.gridPanel103 = hpg; + } + private PanelGroup groupPanel53 = new PanelGroup(); + + public PanelGroup getGroupPanel53() + { + return groupPanel53; + } + + public void setGroupPanel53( PanelGroup pg ) + { + this.groupPanel53 = pg; + } + private StaticText staticText157 = new StaticText(); + + public StaticText getStaticText157() + { + return staticText157; + } + + public void setStaticText157( StaticText st ) + { + this.staticText157 = st; + } + private TextField txtNomeSuperior = new TextField(); + + public TextField getTxtNomeSuperior() + { + return txtNomeSuperior; + } + + public void setTxtNomeSuperior( TextField tf ) + { + this.txtNomeSuperior = tf; + } + private PanelGroup groupPanel54 = new PanelGroup(); + + public PanelGroup getGroupPanel54() + { + return groupPanel54; + } + + public void setGroupPanel54( PanelGroup pg ) + { + this.groupPanel54 = pg; + } + private StaticText staticText158 = new StaticText(); + + public StaticText getStaticText158() + { + return staticText158; + } + + public void setStaticText158( StaticText st ) + { + this.staticText158 = st; + } + private TextField txtEmailSuperior = new TextField(); + + public TextField getTxtEmailSuperior() + { + return txtEmailSuperior; + } + + public void setTxtEmailSuperior( TextField tf ) + { + this.txtEmailSuperior = tf; + } + private HtmlPanelGrid gridPanel104 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel104() + { + return gridPanel104; + } + + public void setGridPanel104( HtmlPanelGrid hpg ) + { + this.gridPanel104 = hpg; + } + private StaticText staticText159 = new StaticText(); + + public StaticText getStaticText159() + { + return staticText159; + } + + public void setStaticText159( StaticText st ) + { + this.staticText159 = st; + } + private HtmlPanelGrid gridPanel105 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel105() + { + return gridPanel105; + } + + public void setGridPanel105( HtmlPanelGrid hpg ) + { + this.gridPanel105 = hpg; + } + private PanelGroup groupPanel55 = new PanelGroup(); + + public PanelGroup getGroupPanel55() + { + return groupPanel55; + } + + public void setGroupPanel55( PanelGroup pg ) + { + this.groupPanel55 = pg; + } + private StaticText staticText160 = new StaticText(); + + public StaticText getStaticText160() + { + return staticText160; + } + + public void setStaticText160( StaticText st ) + { + this.staticText160 = st; + } + private StaticText stNomeSuperior = new StaticText(); + + public StaticText getStNomeSuperior() + { + return stNomeSuperior; + } + + public void setStNomeSuperior( StaticText st ) + { + this.stNomeSuperior = st; + } + private PanelGroup groupPanel61 = new PanelGroup(); + + public PanelGroup getGroupPanel61() + { + return groupPanel61; + } + + public void setGroupPanel61( PanelGroup pg ) + { + this.groupPanel61 = pg; + } + private StaticText staticText162 = new StaticText(); + + public StaticText getStaticText162() + { + return staticText162; + } + + public void setStaticText162( StaticText st ) + { + this.staticText162 = st; + } + private StaticText stEmailSuperior = new StaticText(); + + public StaticText getStEmailSuperior() + { + return stEmailSuperior; + } + + public void setStEmailSuperior( StaticText st ) + { + this.stEmailSuperior = st; + } + private HiddenField hidDisableImprimir = new HiddenField(); + + public HiddenField getHidDisableImprimir() + { + return hidDisableImprimir; + } + + public void setHidDisableImprimir( HiddenField hf ) + { + this.hidDisableImprimir = hf; + } + private DropDown drpSeccao = new DropDown(); + + public DropDown getDrpSeccao() + { + return drpSeccao; + } + + public void setDrpSeccao( DropDown dd ) + { + this.drpSeccao = dd; + } + private StaticText staticText163 = new StaticText(); + + public StaticText getStaticText163() + { + return staticText163; + } + + public void setStaticText163( StaticText st ) + { + this.staticText163 = st; + } + private DropDown drpDepartamento = new DropDown(); + + public DropDown getDrpDepartamento() + { + return drpDepartamento; + } + + public void setDrpDepartamento( DropDown dd ) + { + this.drpDepartamento = dd; + } + private HiddenField hidAnchor = new HiddenField(); + + public HiddenField getHidAnchor() + { + return hidAnchor; + } + + public void setHidAnchor( HiddenField hf ) + { + this.hidAnchor = hf; + } + private PanelGroup groupPanel62 = new PanelGroup(); + + public PanelGroup getGroupPanel62() + { + return groupPanel62; + } + + public void setGroupPanel62( PanelGroup pg ) + { + this.groupPanel62 = pg; + } + private StaticText staticText164 = new StaticText(); + + public StaticText getStaticText164() + { + return staticText164; + } + + public void setStaticText164( StaticText st ) + { + this.staticText164 = st; + } + private StaticText staticText167 = new StaticText(); + + public StaticText getStaticText167() + { + return staticText167; + } + + public void setStaticText167( StaticText st ) + { + this.staticText167 = st; + } + private PanelGroup groupPanel63 = new PanelGroup(); + + public PanelGroup getGroupPanel63() + { + return groupPanel63; + } + + public void setGroupPanel63( PanelGroup pg ) + { + this.groupPanel63 = pg; + } + private StaticText staticText171 = new StaticText(); + + public StaticText getStaticText171() + { + return staticText171; + } + + public void setStaticText171( StaticText st ) + { + this.staticText171 = st; + } + private StaticText stTecnicoNome = new StaticText(); + + public StaticText getStTecnicoNome() + { + return stTecnicoNome; + } + + public void setStTecnicoNome( StaticText st ) + { + this.stTecnicoNome = st; + } + private StaticText staticText172 = new StaticText(); + + public StaticText getStaticText172() + { + return staticText172; + } + + public void setStaticText172( StaticText st ) + { + this.staticText172 = st; + } + private StaticText staticText173 = new StaticText(); + + public StaticText getStaticText173() + { + return staticText173; + } + + public void setStaticText173( StaticText st ) + { + this.staticText173 = st; + } + private StaticText txtCap1 = new StaticText(); + + public StaticText getTxtCap1() + { + return txtCap1; + } + + public void setTxtCap1( StaticText st ) + { + this.txtCap1 = st; + } + private PanelGroup groupPanel64 = new PanelGroup(); + + public PanelGroup getGroupPanel64() + { + return groupPanel64; + } + + public void setGroupPanel64( PanelGroup pg ) + { + this.groupPanel64 = pg; + } + private StaticText staticText174 = new StaticText(); + + public StaticText getStaticText174() + { + return staticText174; + } + + public void setStaticText174( StaticText st ) + { + this.staticText174 = st; + } + private StaticText stMedicoNome = new StaticText(); + + public StaticText getStMedicoNome() + { + return stMedicoNome; + } + + public void setStMedicoNome( StaticText st ) + { + this.stMedicoNome = st; + } + private StaticText staticText175 = new StaticText(); + + public StaticText getStaticText175() + { + return staticText175; + } + + public void setStaticText175( StaticText st ) + { + this.staticText175 = st; + } + private StaticText staticText176 = new StaticText(); + + public StaticText getStaticText176() + { + return staticText176; + } + + public void setStaticText176( StaticText st ) + { + this.staticText176 = st; + } + private StaticText txtCedula1 = new StaticText(); + + public StaticText getTxtCedula1() + { + return txtCedula1; + } + + public void setTxtCedula1( StaticText st ) + { + this.txtCedula1 = st; + } + private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel14() + { + return gridPanel14; + } + + public void setGridPanel14( HtmlPanelGrid hpg ) + { + this.gridPanel14 = hpg; + } + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() + { + return staticText15; + } + + public void setStaticText15( StaticText st ) + { + this.staticText15 = st; + } + + +// private org.apache.myfaces.custom.date.HtmlInputDate calDataOcorrencia = new org.apache.myfaces.custom.date.HtmlInputDate(); +// public org.apache.myfaces.custom.date.HtmlInputDate getCalDataOcorrencia() +// { +// return calDataOcorrencia; +// } +// public void setCalDataOcorrencia( org.apache.myfaces.custom.date.HtmlInputDate calDataOcorrencia ) +// { +// this.calDataOcorrencia = calDataOcorrencia; +// } + + private Date calDataOcorrencia = null; + public Date getCalDataOcorrencia() + { + return calDataOcorrencia; + } + public void setCalDataOcorrencia( Date calDataOcorrencia ) + { + this.calDataOcorrencia = calDataOcorrencia; + } + + + + + private PanelGroup groupPanel9 = new PanelGroup(); + + public PanelGroup getGroupPanel9() + { + return groupPanel9; + } + + public void setGroupPanel9( PanelGroup pg ) + { + this.groupPanel9 = pg; + } + private StaticText staticText71 = new StaticText(); + + public StaticText getStaticText71() + { + return staticText71; + } + + public void setStaticText71( StaticText st ) + { + this.staticText71 = st; + } + private DropDown drpHours = new DropDown(); + + public DropDown getDrpHours() + { + return drpHours; + } + + public void setDrpHours( DropDown dd ) + { + this.drpHours = dd; + } + private StaticText staticText72 = new StaticText(); + + public StaticText getStaticText72() + { + return staticText72; + } + + public void setStaticText72( StaticText st ) + { + this.staticText72 = st; + } + private DropDown drpMinutes = new DropDown(); + + public DropDown getDrpMinutes() + { + return drpMinutes; + } + + public void setDrpMinutes( DropDown dd ) + { + this.drpMinutes = dd; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() + { + return staticText14; + } + + public void setStaticText14( StaticText st ) + { + this.staticText14 = st; + } + private StaticText stNomeAcidentado = new StaticText(); + + public StaticText getStNomeAcidentado() + { + return stNomeAcidentado; + } + + public void setStNomeAcidentado( StaticText st ) + { + this.stNomeAcidentado = st; + } + private PanelGroup groupPanel15 = new PanelGroup(); + + public PanelGroup getGroupPanel15() + { + return groupPanel15; + } + + public void setGroupPanel15( PanelGroup pg ) + { + this.groupPanel15 = pg; + } + private StaticText staticText70 = new StaticText(); + + public StaticText getStaticText70() + { + return staticText70; + } + + public void setStaticText70( StaticText st ) + { + this.staticText70 = st; + } + private StaticText stEstabelecimentoOrigem1 = new StaticText(); + + public StaticText getStEstabelecimentoOrigem1() + { + return stEstabelecimentoOrigem1; + } + + public void setStEstabelecimentoOrigem1( StaticText st ) + { + this.stEstabelecimentoOrigem1 = st; + } + private PanelGroup groupPanel16 = new PanelGroup(); + + public PanelGroup getGroupPanel16() + { + return groupPanel16; + } + + public void setGroupPanel16( PanelGroup pg ) + { + this.groupPanel16 = pg; + } + private StaticText staticText74 = new StaticText(); + + public StaticText getStaticText74() + { + return staticText74; + } + + public void setStaticText74( StaticText st ) + { + this.staticText74 = st; + } + private StaticText stDataNascimento = new StaticText(); + + public StaticText getStDataNascimento() + { + return stDataNascimento; + } + + public void setStDataNascimento( StaticText st ) + { + this.stDataNascimento = st; + } + private PanelGroup groupPanel65 = new PanelGroup(); + + public PanelGroup getGroupPanel65() + { + return groupPanel65; + } + + public void setGroupPanel65( PanelGroup pg ) + { + this.groupPanel65 = pg; + } + private StaticText staticText75 = new StaticText(); + + public StaticText getStaticText75() + { + return staticText75; + } + + public void setStaticText75( StaticText st ) + { + this.staticText75 = st; + } + private StaticText stBI = new StaticText(); + + public StaticText getStBI() + { + return stBI; + } + + public void setStBI( StaticText st ) + { + this.stBI = st; + } + private PanelGroup groupPanel66 = new PanelGroup(); + + public PanelGroup getGroupPanel66() + { + return groupPanel66; + } + + public void setGroupPanel66( PanelGroup pg ) + { + this.groupPanel66 = pg; + } + private StaticText staticText77 = new StaticText(); + + public StaticText getStaticText77() + { + return staticText77; + } + + public void setStaticText77( StaticText st ) + { + this.staticText77 = st; + } + private StaticText stMorada = new StaticText(); + + public StaticText getStMorada() + { + return stMorada; + } + + public void setStMorada( StaticText st ) + { + this.stMorada = st; + } + private StaticText staticText79 = new StaticText(); + + public StaticText getStaticText79() + { + return staticText79; + } + + public void setStaticText79( StaticText st ) + { + this.staticText79 = st; + } + private StaticText stCodPostal = new StaticText(); + + public StaticText getStCodPostal() + { + return stCodPostal; + } + + public void setStCodPostal( StaticText st ) + { + this.stCodPostal = st; + } + private PanelGroup groupPanel67 = new PanelGroup(); + + public PanelGroup getGroupPanel67() + { + return groupPanel67; + } + + public void setGroupPanel67( PanelGroup pg ) + { + this.groupPanel67 = pg; + } + private StaticText staticText80 = new StaticText(); + + public StaticText getStaticText80() + { + return staticText80; + } + + public void setStaticText80( StaticText st ) + { + this.staticText80 = st; + } + private StaticText stContactoTelefonico = new StaticText(); + + public StaticText getStContactoTelefonico() + { + return stContactoTelefonico; + } + + public void setStContactoTelefonico( StaticText st ) + { + this.stContactoTelefonico = st; + } + private PanelGroup groupPanel68 = new PanelGroup(); + + public PanelGroup getGroupPanel68() + { + return groupPanel68; + } + + public void setGroupPanel68( PanelGroup pg ) + { + this.groupPanel68 = pg; + } + private StaticText staticText81 = new StaticText(); + + public StaticText getStaticText81() + { + return staticText81; + } + + public void setStaticText81( StaticText st ) + { + this.staticText81 = st; + } + private StaticText stDataAdmissao1 = new StaticText(); + + public StaticText getStDataAdmissao1() + { + return stDataAdmissao1; + } + + public void setStDataAdmissao1( StaticText st ) + { + this.stDataAdmissao1 = st; + } + private PanelGroup groupPanel69 = new PanelGroup(); + + public PanelGroup getGroupPanel69() + { + return groupPanel69; + } + + public void setGroupPanel69( PanelGroup pg ) + { + this.groupPanel69 = pg; + } + private StaticText staticText82 = new StaticText(); + + public StaticText getStaticText82() + { + return staticText82; + } + + public void setStaticText82( StaticText st ) + { + this.staticText82 = st; + } + private StaticText stFuncao1 = new StaticText(); + + public StaticText getStFuncao1() + { + return stFuncao1; + } + + public void setStFuncao1( StaticText st ) + { + this.stFuncao1 = st; + } + private PanelGroup groupPanel70 = new PanelGroup(); + + public PanelGroup getGroupPanel70() + { + return groupPanel70; + } + + public void setGroupPanel70( PanelGroup pg ) + { + this.groupPanel70 = pg; + } + private StaticText staticText83 = new StaticText(); + + public StaticText getStaticText83() + { + return staticText83; + } + + public void setStaticText83( StaticText st ) + { + this.staticText83 = st; + } + private StaticText stTurno = new StaticText(); + + public StaticText getStTurno() + { + return stTurno; + } + + public void setStTurno( StaticText st ) + { + this.stTurno = st; + } + private PanelGroup groupPanel71 = new PanelGroup(); + + public PanelGroup getGroupPanel71() + { + return groupPanel71; + } + + public void setGroupPanel71( PanelGroup pg ) + { + this.groupPanel71 = pg; + } + private StaticText staticText84 = new StaticText(); + + public StaticText getStaticText84() + { + return staticText84; + } + + public void setStaticText84( StaticText st ) + { + this.staticText84 = st; + } + private StaticText staticText85 = new StaticText(); + + public StaticText getStaticText85() + { + return staticText85; + } + + public void setStaticText85( StaticText st ) + { + this.staticText85 = st; + } + private PanelGroup groupPanel72 = new PanelGroup(); + + public PanelGroup getGroupPanel72() + { + return groupPanel72; + } + + public void setGroupPanel72( PanelGroup pg ) + { + this.groupPanel72 = pg; + } + private StaticText staticText86 = new StaticText(); + + public StaticText getStaticText86() + { + return staticText86; + } + + public void setStaticText86( StaticText st ) + { + this.staticText86 = st; + } + private StaticText stMedico = new StaticText(); + + public StaticText getStMedico() + { + return stMedico; + } + + public void setStMedico( StaticText st ) + { + this.stMedico = st; + } + private StaticText staticText87 = new StaticText(); + + public StaticText getStaticText87() + { + return staticText87; + } + + public void setStaticText87( StaticText st ) + { + this.staticText87 = st; + } + private StaticText staticText92 = new StaticText(); + + public StaticText getStaticText92() + { + return staticText92; + } + + public void setStaticText92( StaticText st ) + { + this.staticText92 = st; + } + private StaticText txtCedula = new StaticText(); + + public StaticText getTxtCedula() + { + return txtCedula; + } + + public void setTxtCedula( StaticText st ) + { + this.txtCedula = st; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private TextField txtHorasTurno = new TextField(); + + public TextField getTxtHorasTurno() + { + return txtHorasTurno; + } + + public void setTxtHorasTurno( TextField tf ) + { + this.txtHorasTurno = tf; + } + private HiddenField hidConfEnviar = new HiddenField(); + + public HiddenField getHidConfEnviar() + { + return hidConfEnviar; + } + + public void setHidConfEnviar( HiddenField hf ) + { + this.hidConfEnviar = hf; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + + /** + *

Construct a new Page bean instance.

+ */ + public AnaliseAcidenteTrabalho() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "AnaliseAcidenteTrabalho Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + else + { + + initCalendars(); + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + if ( !pageFrom.matches( "AnaliseAcidenteTrabalho.jsp" ) ) + { + if ( pageFrom.matches( "LoadImage.jsp" ) ) + { + restorePageState(); + //if(getSessionBean1().getImageName() != null) + //{ + fillImages(); + //} + } + else + { + String tmpImageFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File tmpFolder = new File( tmpImageFolder ); + if ( tmpFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( tmpFolder ); + tmpFolder.delete(); + } + + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + getSessionBean1().setGravado( false ); + getSessionBean1().setSubmetido( false ); + getSessionBean1().setIeBug( false ); + //drpTecnicos.setSelected(new Integer(0)); + //drpMedicos.setSelected(new Integer(0)); + if ( getSessionBean1().getCurrentAnalise() == null ) // new analise + { + getSessionBean1().setAcidentado( null ); // Here ????? + lnkLblTrabalhador.setDisabled( true ); + lnkLblTrabalhador.setStyleClass( "" ); + initializePage(); + } + else // edit analise + { + lnkLblTrabalhador.setDisabled( false ); + lnkLblTrabalhador.setStyleClass( "labelTrabalhador" ); + gridTrabalhadores.setRendered( false ); + + fillPage(); + } + + } + } + + } + + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + public String lnkLogout_action() + { + getSessionBean1().setIeBug( true ); + Utils.doLogout( getExternalContext(), true ); + + return null; + } + + private void initializePage() + { + hidAnchor.setValue( "none" ); + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setText( "Enviar a RH" ); + gridSiprp.setRendered( false ); + //gridAcidentadoView.setRendered(false); + gridSiprpView.setRendered( false ); + gridAcidentadoView.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + tblTrabalhadores.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteSegView.setRendered( false ); + + butImprimir.setRendered( false ); + +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + String nome_empresa = adp.getEmpresaNome( getSessionBean1().getCurrentUser().getEmpresa_id() ); + txtEmpresa.setText( utils.Utils.unicodeToHTML( nome_empresa ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + txtEstabelecimento.setText( adp.getEstabelecimentoNome( getSessionBean1().getCurrentUser().getEstabelecimento_id() ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + + drpDepartamento.setSelected( new Integer( 0 ) ); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( null ) ); + drpSeccao.setSelected( new Integer( 0 ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + +// fillTrabalhadoresTable(); + +// Calendar c = Calendar.getInstance(); +// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); +// stDataAcidente.setText(dateFormat.format(c.getTime())); + txtAveriguador.setText( getSessionBean1().getCurrentUser().getNome() ); + java.util.Date today = new java.util.Date(); +// calDataOcorrencia.setValue( today ); + setCalDataOcorrencia( today ); + + //drpMedicos.setSelected(new Integer(0)); +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Medico m = udp.getMedico( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); + getSessionBean1().setMedico( m ); + if ( m != null ) + { + stMedico.setText( m.getNome() + "  " ); + txtCedula.setText( m.getNumero_cedula() ); + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + drpHours.setSelected( new Integer( -1 ) ); + drpMinutes.setSelected( new Integer( -1 ) ); + drpDepartamento.setSelected( new Integer( 0 ) ); + drpSeccao.setSelected( new Integer( 0 ) ); + drpCausas.setSelected( new Integer( 0 ) ); + } + +// private void fillTrabalhadoresTable() +// { +// AnalisesDataProvider adp = new AnalisesDataProvider(); +// try +// { +// //lblActivos.setRendered(true); +// table1.setRendered(true); +// +// ArrayList trabalhadoresList = adp.getTrabalhadoresListByEstabelecimento(getSessionBean1().getCurrentUser().getEstabelecimento_id()); +// getSessionBean1().getTrabalhadoresListDataProvider().setList(trabalhadoresList); +// } +// catch(Exception ex) +// { +// //lblActivos.setRendered(false); +// table1.setRendered(false); +// ErrorLogger.logException( ex ); +// } +// } + private String fillPage() + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + + //correcao + if ( a.getCorrecao().matches( "y" ) ) + { + stObservacoesCorr.setText( a.getObservacoes_correcao() ); + } + else + { + stObservacoesCorr.setRendered( false ); + } + + + stHeaderNr.setText( a.getAnalise_nr() ); + try + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); + stHeaderDate.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + String nome_empresa = adp.getEmpresaNome( a.getEmpresa_id() ); + txtEmpresa.setText( utils.Utils.unicodeToHTML( nome_empresa ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + txtEstabelecimento.setText( adp.getEstabelecimentoNome( a.getEstabelecimento_id() ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Acidentado ac = null; + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + //Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); + //txtDataNascimento.setText(t.getData_nascimento()); + ac = adp.getAcidentado( a.getAcidentado_id() ); + txtTrabalhador.setText( ac.getNome() ); + getSessionBean1().setAcidentado( ac ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + + int estado_documento = a.getEstado().intValue(); +// if(estado_documento != Global.ESTADO_IMPRESSAO) +//// if(estado_documento != Global.ESTADO_ASSINATURAS || (estado_documento == Global.ESTADO_ASSINATURAS && getSessionBean1().getCurrentUser().getTipo().intValue() != Global.TIPO_UTILIZADOR_RH)) +//// { +//// butImprimir.setRendered(false); +//// } +//// else +//// { +//// butGravar.setRendered(false); +//// } + butImprimir.setRendered( false ); + + if ( estado_documento > Global.ESTADO_SEG && getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_SEGURANCA && a.getAveriguacao_posterior().matches( "y" ) ) + { + boolean booAveriguacao = false; + if ( a.getAveriguacao_obs() == null ) + { + booAveriguacao = true; + } + else if ( a.getAveriguacao_obs().trim().length() == 0 ) + { + booAveriguacao = true; + } + if ( booAveriguacao ) + { + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setRendered( false ); + gridSiprp.setRendered( false ); + //gridSiprpView.setRendered(false); + gridAcidentado.setRendered( false ); //19/11/2007 + gridAcidentadoView.setRendered( false ); //19/11/2007 + gridDadosAcidenteSeg.setRendered( false ); //19/11/2007 + //gridDadosAcidenteSegView.setRendered(false); //19/11/2007 + gridDadosAcidenteRh.setRendered( false ); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + // fillSiprp(a); + // fillDadosAcidenteSegView(a); + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + + return null; + } + + } + + + switch ( estado_documento ) + { + case Global.ESTADO_SEG: + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + if ( a.getCorrecao().matches( "y" ) ) + { + butEnviar.setText( "Enviar a Recomendações SHST" ); + } + else + { + butEnviar.setText( "Enviar a Acompanhamento RH" ); + } + gridSiprpView.setRendered( false ); + gridAcidentado.setRendered( false ); //19/11/2007 + //gridAcidentadoView.setRendered(false); //19/11/2007 + gridDadosAcidenteSegView.setRendered( false ); //19/11/2007 + gridDadosAcidenteRh.setRendered( false ); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprp( a ); + fillAcidentadoView( ac ); + fillDadosAcidenteSeg( a ); + break; + case Global.ESTADO_RH1: + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setText( "Enviar a Recomendações SHST" ); + gridSiprpView.setRendered( false ); + gridAcidentadoView.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); //19/11/2007 + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridParticipacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + if ( ac != null ) + { + fillAcidentado( ac ); + } + fillSiprp( a ); + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRh( a ); + break; + case Global.ESTADO_HS: + butGravar.setText( "Gravar" ); + butEnviar.setText( "Enviar a Medidas RH" ); + //gridSiprpView.setRendered(false); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + //gridAcidentadoView.setRendered(false); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesHs( a ); + //gridDadosAcidenteRhView.setRendered(false); + //gridRecomendacoesHS.setRendered(false); + break; + case Global.ESTADO_RH2: + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + //butEnviar.setText("Enviar a Médico"); +// if(a.getCorrecao().matches("y")) +// { +// butEnviar.setText("Enviar a Consolidação"); +// } +// else +// { +// butEnviar.setText("Enviar a Medicina"); +// } + butEnviar.setText( "Enviar a Consolidação" ); + + //butEnviar.setText("Enviar a Medicina"); + //gridSiprpView.setRendered(false); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + //gridAcidentadoView.setRendered(false); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + //gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered( false ); + //gridMedico.setRendered(false); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + //gridParticipacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + //fillMedico(a); //19/11/2007 + fillMedidasRh( a ); + fillMedico( a ); //23/11/2007 + break; +// case Global.ESTADO_MEDICINA: +// butCorrecao.setRendered(false); +// butGravar.setText("Gravar"); +// butEnviar.setText("Enviar a Consolidação"); +// //gridSiprpView.setRendered(false); +// gridSiprp.setRendered(false); +// gridAcidentado.setRendered(false); +// //gridAcidentadoView.setRendered(false); +// gridDadosAcidenteSeg.setRendered(false); +// gridDadosAcidenteRh.setRendered(false); +// gridRecomendacoesHS.setRendered(false); +// //gridRecomendacoesViewHS.setRendered(false); +// gridMedidasRH.setRendered(false); +// //gridMedidasViewRH.setRendered(false); +// //gridMedico.setRendered(false); +// gridMedicoView.setRendered(false); +// gridVerificacao.setRendered(false); +// gridVerificacaoView.setRendered(false); +// gridImpressao.setRendered(false); +// gridImpressaoView.setRendered(false); +// +// fillSiprpView(a); +// if(ac != null) +// { +// fillAcidentadoView(ac); +// } +// fillDadosAcidenteSegView(a); +// fillDadosAcidenteRhView(a); +// fillRecomendacoesViewHs(a); +// fillMedidasViewRh(a); +// fillMedico(a); //23/11/2007 +// break; + case Global.ESTADO_CONSOLIDACAO: + //butGravar.setText("Gravar"); + butGravar.setRendered( false ); + butEnviar.setText( "Enviar a Verificação" ); + hidDisableEnviar.setValue( "n" ); +// boolean booAveriguacao = false; +// if(a.getAveriguacao_posterior().matches("y")) +// { +// if(a.getAveriguacao_obs() == null) +// { +// booAveriguacao = true; +// } +// else if(a.getAveriguacao_obs().trim().length() == 0) +// { +// booAveriguacao = true; +// } +// if(booAveriguacao) +// { +// hidDisableEnviar.setValue("y"); +// } +// +// } + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + //gridAcidentadoView.setRendered(false); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + //gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered( false ); + //gridMedidasViewRH.setRendered(false); + gridMedico.setRendered( false ); + //gridMedicoView.setRendered(false); + //gridVerificacao.setRendered(false); + java.util.Date ddate = new java.util.Date(); + stVerHs.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + grpVerRespSeg.setRendered( false ); + grpVerRespRh.setRendered( false ); + butGravar.setDisabled( true ); + butEnviar.setDisabled( true ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + fillMedidasViewRh( a ); + fillMedicoView( a ); //23/11/2007 + break; + case Global.ESTADO_ASSINATURA_SEG: + butImprimir.setRendered( false ); + butCorrecao.setRendered( false ); + butEnviar.setText( "Enviar a RH" ); + //butGravar.setText("Enviar"); + butGravar.setRendered( false ); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + //gridMedidasViewRH.setRendered(false); + gridMedico.setRendered( false ); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridParticipacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + grpVerRespSeg.setRendered( true ); + grpVerHs.setRendered( false ); + grpVerRespRh.setRendered( false ); + //chkVerRespRh.setDisabled(true); + ddate = new java.util.Date(); + stVerRespSeg.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillMedidasViewRh( a ); + fillMedicoView( a ); + fillVerificacaoView( a ); + fillVerificacao( a ); + + break; + case Global.ESTADO_ASSINATURA_RH: + butGravar.setRendered( false ); + //butGravar.setText("Imprimir"); + butCorrecao.setRendered( false ); + butImprimir.setRendered( false ); + butEnviar.setText( "Enviar a Conclusão" ); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedico.setRendered( false ); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + grpVerRespRh.setRendered( true ); + grpVerHs.setRendered( false ); + grpVerRespSeg.setRendered( false ); + //chkVerRespSeg.setDisabled(true); + ddate = new java.util.Date(); + stVerRespRh.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + gridParticipacao.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + fillMedidasViewRh( a ); + fillMedicoView( a ); + fillVerificacaoView( a ); + fillVerificacao( a ); + break; + + case Global.ESTADO_FECHAR: + butCorrecao.setRendered( false ); + butGravar.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setText( "Fechar" ); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedico.setRendered( false ); + gridVerificacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + fillMedidasViewRh( a ); + //fillMedico(a); + fillMedicoView( a ); + fillVerificacaoView( a ); + //fillImpressaoView(a); + break; + case Global.ESTADO_CONCLUIDO: + } + + chkParticipacao.setSelected( a.getParticipado() != null ? a.getParticipado() : Boolean.FALSE ); + return null; + } + + private void fillSiprp( AnaliseAcidente a ) + { + //drpTecnicos.setSelected(a.getTecnico_saude_id()); + //drpMedicos.setSelected(a.getMedico_id()); +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Utilizador u = udp.getUtilizador( a.getTecnico_saude_id() ); + txtCap.setText( u.getCap() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Utilizador u = udp.getUtilizador( a.getMedico_id() ); + stMedico.setText( u.getNome() + "  " ); + txtCedula.setText( u.getNumero_cedula() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillSiprpView( AnaliseAcidente a ) + { + if ( a.getEstado().intValue() == Global.ESTADO_HS ) + { + if ( a.getTecnico_saude_id() == null || a.getTecnico_saude_id().equals( new Integer( 0 ) ) ) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); + } + } + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador u = udp.getUtilizador( a.getTecnico_saude_id() ); + stTecnicoNome.setText( Utils.unicodeToHTML( u.getNome() ) ); + txtCap1.setText( u.getCap() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador u = udp.getUtilizador( a.getMedico_id() ); + stMedicoNome.setText( Utils.unicodeToHTML( u.getNome() ) ); + txtCedula1.setText( u.getNumero_cedula() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillAcidentado( Acidentado a ) + { + txtNomeAcidentado.setText( a.getNome() ); + stEstabelecimentoOrigem.setText( a.getEstabelecimento_origem() ); + //txtDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date( a.getData_nascimento().getTime() ); + txtDataNascimento.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { + } + txtBI.setText( a.getBilhete_identidade() ); + txtMorada.setText( a.getMorada() ); + String cod_postal1 = ""; + String cod_postal2 = ""; + try + { + cod_postal1 = a.getCod_postal().substring( 0, 4 ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + try + { + cod_postal2 = a.getCod_postal().substring( 5, 8 ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + + + txtCodPostal1.setText( cod_postal1 ); + txtCodPostal2.setText( cod_postal2 ); + txtLocalidade.setText( a.getLocalidade() ); + txtContactoTelefonico.setText( a.getContacto_telefonico() ); + try + { + java.util.Date ddate = new java.util.Date( a.getData_admissao().getTime() ); + stDataAdmissao.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + + stFuncao.setText( a.getFuncao() ); + rbTurnoManha.setSelected( null ); + rbTurnoTarde.setSelected( null ); + rbTurnoNoite.setSelected( null ); + rbTurnoOutro.setSelected( null ); + if ( a.getTurno().matches( "m" ) ) + { + rbTurnoManha.setSelected( new Boolean( true ) ); + } + else if ( a.getTurno().matches( "t" ) ) + { + rbTurnoTarde.setSelected( new Boolean( true ) ); + } + else if ( a.getTurno().matches( "n" ) ) + { + rbTurnoNoite.setSelected( new Boolean( true ) ); + } + else if ( a.getTurno().matches( "o" ) ) + { + rbTurnoOutro.setSelected( new Boolean( true ) ); + } + + txtNomeSuperior.setText( a.getNome_superior_hierarquico() ); + txtEmailSuperior.setText( a.getEmail_superior_hierarquico() ); + + } + + private void fillAcidentadoView( Acidentado a ) + { + stNomeAcidentado.setText( a.getNome() ); + stEstabelecimentoOrigem1.setText( a.getEstabelecimento_origem() ); + //stDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date( a.getData_nascimento().getTime() ); + stDataNascimento.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + stBI.setText( a.getBilhete_identidade() ); + stMorada.setText( a.getMorada() ); + String cod_postal1 = ""; + String cod_postal2 = ""; + try + { + cod_postal1 = a.getCod_postal().substring( 0, 4 ); + } + catch ( Exception ex ) + { + cod_postal1 = ""; + } + try + { + cod_postal2 = a.getCod_postal().substring( 5, 8 ); + } + catch ( Exception ex ) + { + cod_postal2 = ""; + } + + //String cod_postal1 = a.getCod_postal().substring(0, 4); + //String cod_postal2 = a.getCod_postal().substring(5, 8); + if ( a.getLocalidade() == null ) + { + a.setLocalidade( "" ); + } + String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); + stCodPostal.setText( cod_postal ); + stContactoTelefonico.setText( a.getContacto_telefonico() ); + //stDataAdmissao1.setText(a.getData_admissao()); + + try + { + java.util.Date ddate = new java.util.Date( a.getData_admissao().getTime() ); + stDataAdmissao1.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + + stFuncao1.setText( a.getFuncao() ); + String turno_str = ""; + if ( a.getTurno() != null ) + { + if ( a.getTurno().matches( "m" ) ) + { + turno_str = "manhã"; + } + else if ( a.getTurno().matches( "t" ) ) + { + turno_str += "tarde "; + } + else if ( a.getTurno().matches( "n" ) ) + { + turno_str += "noite"; + } + } + + stTurno.setText( turno_str ); + stNomeSuperior.setText( a.getNome_superior_hierarquico() ); + stEmailSuperior.setText( a.getEmail_superior_hierarquico() ); + } + + private void fillDadosAcidenteSeg( AnaliseAcidente a ) + { + //stDataAcidente.setText(a.getData_acidente()); +// try +// { +// java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); +// stDataAcidente.setText(utils.Utils.dateToYYYYMMDD(ddate)); +// } +// catch(Exception ex){}; + if ( a.getAveriguador() == null ) + { + txtAveriguador.setText( getSessionBean1().getCurrentUser().getNome() ); + } + else + { + txtAveriguador.setText( a.getAveriguador() ); + } + + if ( a.getData_acidente() != null ) + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); +// calDataOcorrencia.setValue( ddate ); + setCalDataOcorrencia( ddate ); + } + + Calendar cal = Calendar.getInstance(); + + // set the calendar to have your time + try + { + cal.setTimeInMillis( a.getHora_acidente().getTime() ); + + int hour = cal.get( Calendar.HOUR_OF_DAY ); + int minutes = cal.get( Calendar.MINUTE ); + drpHours.setSelected( new Integer( hour ) ); + drpMinutes.setSelected( new Integer( minutes ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + + if ( a.getHoras_turno() != null ) + { + txtHorasTurno.setText( a.getHoras_turno().toString() ); + } + + ////txtSeccao.setText(a.getSeccao()); + +// AnalisesDataProvider adp = new AnalisesDataProvider(); + drpDepartamento.setSelected( a.getDepartamento_id() ); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + if ( a.getDepartamento_id().intValue() == 0 ) + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( null ) ); + drpSeccao.setSelected( new Integer( 0 ) ); + } + else + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( a.getDepartamento_id() ) ); + drpSeccao.setSelected( a.getSeccao_id() ); + } + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + + txtLocal.setText( a.getLocal_trabalho() ); + txtTarefa.setText( a.getTarefa() ); + txtSubstancias.setText( a.getSubstancias() ); +// txtSuperior.setText(a.getSuperior_hierarquico()); + txtCondicoes.setText( a.getCondicoes() ); + txtTestemunhas.setText( a.getTestemunhas() ); +// txtCausas.setText(a.getCausas()); + + drpCausas.setSelected( a.getCausas() ); + txtDescricao.setText( a.getDescricao() ); + txtConclusoes.setText( a.getConclusoes() ); + txtAccoes.setText( a.getAccoes() ); + + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + chkAveriguacaoPosterior.setSelected( new Boolean( true ) ); + } + + txtAveriguacaoObs.setText( a.getAveriguacao_obs() ); + + //fill images + if ( gridImages.getChildren().size() > 0 ) + { + gridImages.getChildren().clear(); + } + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 0, 2 ) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); + + File apacheAnaliseFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName ); + if ( apacheAnaliseFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheAnaliseFolder ); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File( imageFileFolder ); + + if ( f.exists() ) + { + File images[] = f.listFiles(); + Arrays.sort( images ); + for ( int i = 0; i < images.length; i++ ) + { + if ( images[i].isFile() ) + { + String imageName = images[i].getName(); + ImageComponent newImg = new ImageComponent(); + newImg.setId( "img_comp" + imageName ); + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName + "/" + imageName ); + Global global = new Global(); + global.copyImage( images[i], apacheImage ); + + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/analises/" + folderName + "/" + imageName ); + newImg.setRendered( true ); + gridImages.getChildren().add( newImg ); + + Hyperlink ln = new Hyperlink(); + ln.setId( "img" + imageName ); + ln.setText( "Apagar" ); + //ln.setValue(imageName); + Class args[] = + { + javax.faces.event.ActionEvent.class + }; + ApplicationFactory factory = ( ApplicationFactory ) FactoryFinder.getFactory( FactoryFinder.APPLICATION_FACTORY ); + //mb = factory.getApplication().createMethodBinding( "#{EditarQuestionario.lnkGrupo_onClick}", args); + MethodBinding mbAction = ( MethodBinding ) factory.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkDelImageReal_actionListener}", args ); + ln.setActionListener( mbAction ); + gridImages.getChildren().add( ln ); + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillDadosAcidenteSegView( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + + stAveriguador.setText( a.getAveriguador() ); + if ( a.getData_acidente() == null ) + { + lblDataAcidente.setRendered( false ); + stDataAcidente1.setRendered( false ); + } + else + { + try + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); + stDataAcidente1.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + if ( a.getHora_acidente() == null ) + { + lblHoraAcidente.setRendered( false ); + stHoraAcidente1.setRendered( false ); + } + else + { + Calendar cal = Calendar.getInstance(); + + // set the calendar to have your time + cal.setTimeInMillis( a.getHora_acidente().getTime() ); + + int hour = cal.get( Calendar.HOUR_OF_DAY ); + int minutes = cal.get( Calendar.MINUTE ); + try + { + stHoraAcidente1.setText( utils.Utils.timeToHHMM( hour + ":" + minutes ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + boolean booTurnoSeccaoLocal = false; + if ( a.getHoras_turno() == null ) + { + lblHorasTurno.setRendered( false ); + txtHorasTurno2.setRendered( false ); + } + else if ( a.getHoras_turno().intValue() == 0 ) + { + lblHorasTurno.setRendered( false ); + txtHorasTurno2.setRendered( false ); + } + else + { + txtHorasTurno2.setText( a.getHoras_turno().toString() ); + booTurnoSeccaoLocal = true; + } + +// if(a.getSeccao() == null) +// { +// lblSeccao.setRendered(false); +// txtSeccao1.setRendered(false); +// } +// else if(a.getSeccao().trim().length() == 0) +// { +// lblSeccao.setRendered(false); +// txtSeccao1.setRendered(false); +// } +// else +// { +// txtSeccao1.setText(a.getSeccao()); +// booTurnoSeccaoLocal = true; +// } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Seccao s = adp.getSeccao( a.getSeccao_id() ); + txtSeccao1.setText( s.getDescricao() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + lblSeccao.setRendered( false ); + txtSeccao1.setRendered( false ); + } + + + if ( a.getLocal_trabalho() == null ) + { + lblLocal.setRendered( false ); + txtLocal1.setRendered( false ); + } + else if ( a.getLocal_trabalho().trim().length() == 0 ) + { + lblLocal.setRendered( false ); + txtLocal1.setRendered( false ); + } + else + { + txtLocal1.setText( a.getLocal_trabalho() ); + booTurnoSeccaoLocal = true; + } + + if ( !booTurnoSeccaoLocal ) + { + gridTurnoSeccaoLocal.setRendered( false ); + } + + + if ( a.getTarefa() == null ) + { + gridTarefa.setRendered( false ); + lblTarefa.setRendered( false ); + txtTarefa1.setRendered( false ); + } + else if ( a.getTarefa().trim().length() == 0 ) + { + gridTarefa.setRendered( false ); + lblTarefa.setRendered( false ); + txtTarefa1.setRendered( false ); + } + else + { + txtTarefa1.setText( a.getTarefa() ); + } + + + if ( a.getSubstancias() == null ) + { + gridSubstancias.setRendered( false ); + lblSubstancias.setRendered( false ); + txtSubstancias1.setRendered( false ); + } + else if ( a.getSubstancias().trim().length() == 0 ) + { + gridSubstancias.setRendered( false ); + lblSubstancias.setRendered( false ); + txtSubstancias1.setRendered( false ); + } + else + { + txtSubstancias1.setText( a.getSubstancias() ); + } + +// if(a.getSuperior_hierarquico() == null) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior1.setRendered(false); +// } +// else if(a.getSuperior_hierarquico().trim().length() == 0) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior1.setRendered(false); +// } +// else +// { +// txtSuperior1.setText(a.getSuperior_hierarquico()); +// } + + if ( a.getCondicoes() == null ) + { + gridCondicoes.setRendered( false ); + lblCondicoes.setRendered( false ); + txtCondicoes1.setRendered( false ); + } + else if ( a.getCondicoes().trim().length() == 0 ) + { + gridCondicoes.setRendered( false ); + lblCondicoes.setRendered( false ); + txtCondicoes1.setRendered( false ); + } + else + { + txtCondicoes1.setText( a.getCondicoes() ); + } + + if ( a.getTestemunhas() == null ) + { + gridTestemunhas.setRendered( false ); + lblTestemunhas.setRendered( false ); + txtTestemunhas1.setRendered( false ); + } + else if ( a.getTestemunhas().trim().length() == 0 ) + { + gridTestemunhas.setRendered( false ); + lblTestemunhas.setRendered( false ); + txtTestemunhas1.setRendered( false ); + } + else + { + txtTestemunhas1.setText( a.getTestemunhas() ); + } + +// txtCausas1.setText(a.getCausas()); + try + { + + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Causa c = adp.getCausa( a.getCausas() ); + txtCausas1.setText( c.getCausa() ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + gridCausas.setRendered( false ); + } + + if ( a.getDescricao() == null ) + { + gridDescricao.setRendered( false ); + lblDescricao.setRendered( false ); + txtDescricao1.setRendered( false ); + } + else if ( a.getDescricao().trim().length() == 0 ) + { + gridDescricao.setRendered( false ); + lblDescricao.setRendered( false ); + txtDescricao1.setRendered( false ); + } + else + { + txtDescricao1.setText( a.getDescricao() ); + } + + if ( a.getConclusoes() == null ) + { + gridConclusoes.setRendered( false ); + lblConclusoes.setRendered( false ); + txtConclusoes1.setRendered( false ); + } + else if ( a.getConclusoes().trim().length() == 0 ) + { + gridConclusoes.setRendered( false ); + lblConclusoes.setRendered( false ); + txtConclusoes1.setRendered( false ); + } + else + { + txtConclusoes1.setText( a.getConclusoes() ); + } + + if ( a.getAccoes() == null ) + { + gridAccoes.setRendered( false ); + lblAccoes.setRendered( false ); + txtAccoes1.setRendered( false ); + } + else if ( a.getAccoes().trim().length() == 0 ) + { + gridAccoes.setRendered( false ); + lblAccoes.setRendered( false ); + txtAccoes1.setRendered( false ); + } + else + { + txtAccoes1.setText( a.getAccoes() ); + } + + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + if ( a.getAveriguacao_obs().trim().length() == 0 ) // must edit + { + if ( getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_SEGURANCA ) // seguranca + { + gridAveriguacaoPosterior.setRendered( false ); + } + else + { + gridAveriguacaoPosterior.setRendered( false ); + gridAveriguacaoPosterior1.setRendered( false ); + } + } + else + { + gridAveriguacaoPosterior1.setRendered( false ); + txtAveriguacaoPosterior.setText( "Averiguação posterior: " + a.getAveriguacao_obs() ); + } + } + else + { + gridAveriguacaoPosterior.setRendered( false ); + gridAveriguacaoPosterior1.setRendered( false ); + } + + //fill images + if ( gridImages.getChildren().size() > 0 ) + { + gridImages.getChildren().clear(); + } + String folderName = a.getAnalise_nr().substring( 0, 2 ) + a.getAnalise_nr().substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + + File apacheAnaliseFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName ); + if ( apacheAnaliseFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheAnaliseFolder ); + System.out.println( "FILES DELETED" ); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File( imageFileFolder ); + + if ( f.exists() ) + { + File images[] = f.listFiles(); + Arrays.sort( images ); + for ( int i = 0; i < images.length; i++ ) + { + if ( images[i].isFile() ) + { + String imageName = images[i].getName(); + ImageComponent newImg = new ImageComponent(); + + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName + "/" + imageName ); + Global global = new Global(); + global.copyImage( images[i], apacheImage ); + + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/analises/" + folderName + "/" + imageName ); + + + //newImg.setUrl("/resources/images/" + getSessionBean1().getCurrentAnalise().getId() + "/" + imageName); + //newImg.setUrl(Global.IMAGE_FOLDER + "/" + folderName + "/" + imageName); + newImg.setRendered( true ); + gridImages1.getChildren().add( newImg ); + } + } + } + else + { + gridFotografias.setRendered( false ); + lblFotografias.setRendered( false ); + gridImages1.setRendered( false ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillDadosAcidenteRh( AnaliseAcidente a ) + { + if ( a.getFormacao_shst().matches( "y" ) ) + { + rbFormacaoSHSTY.setSelected( new Boolean( true ) ); + } + else if ( a.getFormacao_shst().matches( "n" ) ) + { + rbFormacaoSHSTN.setSelected( new Boolean( true ) ); + txtFormacaoSHSTNWhy.setText( a.getFormacao_shst_nao_porque() ); + } + else //t + { + rbFormacaoSHSTY.setSelected( null ); + rbFormacaoSHSTN.setSelected( null ); + } + + if ( a.getOutros_acidentes_com_colaborador().matches( "y" ) ) + { + rbAcidentesColaboradorY.setSelected( new Boolean( true ) ); + try + { + txtNrAcidentesColaborador.setText( a.getNr_acidentes_com_colaborador().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador1.setText( a.getNr_relatorio_acidente_colaborador1().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador2.setText( a.getNr_relatorio_acidente_colaborador2().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador3.setText( a.getNr_relatorio_acidente_colaborador3().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador4.setText( a.getNr_relatorio_acidente_colaborador4().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + else if ( a.getOutros_acidentes_com_colaborador().matches( "n" ) ) + { + rbAcidentesColaboradorN.setSelected( new Boolean( true ) ); + } + else //t + { + rbAcidentesColaboradorY.setSelected( null ); + rbAcidentesColaboradorN.setSelected( null ); + } + + if ( a.getAcidentes_outros_colaboradores().matches( "y" ) ) + { + rbAcidentesColaboradoresY.setSelected( new Boolean( true ) ); + try + { + txtNrAcidentesColaboradores.setText( a.getNr_acidentes_outros_colaboradores().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + txtNrRelatorioAcidentesColaboradores1.setText( a.getNr_relatorio_acidente_outros_colaboradores1().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + txtNrRelatorioAcidentesColaboradores2.setText( a.getNr_relatorio_acidente_outros_colaboradores2().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + txtNrRelatorioAcidentesColaboradores3.setText( a.getNr_relatorio_acidente_outros_colaboradores3().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + txtNrRelatorioAcidentesColaboradores4.setText( a.getNr_relatorio_acidente_outros_colaboradores4().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + else if ( a.getAcidentes_outros_colaboradores().matches( "n" ) ) + { + rbAcidentesColaboradoresN.setSelected( new Boolean( true ) ); + } + else //t + { + rbAcidentesColaboradoresY.setSelected( null ); + rbAcidentesColaboradoresN.setSelected( null ); + } + } + + private void fillDadosAcidenteRhView( AnaliseAcidente a ) + { + StaticText st = new StaticText(); + st.setId( "stSHST" ); + st.setEscape( false ); + + StaticText st1 = new StaticText(); + st1.setId( "stColaborador" ); + st1.setEscape( false ); + + StaticText st2 = new StaticText(); + st2.setId( "stColaboradores" ); + st2.setEscape( false ); + + if ( a.getFormacao_shst().matches( "y" ) ) + { + st.setText( "O colaborador teve formação em SHST." ); + gridSHST.getChildren().add( st ); + } + else if ( a.getFormacao_shst().matches( "n" ) ) + { + st.setText( "O colaborador não teve formação em SHST." ); + gridSHST.getChildren().add( st ); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdMotivo" ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft95" ); + StaticText s = new StaticText(); + s.setId( "stMotivo" ); + s.setEscape( false ); + s.setText( "Motivo: " ); + grd.getChildren().add( s ); + s = new StaticText(); + s.setId( "stMotivo1" ); + s.setEscape( false ); + s.setText( a.getFormacao_shst_nao_porque() ); + grd.getChildren().add( s ); + gridSHST.getChildren().add( grd ); + } + else + { + gridSHST.setRendered( false ); + } + + + if ( a.getOutros_acidentes_com_colaborador().matches( "y" ) ) + { + st1.setText( "Verificaram-se outras ocorrências/inicidências no mesmo posto de trabalho com o colaborador acidentado." ); + gridColaborador.getChildren().add( st1 ); + boolean booShow = false; + boolean booShow1 = false; + boolean booShow2 = false; + if ( a.getNr_acidentes_com_colaborador() != null ) + { + booShow = true; + booShow1 = true; + } + if ( a.getNr_relatorio_acidente_colaborador1() != null || a.getNr_relatorio_acidente_colaborador2() != null || a.getNr_relatorio_acidente_colaborador3() != null || a.getNr_relatorio_acidente_colaborador4() != null ) + { + booShow = true; + booShow2 = true; + } + + if ( booShow ) + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdColaboradorS" ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft15, gridColLeft85" ); + if ( booShow1 ) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId( "s100" ); + s.setEscape( false ); + s.setText( "Total:  " ); + pg.getChildren().add( s ); + s = new StaticText(); + s.setId( "s101" ); + s.setEscape( false ); + s.setText( a.getNr_acidentes_com_colaborador().toString() ); + pg.getChildren().add( s ); + grd.getChildren().add( pg ); + } + if ( booShow2 ) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId( "s102" ); + s.setEscape( false ); + s.setText( "Relatórios de acidente nº:  " ); + pg.getChildren().add( s ); + if ( a.getNr_relatorio_acidente_colaborador1() != null ) + { + if ( a.getNr_relatorio_acidente_colaborador1().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s103" ); + s.setEscape( false ); + s.setText( a.getNr_relatorio_acidente_colaborador1() ); + pg.getChildren().add( s ); + } + } + if ( a.getNr_relatorio_acidente_colaborador2() != null ) + { + if ( a.getNr_relatorio_acidente_colaborador2().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s104" ); + s.setEscape( false ); + s.setText( "  " + a.getNr_relatorio_acidente_colaborador2() ); + pg.getChildren().add( s ); + } + + } + if ( a.getNr_relatorio_acidente_colaborador3() != null ) + { + if ( a.getNr_relatorio_acidente_colaborador3().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s105" ); + s.setEscape( false ); + s.setText( "  " + a.getNr_relatorio_acidente_colaborador3() ); + pg.getChildren().add( s ); + } + } + if ( a.getNr_relatorio_acidente_colaborador4() != null ) + { + if ( a.getNr_relatorio_acidente_colaborador4().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s106" ); + s.setEscape( false ); + s.setText( "  " + a.getNr_relatorio_acidente_colaborador4() ); + pg.getChildren().add( s ); + } + } + grd.getChildren().add( pg ); + } + gridColaborador.getChildren().add( grd ); + } + + } + else if ( a.getOutros_acidentes_com_colaborador().matches( "n" ) ) + { + st1.setText( "Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado." ); + gridColaborador.getChildren().add( st1 ); + } + else //t + { + gridColaborador.setRendered( false ); + } + + if ( a.getAcidentes_outros_colaboradores().matches( "y" ) ) + { + st2.setText( "Verificaram-se ocorrências/incidentes semelhantes com outros colaboradores." ); + gridColaboradores.getChildren().add( st2 ); + boolean booShow = false; + boolean booShow1 = false; + boolean booShow2 = false; + if ( a.getNr_acidentes_outros_colaboradores() != null ) + { + booShow = true; + booShow1 = true; + } + if ( a.getNr_relatorio_acidente_outros_colaboradores1() != null || a.getNr_relatorio_acidente_outros_colaboradores2() != null || a.getNr_relatorio_acidente_outros_colaboradores3() != null || a.getNr_relatorio_acidente_outros_colaboradores4() != null ) + { + booShow = true; + booShow2 = true; + } + + if ( booShow ) + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdColaboradoresS" ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft15, gridColLeft85" ); + if ( booShow1 ) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId( "s200" ); + s.setEscape( false ); + s.setText( "Total:  " ); + pg.getChildren().add( s ); + s = new StaticText(); + s.setId( "s201" ); + s.setEscape( false ); + s.setText( a.getNr_acidentes_outros_colaboradores() ); + pg.getChildren().add( s ); + grd.getChildren().add( pg ); + } + if ( booShow2 ) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId( "s202" ); + s.setEscape( false ); + s.setText( "Relatórios de acidente nº:  " ); + pg.getChildren().add( s ); + if ( a.getNr_relatorio_acidente_outros_colaboradores1() != null ) + { + if ( a.getNr_relatorio_acidente_outros_colaboradores1().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s203" ); + s.setEscape( false ); + s.setText( a.getNr_relatorio_acidente_outros_colaboradores1() ); + pg.getChildren().add( s ); + } + } + if ( a.getNr_relatorio_acidente_outros_colaboradores2() != null ) + { + if ( a.getNr_relatorio_acidente_outros_colaboradores2().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s204" ); + s.setEscape( false ); + s.setText( "  " + a.getNr_relatorio_acidente_outros_colaboradores2() ); + pg.getChildren().add( s ); + } + } + if ( a.getNr_relatorio_acidente_outros_colaboradores3() != null ) + { + if ( a.getNr_relatorio_acidente_outros_colaboradores3().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s205" ); + s.setEscape( false ); + s.setText( "  " + a.getNr_relatorio_acidente_outros_colaboradores3() ); + pg.getChildren().add( s ); + } + } + if ( a.getNr_relatorio_acidente_outros_colaboradores4() != null ) + { + if ( a.getNr_relatorio_acidente_outros_colaboradores4().intValue() > 0 ) + { + s = new StaticText(); + s.setId( "s206" ); + s.setEscape( false ); + s.setText( "  " + a.getNr_relatorio_acidente_outros_colaboradores4() ); + pg.getChildren().add( s ); + } + } + grd.getChildren().add( pg ); + } + gridColaboradores.getChildren().add( grd ); + } + } + else if ( a.getAcidentes_outros_colaboradores().matches( "n" ) ) + { + st2.setText( "Não se verificaram ocorrências/incidentes com outros colaboradores." ); + gridColaboradores.getChildren().add( st2 ); + } + else //t + { + gridColaboradores.setRendered( false ); + } + } + + private void fillRecomendacoesHs( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + ArrayList list = adp.getRecomendacoesByAnalise( a.getId() ); + ListIterator iter = list.listIterator(); + int seq = 1; + while ( iter.hasNext() ) + { + Recomendacao r = ( Recomendacao ) iter.next(); + if ( seq == 1 ) + { + txtRecomendacao1.setText( r.getRecomendacao() ); + } + else + { + + //int seq = gridRecomendacoes.getChildren().size(); + //seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grd" + seq ); + grd.setColumns( 3 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft90,gridColLeft5" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "st" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + TextArea ta = new TextArea(); + ta.setId( "ta" + seq ); + ta.setStyle( "height: 24px; width: 98%" ); + ta.setText( r.getRecomendacao() ); + grd.getChildren().add( ta ); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId( "ln" + seq ); + ln.setWidth( 9 ); + ln.setHeight( 9 ); + ln.setImageURL( "/resources/plus_more.gif" ); + MethodBinding mbAction = this.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkMoreRec1_action}", null ); + ln.setAction( mbAction ); + + grd.getChildren().add( ln ); + + gridRecomendacoes.getChildren().add( grd ); + + } + seq++; + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillRecomendacoesViewHs( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.getRecomendacoesByAnalise( a.getId() ); + ListIterator iter = list.listIterator(); + int seq = 1; + while ( iter.hasNext() ) + { + Recomendacao r = ( Recomendacao ) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdRecomendacaoView" + seq ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft95" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "stNrRecomendacaoView" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + st = new StaticText(); + st.setId( "stRecomendacaoView" + seq ); + st.setText( r.getRecomendacao() ); + //st.setStyle("width: 24px"); + grd.getChildren().add( st ); + + gridRecomendacoesView.getChildren().add( grd ); + seq++; + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMedidasRh( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.getMedidasByAnalise( a.getId() ); + ListIterator iter = list.listIterator(); + int seq = 1; + while ( iter.hasNext() ) + { + Medida m = ( Medida ) iter.next(); + if ( seq == 1 ) + { + txtMedida1.setText( m.getMedida() ); + } + else + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdMedida" + seq ); + grd.setColumns( 3 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft90,gridColLeft5" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "stNrMedida" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + TextArea ta = new TextArea(); + ta.setId( "taMedida" + seq ); + ta.setStyle( "height: 24px; width: 98%" ); + ta.setText( m.getMedida() ); + grd.getChildren().add( ta ); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId( "lnMedidaMore" + seq ); + ln.setWidth( 9 ); + ln.setHeight( 9 ); + ln.setImageURL( "/resources/plus_more.gif" ); + MethodBinding mbAction = this.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkMoreMed_action}", null ); + ln.setAction( mbAction ); + + grd.getChildren().add( ln ); + + gridMedidas.getChildren().add( grd ); + } + seq++; + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMedidasViewRh( AnaliseAcidente a ) + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.getMedidasByAnalise( a.getId() ); + ListIterator iter = list.listIterator(); + int seq = 1; + while ( iter.hasNext() ) + { + Medida m = ( Medida ) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdMedidaView" + seq ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft95" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "stNrMedidaView" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + st = new StaticText(); + st.setId( "stMedidaView" + seq ); + st.setText( m.getMedida() ); + //st.setStyle("width: 24px"); + grd.getChildren().add( st ); + + gridMedidasView.getChildren().add( grd ); + seq++; + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMedico( AnaliseAcidente a ) + { + + if ( a.getLesao_cabeca().matches( "y" ) ) + { + chkCabeca.setSelected( new Boolean( true ) ); + } + + if ( a.getLesao_pescoco().matches( "y" ) ) + { + chkPescoco.setSelected( new Boolean( true ) ); + } + + if ( a.getLesao_tronco().matches( "y" ) ) + { + chkTronco.setSelected( new Boolean( true ) ); + } + + if ( a.getLesao_membro_sup_dir().matches( "y" ) ) + { + chkMembroSupDir.setSelected( new Boolean( true ) ); + //lblEspecif1.setRendered(true); + //txtEspecif1.setRendered(true); + lblEspecif1.setVisible( true ); + txtEspecif1.setVisible( true ); + + txtEspecif1.setText( a.getEspecif1() ); + } + else + { + //lblEspecif1.setRendered(false); + //txtEspecif1.setRendered(false); + lblEspecif1.setVisible( false ); + txtEspecif1.setVisible( false ); + + } + + if ( a.getLesao_membro_sup_esq().matches( "y" ) ) + { + chkMembroSupEsq.setSelected( new Boolean( true ) ); +// lblEspecif2.setRendered(true); +// txtEspecif2.setRendered(true); + lblEspecif2.setVisible( true ); + txtEspecif2.setVisible( true ); + txtEspecif2.setText( a.getEspecif2() ); + } + else + { + lblEspecif2.setVisible( false ); + txtEspecif2.setVisible( false ); + } + + if ( a.getLesao_membro_inf_dir().matches( "y" ) ) + { + chkMembroInfDir.setSelected( new Boolean( true ) ); + lblEspecif3.setVisible( true ); + txtEspecif3.setVisible( true ); + txtEspecif3.setText( a.getEspecif3() ); + } + else + { + lblEspecif3.setVisible( false ); + txtEspecif3.setVisible( false ); + } + + if ( a.getLesao_membro_inf_esq().matches( "y" ) ) + { + chkMembroInfEsq.setSelected( new Boolean( true ) ); + lblEspecif4.setVisible( true ); + txtEspecif4.setVisible( true ); + txtEspecif4.setText( a.getEspecif4() ); + } + else + { + lblEspecif4.setVisible( false ); + txtEspecif4.setVisible( false ); + } + + txtTipoLesao.setText( a.getTipo_lesao() ); + if ( a.getTipo_incapacidade().matches( "n" ) ) + { + rbIncapacidadeNone.setSelected( new Boolean( true ) ); + } + else if ( a.getTipo_incapacidade().matches( "t" ) ) + { + rbIncapacidadeTemp.setSelected( new Boolean( true ) ); + } + else if ( a.getTipo_incapacidade().matches( "p" ) ) + { + rbIncapacidadePerm.setSelected( new Boolean( true ) ); + } + else + { + rbIncapacidadeNone.setSelected( null ); + rbIncapacidadeTemp.setSelected( null ); + rbIncapacidadePerm.setSelected( null ); + } + + if ( a.getCoef_incapacidade() == null ) + { + txtCoefIncapacidade.setText( "" ); + } + else + { + txtCoefIncapacidade.setText( a.getCoef_incapacidade() ); + } + + + if ( a.getData_aval_incapacidade() != null ) + { + java.util.Date ddate = new java.util.Date( a.getData_aval_incapacidade().getTime() ); +// calAvaliacaoIncap.setValue( ddate ); + setCalAvaliacaoIncap( ddate ); + } + + if ( a.getData_rev_incapacidade() != null ) + { + java.util.Date ddate = new java.util.Date( a.getData_rev_incapacidade().getTime() ); +// calRevisaoIncap.setValue( ddate ); + setCalRevisaoIncap( ddate ); + } + + if ( a.getPeriodo_incapacidade_de() != null ) + { + java.util.Date ddate = new java.util.Date( a.getPeriodo_incapacidade_de().getTime() ); +// calPeridoIncapDe.setValue( ddate ); + setCalPeriodoIncapDe( ddate ); + } + + if ( a.getPeriodo_incapacidade_a() != null ) + { + java.util.Date ddate = new java.util.Date( a.getPeriodo_incapacidade_a().getTime() ); +// calPeriodoIncapA.setValue( ddate ); + setCalPeriodoIncapA( ddate ); + } + + if ( a.getImg_flexao().matches( "y" ) ) + { + chkImgFlexao.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_rot1().matches( "y" ) ) + { + chkImgRot1.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_rot2().matches( "y" ) ) + { + chkImgRot2.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ext1().matches( "y" ) ) + { + chkImgExt1.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ext2().matches( "y" ) ) + { + chkImgExt2.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_cab1().matches( "y" ) ) + { + chkImgCab1.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_cab2().matches( "y" ) ) + { + chkImgCab2.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_cab3().matches( "y" ) ) + { + chkImgCab3.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_cab4().matches( "y" ) ) + { + chkImgCab4.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma1().matches( "y" ) ) + { + chkImgMa1.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma2().matches( "y" ) ) + { + chkImgMa2.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma3().matches( "y" ) ) + { + chkImgMa3.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma4().matches( "y" ) ) + { + chkImgMa4.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma5().matches( "y" ) ) + { + chkImgMa5.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma6().matches( "y" ) ) + { + chkImgMa6.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma7().matches( "y" ) ) + { + chkImgMa7.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma8().matches( "y" ) ) + { + chkImgMa8.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma9().matches( "y" ) ) + { + chkImgMa9.setSelected( new Boolean( true ) ); + } + + if ( a.getImg_ma10().matches( "y" ) ) + { + chkImgMa10.setSelected( new Boolean( true ) ); + } + + if ( a.getRestricao_carga() != null ) + { + if ( a.getRestricao_carga().intValue() > 0 ) + { + chkRestricaoCargas.setSelected( new Boolean( true ) ); + rbKgs2.setRendered( true ); + rbKgs5.setRendered( true ); + rbKgs10.setRendered( true ); + rbKgs15.setRendered( true ); + rbKgsOutro.setRendered( true ); + txtKgs.setRendered( true ); + stKgs2.setRendered( true ); + stKgs5.setRendered( true ); + stKgs10.setRendered( true ); + stKgs15.setRendered( true ); + stKgsOutro.setRendered( true ); + stKg.setRendered( true ); + int carga = a.getRestricao_carga().intValue(); + switch ( carga ) + { + case 2: + rbKgs2.setSelected( new Boolean( true ) ); + break; + case 5: + rbKgs5.setSelected( new Boolean( true ) ); + break; + case 10: + rbKgs10.setSelected( new Boolean( true ) ); + break; + case 15: + rbKgs15.setSelected( new Boolean( true ) ); + break; + default: + rbKgsOutro.setSelected( new Boolean( true ) ); + txtKgs.setText( a.getRestricao_carga().toString() ); + break; + } + } + else + { + chkRestricaoCargas.setSelected( new Boolean( false ) ); + rbKgs2.setRendered( false ); + rbKgs5.setRendered( false ); + rbKgs10.setRendered( false ); + rbKgs15.setRendered( false ); + rbKgsOutro.setRendered( false ); + txtKgs.setRendered( false ); + stKgs2.setRendered( false ); + stKgs5.setRendered( false ); + stKgs10.setRendered( false ); + stKgs15.setRendered( false ); + stKgsOutro.setRendered( false ); + stKg.setRendered( false ); + } + } + else + { + chkRestricaoCargas.setSelected( new Boolean( false ) ); + rbKgs2.setRendered( false ); + rbKgs5.setRendered( false ); + rbKgs10.setRendered( false ); + rbKgs15.setRendered( false ); + rbKgsOutro.setRendered( false ); + txtKgs.setRendered( false ); + stKgs2.setRendered( false ); + stKgs5.setRendered( false ); + stKgs10.setRendered( false ); + stKgs15.setRendered( false ); + stKgsOutro.setRendered( false ); + stKg.setRendered( false ); + } + + if ( a.getRestricao_motricidade().matches( "y" ) ) + { + chkRestricaoMotricidade.setSelected( new Boolean( true ) ); + } + + if ( a.getRestricao_conducao().matches( "y" ) ) + { + chkRestricaoConducao.setSelected( new Boolean( true ) ); + } + + if ( a.getRestricao_vibracoes().matches( "y" ) ) + { + chkRestricaoVibracoes.setSelected( new Boolean( true ) ); + } + + if ( a.getRestricao_outras() != null ) + { + if ( a.getRestricao_outras().trim().length() > 0 ) + { + chkRestricaoOutras.setSelected( new Boolean( true ) ); + txtRestricaoOutras.setText( a.getRestricao_outras() ); + } + } + + txtObservacoes.setText( a.getMed_observ() ); + + } + + private void fillMedicoView( AnaliseAcidente a ) + { + PanelGroup pg = null; + StaticText st = null; + HtmlPanelGrid grd = null; + ImageComponent img = null; + //LESAO : + + if ( a.getLesao_cabeca().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoCabeca" ); + st.setEscape( false ); + st.setText( "Cabeça" ); + gridLesao.getChildren().add( st ); + } + + if ( a.getLesao_pescoco().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoPescoco" ); + st.setEscape( false ); + st.setText( "Pescoço" ); + gridLesao.getChildren().add( st ); + } + + if ( a.getLesao_tronco().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoTronco" ); + st.setEscape( false ); + st.setText( "Tronco" ); + gridLesao.getChildren().add( st ); + } + + grd = new HtmlPanelGrid(); + grd.setId( "gridLesaoMembros" ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft" ); + if ( a.getLesao_membro_sup_dir().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoMembroSupDir" ); + st.setEscape( false ); + st.setText( "Membro Superior Direito" ); + grd.getChildren().add( st ); + if ( a.getEspecif1() != null ) + { + if ( a.getEspecif1().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif1" ); + st.setEscape( false ); + st.setText( " - " + a.getEspecif1() ); + grd.getChildren().add( st ); + } + } + + } + + if ( a.getLesao_membro_sup_esq().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoMembroSupEsq" ); + st.setEscape( false ); + st.setText( "Membro Superior Esquerdo" ); + grd.getChildren().add( st ); + if ( a.getEspecif2() != null ) + { + if ( a.getEspecif2().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif2" ); + st.setEscape( false ); + st.setText( " - " + a.getEspecif2() ); + grd.getChildren().add( st ); + } + } + + } + + if ( a.getLesao_membro_inf_dir().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoMembroInfDir" ); + st.setEscape( false ); + st.setText( "Membro Inferior Direito" ); + grd.getChildren().add( st ); + if ( a.getEspecif3() != null ) + { + if ( a.getEspecif3().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif3" ); + st.setEscape( false ); + st.setText( a.getEspecif3() ); + grd.getChildren().add( st ); + } + } + } + + if ( a.getLesao_membro_inf_esq().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoMembroInfEsq" ); + st.setEscape( false ); + st.setText( "Membro Inferior Esquerdo" ); + grd.getChildren().add( st ); + if ( a.getEspecif4() != null ) + { + if ( a.getEspecif4().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif4" ); + st.setEscape( false ); + st.setText( a.getEspecif4() ); + grd.getChildren().add( st ); + } + } + + } + if ( grd.getChildren().size() > 0 ) + { + gridLesao.getChildren().add( grd ); + } + + if ( a.getTipo_lesao().trim().length() > 0 ) + { + pg = new PanelGroup(); + pg.setId( "pgTipoLesao" ); + st = new StaticText(); + st.setId( "stTipoLesaoLbl" ); + st.setEscape( false ); + st.setText( "Tipo de lesão:   " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stTipoLesao" ); + st.setEscape( false ); + st.setText( a.getTipo_lesao() ); + pg.getChildren().add( st ); + gridLesao.getChildren().add( pg ); + } + + //INCAPACIDADE : + pg = new PanelGroup(); + pg.setId( "pgTipoIncapacidade" ); + st = new StaticText(); + st.setId( "stTipoIncapacidadeLbl1" ); + st.setStyle( "font-weight: bold" ); + st.setEscape( false ); + st.setText( "Tipo de incapacidade:  " ); + if ( a.getTipo_incapacidade().matches( "t" ) ) + { + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stTipoIncapacidade" ); + st.setEscape( false ); + st.setText( "Temporária  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stTipoIncapacidadeLbl2" ); + st.setStyle( "font-weight: bold" ); + st.setEscape( false ); + st.setText( "Coeficiente de incapacidade:  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stCoefIncapacidade" ); + st.setEscape( false ); + st.setText( a.getCoef_incapacidade().toString() + "%" ); + pg.getChildren().add( st ); + } + else if ( a.getTipo_incapacidade().matches( "p" ) ) + { + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stTipoIncapacidade" ); + st.setEscape( false ); + st.setText( "Permanente  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stTipoIncapacidadeLbl2" ); + st.setStyle( "font-weight: bold" ); + st.setEscape( false ); + st.setText( "Coeficiente de incapacidade:  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stCoefIncapacidade" ); + st.setEscape( false ); + st.setText( a.getCoef_incapacidade().toString() + "%" ); + pg.getChildren().add( st ); + } + + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade2.getChildren().add( pg ); + } + + pg = new PanelGroup(); + if ( a.getData_aval_incapacidade() != null ) + { + + pg.setId( "pgAvaliacaoIncapacidade" ); + st = new StaticText(); + st.setId( "stDataAvalIncapacidadeLbl1" ); + st.setEscape( false ); + st.setText( "Avaliação de incapacidade realizada em  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stDataAvalIncapacidade" ); + st.setEscape( false ); + //st.setText(a.getData_aval_incapacidade()); + try + { + java.util.Date ddate = new java.util.Date( a.getData_aval_incapacidade().getTime() ); + st.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + } + + + if ( a.getData_rev_incapacidade() != null ) + { + st = new StaticText(); + st.setId( "stDataRevIncapacidadeLbl1" ); + st.setEscape( false ); + st.setText( "Revisão de incapacidade em  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stDataRevIncapacidade" ); + st.setEscape( false ); + //st.setText(a.getData_rev_incapacidade()); + try + { + java.util.Date ddate = new java.util.Date( a.getData_rev_incapacidade().getTime() ); + st.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + } + + + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade2.getChildren().add( pg ); + } + + + pg = new PanelGroup(); + + if ( a.getPeriodo_incapacidade_de() != null || a.getPeriodo_incapacidade_a() != null ) + { + + pg.setId( "pgPeriodoIncapacidade" ); + st = new StaticText(); + st.setId( "stPeriodoIncapacidadeLbl1" ); + st.setEscape( false ); + st.setText( "Período de incapacidade temporária de  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stPeriodoIncapacidadeDe" ); + st.setEscape( false ); + //st.setText(a.getPeriodo_incapacidade_de()); + try + { + java.util.Date ddate = new java.util.Date( a.getPeriodo_incapacidade_de().getTime() ); + st.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stPeriodoIncapacidadeLbl2" ); + st.setEscape( false ); + st.setText( "  a  " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stPeriodoIncapacidadeA" ); + st.setEscape( false ); + //st.setText(a.getPeriodo_incapacidade_a()); + try + { + java.util.Date ddate = new java.util.Date( a.getPeriodo_incapacidade_a().getTime() ); + st.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + + } + + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade2.getChildren().add( pg ); + } + + + //RESTRICOES + +// if(a.getImg_flexao().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgFlexao"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// pg = new PanelGroup(); +// pg.setId("pgImgFlexao"); +// img = new ImageComponent(); +// img.setId("imgRestricoes1000"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle1.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1001"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle2.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1002"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle3.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1003"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle4.gif"); +// pg.getChildren().add(img); +// grd.getChildren().add(pg); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl1"); +// st.setEscape(false); +// st.setText("Flexão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_rot1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgRot1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes1005"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/rot1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl2"); +// st.setEscape(false); +// st.setText("Flexão Lateral"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_rot2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgRot2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes1006"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/rot2.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl3"); +// st.setEscape(false); +// st.setText("Rotação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ext1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgExt1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes1007"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl4"); +// st.setEscape(false); +// st.setText("Extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ext2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgExt2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// pg = new PanelGroup(); +// pg.setId("pgImgExt2"); +// img = new ImageComponent(); +// img.setId("imgRestricoes1008"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext2.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1009"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext3.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1010"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext4.gif"); +// pg.getChildren().add(img); +// grd.getChildren().add(pg); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl5"); +// st.setEscape(false); +// st.setText("Flexão/Extensão Lateral + Rotação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10011"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl6"); +// st.setEscape(false); +// st.setText("Flexão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10012"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca2.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl7"); +// st.setEscape(false); +// st.setText("Extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab3().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab3"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10013"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca3.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl8"); +// st.setEscape(false); +// st.setText("Flexão Lateral"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab4().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab4"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10014"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca4.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl9"); +// st.setEscape(false); +// st.setText("Rotação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10015"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl10"); +// st.setEscape(false); +// st.setText("Poronação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10016"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma2.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl11"); +// st.setEscape(false); +// st.setText("Supinação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma3().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa3"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10017"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma3.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl12"); +// st.setEscape(false); +// st.setText("Flexão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma4().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa4"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10018"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma4.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl13"); +// st.setEscape(false); +// st.setText("Extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma5().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa5"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10019"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma5.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl14"); +// st.setEscape(false); +// st.setText("Desvio Ulnar"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma6().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa6"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10020"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma6.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl15"); +// st.setEscape(false); +// st.setText("Desvio Radial"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma7().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa7"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10021"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma7.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl16"); +// st.setEscape(false); +// st.setText("Pinça Digital"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma8().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa8"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10022"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma8.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl17"); +// st.setEscape(false); +// st.setText("Segurar objectos entre os dedos"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma9().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa9"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10023"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma9.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl18"); +// st.setEscape(false); +// st.setText("Dedos em extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma10().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa10"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10024"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma10.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl19"); +// st.setEscape(false); +// st.setText("Pega palmar"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getRestricao_carga() != null) +// { +// if(a.getRestricao_carga().intValue() > 0) +// { +// pg = new PanelGroup(); +// st = new StaticText(); +// st.setId("stRestricaoCargaLbl"); +// st.setEscape(false); +// st.setText("Movimentação e manipulação de cargas com mais de  "); +// pg.getChildren().add(st); +// st = new StaticText(); +// st.setId("stRestricaoCargaKgs"); +// st.setEscape(false); +// st.setText(a.getRestricao_carga().toString()); +// pg.getChildren().add(st); +// st = new StaticText(); +// st.setId("stRestricaoCargaLbl1"); +// st.setEscape(false); +// st.setText("Kg"); +// pg.getChildren().add(st); +// gridOutrasRestricoes.getChildren().add(pg); +// } +// +// if(a.getRestricao_motricidade().matches("y")) +// { +// st = new StaticText(); +// st.setId("stRestricaoMotricidadeLbl"); +// st.setEscape(false); +// st.setText("Operações que requeiram motricidade fina."); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getRestricao_conducao().matches("y")) +// { +// st = new StaticText(); +// st.setId("stRestricaoConducaoLbl"); +// st.setEscape(false); +// st.setText("Condução/interacção com veículos ou outros equipamentos."); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getRestricao_vibracoes().matches("y")) +// { +// st = new StaticText(); +// st.setId("stRestricaoVibracoesLbl"); +// st.setEscape(false); +// st.setText("Utilizaçõo de equipamentos/ferramentas que impliquem exposição a vibrações ou impactos."); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getRestricao_outras().trim().length() > 0) +// { +// st = new StaticText(); +// st.setId("stRestricaoOutras"); +// st.setEscape(false); +// st.setText(a.getRestricao_outras()); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getMed_observ().trim().length() > 0) +// { +// stObservacoes.setText(a.getMed_observ()); +// } +// } + + } +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } + +// public String lnkNome_action() { +// // TODO: Replace with your code +// RowKey rk = tableRowGroup1.getRowKey(); +// int k = Integer.parseInt(rk.getRowId()); +// TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); +// ArrayList list = (ArrayList) provider.getList(); +// Trabalhador t = (Trabalhador)list.get(k); +// txtTrabalhador.setText(t.getNome()); +// txtNomeAcidentado.setText(t.getNome()); +// txtDataNascimento.setText(t.getData_nascimento()); +// Acidentado a = new Acidentado(); +// a.setTrabalhador_id(t.getId()); +// a.setData_nascimento(t.getData_nascimento()); +// a.setNome(t.getNome()); +// a.setFuncao(utils.Utils.unicodeToHTML(t.getFuncao())); +// a.setData_admissao(t.getData_admissao()); +// getSessionBean1().setAcidentado(a); +// if(getSessionBean1().getCurrentAnalise() != null) // new analise) +// { +// gridTrabalhadores.setRendered(false); +// } +// +// return null; +// } +// public String lnkDataNascimento_action() { +// // TODO: Replace with your code +// RowKey rk = tableRowGroup1.getRowKey(); +// int k = Integer.parseInt(rk.getRowId()); +// TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); +// ArrayList list = (ArrayList) provider.getList(); +// Trabalhador t = (Trabalhador)list.get(k); +// txtTrabalhador.setText(t.getNome()); +// txtNomeAcidentado.setText(t.getNome()); +// txtDataNascimento.setText(t.getData_nascimento()); +// Acidentado a = new Acidentado(); +// a.setTrabalhador_id(t.getId()); +// a.setData_nascimento(t.getData_nascimento()); +// a.setNome(t.getNome()); +// a.setFuncao(t.getFuncao()); +// a.setData_admissao(t.getData_admissao()); +// getSessionBean1().setAcidentado(a); +// if(getSessionBean1().getCurrentAnalise() != null) // new analise) +// { +// gridTrabalhadores.setRendered(false); +// } +// return null; +// } + private void fillVerificacao( AnaliseAcidente a ) + { + int estado = a.getEstado().intValue(); + switch ( estado ) + { + case Global.ESTADO_ASSINATURA_SEG: + if ( a.getAss_resp_seg().matches( "y" ) ) + { + chkVerRespSeg.setSelected( new Boolean( true ) ); + chkVerRespSeg.setDisabled( true ); + java.util.Date ddate = new java.util.Date( a.getData_assinatura_seg().getTime() ); + stVerRespSeg.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + } + break; + + case Global.ESTADO_ASSINATURA_RH: + if ( a.getAss_resp_rh().matches( "y" ) ) + { + chkVerRespRh.setSelected( new Boolean( true ) ); + chkVerRespRh.setDisabled( true ); + java.util.Date ddate = new java.util.Date( a.getData_assinatura_rh().getTime() ); + stVerRespRh.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + } + + break; + } + } + + private void fillVerificacaoView( AnaliseAcidente a ) + { + StaticText st = null; + String txtVer = null; + if ( a.getAveriguador() != null ) + { + if ( a.getAveriguador().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stVerificacao1" ); + st.setEscape( false ); + txtVer = "Averiguado por " + a.getAveriguador() + " (Departamento de Segurança) a "; + //txtVer += a.getData_assinatura_seg(); + + try + { + java.util.Date ddate = new java.util.Date( a.getData_inicio_processo().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + } + + if ( a.getAss_consolidacao().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stVerificacao2" ); + st.setEscape( false ); + txtVer = "Verificado por " + a.getNome_resp_consolidacao() + " (Técnico de SHST) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date( a.getData_consolidacao().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + + if ( a.getAss_resp_seg().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stVerificacao3" ); + st.setEscape( false ); + txtVer = "Verificado por " + a.getNome_resp_seg() + " (Responsável de Segurança) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_seg().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + + if ( a.getAss_resp_rh().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stVerificacao4" ); + st.setEscape( false ); + txtVer = "Verificado por " + a.getNome_resp_rh() + " (Responsável de RH) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_rh().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Acidentado ac = adp.getAcidentado( a.getAcidentado_id() ); + if ( ac.getNome_superior_hierarquico() != null ) + { + if ( ac.getNome_superior_hierarquico().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stVerificacao5" ); + st.setEscape( false ); + txtVer = "Com conhecimento de " + ac.getNome_superior_hierarquico() + " (Responsável hierárquico)"; + + if ( ac.getEmail_superior_hierarquico() != null ) + { + if ( ac.getEmail_superior_hierarquico().trim().length() > 0 ) + { + try + { + java.util.Date ddate = new java.util.Date( ac.getData_email_superior_hierarquico().getTime() ); + txtVer += " a " + utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + txtVer += "."; + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + HtmlPanelGrid grid = new HtmlPanelGrid(); + grid.setId( "rodape1" ); + grid.setColumns( 1 ); + grid.setStyle( "width: 100%" ); + grid.setColumnClasses( "gridColCenter" ); + st = new StaticText(); + st.setId( "stRodape1" ); + st.setEscape( false ); + st.setText( "- processamento informático - acesso autenticado -" ); + grid.getChildren().add( st ); + gridAssinaturasView.getChildren().add( grid ); + } + + private AnaliseAcidente fillAnaliseFieldsImpressao( AnaliseAcidente a ) + { + a.setAss_superior( "n" ); + if ( chkAssSup.getSelected() != null ) + { + if ( chkAssSup.getSelected().equals( new Boolean( true ) ) ) + { + a.setAss_superior( "y" ); + } + } + + if ( a.getAss_superior().matches( "y" ) ) + { + a.setNome_superior( "" ); + if ( txtAssSup.getText() != null ) + { + a.setNome_superior( ( String ) txtAssSup.getText() ); + } + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date( today.getTime() ); + a.setData_assinatura_superior( sqlToday ); + } + else + { + a.setNome_superior( "" ); + a.setData_assinatura_superior( null ); + } + return a; + } + + private void fillImpressao( AnaliseAcidente a ) + { + if ( a.getAss_superior().matches( "y" ) ) + { + chkAssSup.setSelected( new Boolean( true ) ); + txtAssSup.setText( a.getNome_superior() ); + String txt = ( String ) stAssSup2.getText(); + String nome_acidentado = getSessionBean1().getAcidentado().getNome(); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_superior().getTime() ); + stData += utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + stAssSup2.setText( txt + nome_acidentado + ", a " + stData ); + } + + } + + private void fillImpressaoView( AnaliseAcidente a ) + { + StaticText st = new StaticText(); + st.setId( "stImpressaoView1" ); + st.setEscape( false ); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_superior().getTime() ); + stData += utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + String txt = "Assinado na Ficha de Análise de Acidente em papel por " + a.getNome_superior() + ", superior hierárquico / superior de "; + txt += getSessionBean1().getAcidentado().getNome() + ", a " + stData; + gridAssSupView.getChildren().add( st ); + } + + public String butImagem_action() + { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + getSessionBean1().setIeBug( true ); + savePageState(); + return "load_image"; + } + + private void fillImages() + { +// String imageName = getSessionBean1().getImageName(); +// if(imageName != null) +// { +// ImageComponent newImg = new ImageComponent(); +// newImg.setUrl("/resources/imagens/" + imageName); +// System.out.println("IMAGE URL : " + "/resources/imagens/" + imageName); +// newImg.setRendered(true); +// gridImages.getChildren().add(newImg); +// System.out.println("HERE"); +// } +// if(gridImages.getChildren().size() > 0) +// { +// gridImages.getChildren().clear(); +// } + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); + + + File apacheTmpFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/tmp" + getSessionBean1().getCurrentUser().getLogin() ); + if ( apacheTmpFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheTmpFolder ); + } + else + { + apacheTmpFolder.mkdir(); + } + +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + try + { + File f = new File( imageFileFolder ); + + if ( f.exists() ) + { + File files[] = f.listFiles(); + //List list = Arrays.asList(files); + Arrays.sort( files ); + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + String imageName = files[i].getName(); + + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName ); + Global global = new Global(); + global.copyImage( files[i], apacheImage ); + + ImageComponent newImg = new ImageComponent(); + newImg.setId( "img_comp" + imageName ); + //newImg.setUrl(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName); + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName ); + //System.out.println("IMAGE URL : " + newImg.getUrl()); + newImg.setRendered( true ); + gridImages.getChildren().add( newImg ); + + + Hyperlink ln = new Hyperlink(); + ln.setId( "img" + imageName ); + ln.setText( "Apagar" ); + //ln.setValue(imageName); + Class args[] = + { + javax.faces.event.ActionEvent.class + }; + ApplicationFactory factory = ( ApplicationFactory ) FactoryFinder.getFactory( FactoryFinder.APPLICATION_FACTORY ); + //mb = factory.getApplication().createMethodBinding( "#{EditarQuestionario.lnkGrupo_onClick}", args); + MethodBinding mbAction = ( MethodBinding ) factory.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkDelImageTmp_actionListener}", args ); + ln.setActionListener( mbAction ); + gridImages.getChildren().add( ln ); + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + public String butCancelar_action() + { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + getSessionBean1().setIeBug( true ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// String imageFileFolderTmp = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + + File ftmp = new File( imageFileFolderTmp ); + if ( ftmp.exists() ) + { + File files[] = ftmp.listFiles(); + + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + files[i].delete(); + } + } + + ftmp.delete(); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + return null; + } + + public String butGravar_action() + { + System.out.println( "BUT GRAVAR" ); + + AnaliseAcidente analise = getSessionBean1().getCurrentAnalise(); + if ( analise == null ) //new analise + { + if ( validateDataOcorrencia( analise ) ) + { + if ( validationDepartmentSectionOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = fillAcidentadoFields(); + if ( fieldsLenOk() ) + { + try + { + if ( !getSessionBean1().isGravado() ) + { + getSessionBean1().setGravado( true ); + AnaliseAcidente aa = create( a, ac ); + createImagesFolder( aa ); + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + aa.getAnalise_nr() + " foi gravada na sua área de trabalho." ); + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente foi gravada na sua área de trabalho." ); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na inserção da análise !" ); + getSessionBean1().setGravado( false ); + ErrorLogger.logException( ex ); + } + } + + } + else + { + getSessionBean1().setGravado( false ); + } + } + else + { + getSessionBean1().setGravado( false ); + } + } + else // edit analise + { + if ( validateDataOcorrencia( analise ) ) + { + if ( fieldsLenOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) + if ( estado == Global.ESTADO_RH1 ) + { + ac = fillAcidentadoFields(); + } + else if ( estado == Global.ESTADO_HS ) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); + recs = fillAnaliseRecomendacoesHs( a ); + } + else if ( estado == Global.ESTADO_RH2 ) + { + meds = fillAnaliseMedidasRh( a ); + a.setRh_fase4( getSessionBean1().getCurrentUser().getId() ); + } + try + { + if ( !getSessionBean1().isGravado() ) + { + getSessionBean1().setGravado( true ); + update( a, ac, recs, meds ); + //createImagesFolder(analiseId.toString()); + updateImagesFolder( a ); + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi gravada na sua área de trabalho." ); + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi gravada na sua área de trabalho." ); + } + + if ( estado != Global.ESTADO_ASSINATURA_RH ) + { + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + } + else + { + chkVerRespRh.setDisabled( true ); + // IMPRIMIR HERE + } + + + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na actualização da análise !" ); + getSessionBean1().setGravado( false ); + ErrorLogger.logException( ex ); + } + } + } + } + + + return null; + } + + public String butEnviar_action() + { + System.out.println( "BUT ENVIAR 1" ); + + //IE bugs + if ( getSessionBean1().isIeBug() ) + { + return null; + } + if ( getSessionBean1().isGravado() ) + { + getSessionBean1().setSubmetido( true ); + } + + if ( getSessionBean1().getCurrentAnalise() == null ) //new analise + { + if ( validationOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = fillAcidentadoFields(); + //int novo_estado = a.getEstado().intValue(); + a.setEstado( new Integer( Global.ESTADO_RH1 ) ); + try + { + if ( !getSessionBean1().isSubmetido() ) + { + getSessionBean1().setSubmetido( true ); + AnaliseAcidente aa = create( a, ac ); + createImagesFolder( aa ); + String errorMessage = ""; + errorMessage += sendMailToNextUser( a, new Integer( Global.ESTADO_RH1 ) ); + if ( "".equals( errorMessage.trim() ) ) + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + aa.getAnalise_nr() + " foi enviada para a fase seguinte." ); + } + else + { + getSessionBean1().setMsg( errorMessage ); + } + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente foi enviada para a fase seguinte." ); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro no envio da análise !" ); + getSessionBean1().setSubmetido( false ); + ErrorLogger.logException( ex ); + } + } + else + { + getSessionBean1().setSubmetido( false ); + } + } + else // edit analise + { + if ( validationOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) + if ( estado == Global.ESTADO_RH1 ) + { + ac = fillAcidentadoFields(); + } + else if ( estado == Global.ESTADO_HS ) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); + recs = fillAnaliseRecomendacoesHs( a ); + } + else if ( estado == Global.ESTADO_RH2 ) + { + meds = fillAnaliseMedidasRh( a ); + a.setRh_fase4( getSessionBean1().getCurrentUser().getId() ); + } + int novo_estado = a.getEstado().intValue(); + + if ( a.getCorrecao().matches( "y" ) ) + { + a.setCorrecao( "n" ); + a.setEstado( a.getEstado_antes_correcao() ); + novo_estado = a.getEstado_antes_correcao().intValue(); + a.setEstado_antes_correcao( null ); + a.setObservacoes_correcao( "" ); + //sendMailToNextUser(a, new Integer(novo_estado)); + } + else + { + if ( novo_estado < Global.ESTADO_CONCLUIDO ) + { + if ( !getSessionBean1().isSubmetido() ) + { + novo_estado++; + } + + // if(novo_estado == ESTADO_MEDICO) + // { + // novo_estado++; //skip medico + // } +// if(novo_estado == Global.ESTADO_ASSINATURA_SEG || novo_estado == Global.ESTADO_ASSINATURA_RH) +// { +// //a.setEstado_assinatura(new Integer(ESTADO_ASSINATURA_1)); +// notifyNextSignature(new Integer(novo_estado)); +// } + } + a.setEstado( new Integer( novo_estado ) ); + } + + try + { + if ( !getSessionBean1().isSubmetido() ) + { + getSessionBean1().setSubmetido( true ); + update( a, ac, recs, meds ); + //createImagesFolder(analiseId.toString()); + updateImagesFolder( a ); + String errorMessage = ""; + errorMessage += sendMailToNextUser( a, new Integer( novo_estado ) ); + //envia email para responsavel hierarquico ao passar da Consolidacao para a Verificacao + if ( a.getEstado().intValue() == Global.ESTADO_ASSINATURA_SEG ) + { + errorMessage += sendEmailResponsavelHierarquico( a ); + } + else if ( a.getEstado().intValue() == Global.ESTADO_CONCLUIDO ) + { + errorMessage += sendEmailFimProcesso( a ); + errorMessage += sendEmailToRhFase4( a ); + } + + if ( "".equals( errorMessage.trim() ) ) + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi enviada para a fase seguinte." ); + } + else + { + getSessionBean1().setMsg( errorMessage ); + } + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi enviada para a fase seguinte." ); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na actualização da análise !" ); + getSessionBean1().setSubmetido( false ); + ErrorLogger.logException( ex ); + } + } + else + { + getSessionBean1().setSubmetido( false ); + } + } + return null; + } + + private AnaliseAcidente create( AnaliseAcidente a, Acidentado ac ) throws Exception + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Integer acidentado_id = adp.createAcidentado( ac ); + a.setAcidentado_id( acidentado_id ); + AnaliseAcidente aa = adp.createAnalise( a ); + + return aa; + } + + private void update( AnaliseAcidente a, Acidentado ac, ArrayList recs, ArrayList meds ) throws Exception + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + if ( ac != null ) + { + adp.updateAcidentado( ac ); + } + if ( recs != null ) + { + //remove recs form analise + try + { + adp.deleteRecomendacoesByAnalise( a.getId() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + ListIterator iter = recs.listIterator(); + while ( iter.hasNext() ) + { + Recomendacao r = ( Recomendacao ) iter.next(); + adp.createRecomendacao( r ); + } + } + else if ( meds != null ) + { + //remove meds form analise + try + { + adp.deleteMedidasByAnalise( a.getId() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + ListIterator iter = meds.listIterator(); + while ( iter.hasNext() ) + { + Medida m = ( Medida ) iter.next(); + adp.createMedida( m ); + } + } + adp.updateAnalise( a ); + } + + private Acidentado fillAcidentadoFields() + { + Acidentado a = getSessionBean1().getAcidentado(); + a.setBilhete_identidade( "" ); + if ( txtBI.getText() != null ) + { + String bi = ( String ) txtBI.getText(); + if ( bi.trim().length() > 0 ) + { + a.setBilhete_identidade( bi ); + } + } + + a.setMorada( "" ); + if ( txtMorada.getText() != null ) + { + String morada = ( String ) txtMorada.getText(); + if ( morada.trim().length() > 0 ) + { + a.setMorada( morada ); + } + } + + a.setCod_postal( "" ); + String cod_postal = ""; + if ( txtCodPostal1.getText() != null ) + { + String cod_postal1 = ( String ) txtCodPostal1.getText(); + String cod_postal2 = ""; + if ( txtCodPostal2.getText() != null ) + { + cod_postal2 = ( String ) txtCodPostal2.getText(); + } + if ( cod_postal1.trim().length() > 0 ) + { + cod_postal = ( String ) txtCodPostal1.getText() + "-" + ( String ) txtCodPostal2.getText(); + a.setCod_postal( cod_postal ); + } + + } + + a.setLocalidade( "" ); + if ( txtLocalidade.getText() != null ) + { + String localidade = ( String ) txtLocalidade.getText(); + if ( localidade.trim().length() > 0 ) + { + a.setLocalidade( localidade ); + } + } + + a.setContacto_telefonico( "" ); + if ( txtContactoTelefonico.getText() != null ) + { + String contacto_telefonico = ( String ) txtContactoTelefonico.getText(); + if ( contacto_telefonico.trim().length() > 0 ) + { + a.setContacto_telefonico( contacto_telefonico ); + } + } + + + a.setTurno( "v" ); // null + if ( rbTurnoManha.getValue() != null ) + { + if ( rbTurnoManha.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "m" ); + } + } + if ( rbTurnoTarde.getValue() != null ) + { + if ( rbTurnoTarde.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "t" ); + } + } + if ( rbTurnoNoite.getValue() != null ) + { + if ( rbTurnoNoite.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "n" ); + } + } + if ( rbTurnoOutro.getValue() != null ) + { + if ( rbTurnoOutro.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "o" ); + } + } + + if ( txtNomeSuperior.getText() != null ) + { + a.setNome_superior_hierarquico( ( String ) txtNomeSuperior.getText() ); + } + + if ( txtEmailSuperior.getText() != null ) + { + a.setEmail_superior_hierarquico( ( String ) txtEmailSuperior.getText() ); + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date( today.getTime() ); + a.setData_email_superior_hierarquico( sqlToday ); + } + + return a; + } + + private AnaliseAcidente fillAnaliseFields() + { + int estado = 0; + AnaliseAcidente a = null; + //fill analise fields + if ( getSessionBean1().getCurrentAnalise() == null ) + { + a = new AnaliseAcidente(); + a.setEspecif1( "" ); + a.setEspecif2( "" ); + a.setEspecif3( "" ); + a.setEspecif4( "" ); + a.setRestricao_outras( "" ); + a.setTipo_lesao( "" ); + a.setMed_observ( "" ); + estado = Global.ESTADO_SEG; + a.setEstado( new Integer( estado ) ); + } + else + { + a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + } + + + //averiguacao posterior +// if(estado < Global.ESTADO_ASSINATURAS) + if ( estado <= Global.ESTADO_ASSINATURA_SEG ) + { + if ( getSessionBean1().getCurrentUser().getTipo().intValue() == 1 ) //seguranca + { + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + if ( txtAveriguacaoObs1.getText() != null ) + { + a.setAveriguacao_obs( ( String ) txtAveriguacaoObs1.getText() ); + } + } + } + } + + switch ( estado ) + { + case Global.ESTADO_SEG: + a = fillAnaliseFieldsSeg( a ); + break; + case Global.ESTADO_RH1: + //a = fillAnaliseFieldsSeg(a); + a = fillAnaliseFieldsRH1( a ); + break; + case Global.ESTADO_HS: + //a = fillAnaliseFieldsHS(a); + break; + case Global.ESTADO_RH2: + a = fillAnaliseFieldsMedico( a ); + //a = fillAnaliseFieldsRH2(a); + break; +// case Global.ESTADO_MEDICINA: +// a = fillAnaliseFieldsMedico(a); +// break; + case Global.ESTADO_CONSOLIDACAO: + a = fillAnaliseFieldsConsolidacao( a ); + break; +// case Global.ESTADO_ASSINATURAS: + case Global.ESTADO_ASSINATURA_SEG: + a = fillAnaliseAssinaturas( a ); + break; + case Global.ESTADO_ASSINATURA_RH: + a = fillAnaliseAssinaturas( a ); + break; + } + + if( chkParticipacao.isChecked() ) + { + a = fillAnaliseFieldsParticipacao( a ); + } + else + { + a = clearAnaliseFieldsParticipacao( a ); + } + + return a; + } + + private AnaliseAcidente fillAnaliseFieldsSeg( AnaliseAcidente a ) + { + if ( txtAveriguador.getText() != null ) + { + a.setAveriguador( ( String ) txtAveriguador.getText() ); + } + + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + //if(a.getData_acidente() == null) + //{ + // a.setData_acidente(sqlToday); + //} + //else + //{ + DateFormat formatador = new SimpleDateFormat( "yyyy-MM-dd" ); + +// java.util.Date ddate = ( java.util.Date ) calDataOcorrencia.getValue(); + Date ddate = getCalDataOcorrencia(); + try + { + String ddate_str = formatador.format( ddate ); + java.sql.Date ddate_sql = new java.sql.Date( formatador.parse( ddate_str ).getTime() ); + a.setData_acidente( ddate_sql ); + } + catch ( Exception ex ) + { + a.setData_acidente( null ); + } + //} + + if ( a.getData_inicio_processo() == null ) + { + a.setData_inicio_processo( sqlToday ); + } + + Integer hhInt = ( Integer ) drpHours.getSelected(); + Integer mmInt = ( Integer ) drpMinutes.getSelected(); + + if ( hhInt.intValue() == -1 || mmInt.intValue() == -1 ) + { + a.setHora_acidente( null ); + } + else + { +// String hh = drpHours.getSelected().toString(); +// String mm = drpMinutes.getSelected().toString(); + String hh = hhInt.toString(); + String mm = mmInt.toString(); + SimpleDateFormat formatter = new SimpleDateFormat( "HH:mm" ); + try + { + Time horaAcidente = new Time( formatter.parse( hh + ":" + mm ).getTime() ); + a.setHora_acidente( horaAcidente ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + + + if ( getSessionBean1().getCurrentAnalise() == null ) // new + { + a.setEmpresa_id( getSessionBean1().getCurrentUser().getEmpresa_id() ); + a.setEstabelecimento_id( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); + } + +// Integer medico_id = (Integer) drpMedicos.getSelected(); + Medico m = getSessionBean1().getMedico(); + if ( m != null ) + { + Integer medico_id = m.getId(); + if ( medico_id.intValue() > 0 ) + { + a.setMedico_id( medico_id ); + } + + } + + Integer horas_turno = null; + String horas_turno_str = ( String ) txtHorasTurno.getText(); + if ( horas_turno_str != null && ! "".equals( horas_turno_str.trim() ) ) + { + try + { + horas_turno = Integer.parseInt( horas_turno_str ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + } + a.setHoras_turno( horas_turno ); + + a.setDepartamento_id( ( Integer ) drpDepartamento.getSelected() ); + a.setSeccao_id( ( Integer ) drpSeccao.getSelected() ); + + try + { + if ( txtLocal.getText() != null ) + { + a.setLocal_trabalho( ( String ) txtLocal.getText() ); + } + else + { + a.setLocal_trabalho( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtTarefa.getText() != null ) + { + a.setTarefa( ( String ) txtTarefa.getText() ); + } + else + { + a.setTarefa( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtSubstancias.getText() != null ) + { + a.setSubstancias( ( String ) txtSubstancias.getText() ); + } + else + { + a.setSubstancias( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + +// try +// { +// if(txtSuperior.getText() != null) +// { +// a.setSuperior_hierarquico( (String) txtSuperior.getText() ); +// } +// else +// { +// a.setSuperior_hierarquico(""); +// } +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + + try + { + if ( txtCondicoes.getText() != null ) + { + a.setCondicoes( ( String ) txtCondicoes.getText() ); + } + else + { + a.setCondicoes( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtTestemunhas.getText() != null ) + { + a.setTestemunhas( ( String ) txtTestemunhas.getText() ); + } + else + { + a.setTestemunhas( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + +// try +// { +// if(txtCausas.getText() != null) +// { +// a.setCausas( (String) txtCausas.getText() ); +// } +// else +// { +// a.setCausas(""); +// } +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + + a.setCausas( ( Integer ) drpCausas.getSelected() ); + + try + { + if ( txtDescricao.getText() != null ) + { + a.setDescricao( ( String ) txtDescricao.getText() ); + } + else + { + a.setDescricao( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtConclusoes.getText() != null ) + { + a.setConclusoes( ( String ) txtConclusoes.getText() ); + } + else + { + a.setConclusoes( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtAccoes.getText() != null ) + { + a.setAccoes( ( String ) txtAccoes.getText() ); + } + else + { + a.setAccoes( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + a.setAveriguacao_posterior( "n" ); + if ( chkAveriguacaoPosterior.getSelected() != null ) + { + if ( chkAveriguacaoPosterior.getSelected().equals( new Boolean( true ) ) ) + { + a.setAveriguacao_posterior( "y" ); + } + } + + if ( txtAveriguacaoObs.getText() != null ) + { + a.setAveriguacao_obs( ( String ) txtAveriguacaoObs.getText() ); + } + return a; + } + + private AnaliseAcidente fillAnaliseFieldsRH1( AnaliseAcidente a ) + { + boolean booFormacaoSHST = false; + if ( rbFormacaoSHSTY.getSelected() != null ) + { + Boolean f = ( Boolean ) rbFormacaoSHSTY.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setFormacao_shst( "y" ); + booFormacaoSHST = true; + } + } + + if ( !booFormacaoSHST ) + { + if ( rbFormacaoSHSTN.getSelected() != null ) + { + Boolean f = ( Boolean ) rbFormacaoSHSTN.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setFormacao_shst( "n" ); + a.setFormacao_shst_nao_porque( "" ); + if ( txtFormacaoSHSTNWhy.getText() != null ) + { + String s = ( String ) txtFormacaoSHSTNWhy.getText(); + if ( s.trim().length() > 0 ) + { + a.setFormacao_shst_nao_porque( s ); + } + } + } + } + else + { + a.setFormacao_shst( "t" ); + } + } + + boolean booAcidentesColaborador = false; + a.setOutros_acidentes_com_colaborador( "n" ); + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + Boolean f = ( Boolean ) rbAcidentesColaboradorY.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setOutros_acidentes_com_colaborador( "y" ); + booAcidentesColaborador = true; + if ( txtNrAcidentesColaborador.getText() != null ) + { + String nr_str = ( String ) txtNrAcidentesColaborador.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_acidentes_com_colaborador( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + if ( txtNrRelatorioAcidentesColaborador1.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaborador1.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_colaborador1( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaborador2.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaborador2.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_colaborador2( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaborador3.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaborador3.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_colaborador3( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaborador4.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaborador4.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_colaborador4( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + } + } + + if ( !booAcidentesColaborador ) + { + if ( rbAcidentesColaboradorN.getSelected() != null ) + { + Boolean f = ( Boolean ) rbAcidentesColaboradorN.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setOutros_acidentes_com_colaborador( "n" ); + } + } + else + { + a.setOutros_acidentes_com_colaborador( "t" ); + } + } + + boolean booAcidentesColaboradores = false; + if ( rbAcidentesColaboradoresY.getSelected() != null ) + { + Boolean f = ( Boolean ) rbAcidentesColaboradoresY.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setAcidentes_outros_colaboradores( "y" ); + booAcidentesColaboradores = true; + if ( txtNrAcidentesColaboradores.getText() != null ) + { + String nr_str = ( String ) txtNrAcidentesColaboradores.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_acidentes_outros_colaboradores( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + if ( txtNrRelatorioAcidentesColaboradores1.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaboradores1.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_outros_colaboradores1( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaboradores2.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaboradores2.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_outros_colaboradores2( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaboradores3.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaboradores3.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_outros_colaboradores3( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaboradores4.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaboradores4.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_outros_colaboradores4( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + } + } + + if ( !booAcidentesColaboradores ) + { + if ( rbAcidentesColaboradoresN.getSelected() != null ) + { + Boolean f = ( Boolean ) rbAcidentesColaboradoresN.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setAcidentes_outros_colaboradores( "n" ); + } + } + else + { + a.setAcidentes_outros_colaboradores( "t" ); + } + } + + return a; + } + + private ArrayList fillAnaliseRecomendacoesHs( AnaliseAcidente a ) + { + System.out.println( "FILL RECOMENDACOES" ); + ArrayList list = new ArrayList(); + ListIterator iter = gridRecomendacoes.getChildren().listIterator(); + while ( iter.hasNext() ) + { + HtmlPanelGrid grd = ( HtmlPanelGrid ) iter.next(); + TextArea ta = ( TextArea ) grd.getChildren().get( 1 ); + if ( ta.getText() != null ) + { + String txt = ( String ) ta.getText(); + if ( txt.trim().length() > 0 ) + { + Recomendacao r = new Recomendacao(); + r.setAnalise_id( a.getId() ); + r.setRecomendacao( txt ); + list.add( r ); + } + } + } + return list; + } + + private ArrayList fillAnaliseMedidasRh( AnaliseAcidente a ) + { + ArrayList list = new ArrayList(); + ListIterator iter = gridMedidas.getChildren().listIterator(); + while ( iter.hasNext() ) + { + HtmlPanelGrid grd = ( HtmlPanelGrid ) iter.next(); + TextArea ta = ( TextArea ) grd.getChildren().get( 1 ); + if ( ta.getText() != null ) + { + String txt = ( String ) ta.getText(); + if ( txt.trim().length() > 0 ) + { + Medida m = new Medida(); + m.setAnalise_id( a.getId() ); + m.setMedida( txt ); + list.add( m ); + } + } + } + return list; + } + + private AnaliseAcidente fillAnaliseFieldsRH2( AnaliseAcidente a ) + { + return a; + } + + private AnaliseAcidente fillAnaliseFieldsMedico( AnaliseAcidente a ) + { + a.setLesao_cabeca( "n" ); + if ( chkCabeca.getSelected() != null ) + { + if ( chkCabeca.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_cabeca( "y" ); + } + } + + a.setLesao_pescoco( "n" ); + if ( chkPescoco.getSelected() != null ) + { + if ( chkPescoco.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_pescoco( "y" ); + } + } + + a.setLesao_tronco( "n" ); + if ( chkTronco.getSelected() != null ) + { + if ( chkTronco.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_tronco( "y" ); + } + } + + a.setEspecif1( "" ); + a.setEspecif2( "" ); + a.setEspecif3( "" ); + a.setEspecif4( "" ); + + a.setLesao_membro_sup_dir( "n" ); + if ( chkMembroSupDir.getSelected() != null ) + { + if ( chkMembroSupDir.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_membro_sup_dir( "y" ); + if ( txtEspecif1.getText() != null ) + { + a.setEspecif1( ( String ) txtEspecif1.getText() ); + } + } + } + + a.setLesao_membro_sup_esq( "n" ); + if ( chkMembroSupEsq.getSelected() != null ) + { + if ( chkMembroSupEsq.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_membro_sup_esq( "y" ); + if ( txtEspecif2.getText() != null ) + { + a.setEspecif2( ( String ) txtEspecif2.getText() ); + } + } + } + + a.setLesao_membro_inf_dir( "n" ); + if ( chkMembroInfDir.getSelected() != null ) + { + if ( chkMembroInfDir.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_membro_inf_dir( "y" ); + if ( txtEspecif3.getText() != null ) + { + a.setEspecif3( ( String ) txtEspecif3.getText() ); + } + } + } + + a.setLesao_membro_inf_esq( "n" ); + if ( chkMembroInfEsq.getSelected() != null ) + { + if ( chkMembroInfEsq.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_membro_inf_esq( "y" ); + if ( txtEspecif4.getText() != null ) + { + a.setEspecif4( ( String ) txtEspecif4.getText() ); + } + } + } + + a.setTipo_lesao( "" ); + if ( txtTipoLesao.getText() != null ) + { + a.setTipo_lesao( ( String ) txtTipoLesao.getText() ); + } + + a.setTipo_incapacidade( "v" ); + if ( rbIncapacidadeNone.getSelected() != null ) + { + if ( rbIncapacidadeNone.getSelected().equals( new Boolean( true ) ) ) + { + a.setTipo_incapacidade( "n" ); + } + } + if ( rbIncapacidadeTemp.getSelected() != null ) + { + if ( rbIncapacidadeTemp.getSelected().equals( new Boolean( true ) ) ) + { + a.setTipo_incapacidade( "t" ); + } + } + if ( rbIncapacidadePerm.getSelected() != null ) + { + if ( rbIncapacidadePerm.getSelected().equals( new Boolean( true ) ) ) + { + a.setTipo_incapacidade( "p" ); + } + } + + if ( txtCoefIncapacidade.getText() != null ) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + if ( coef_str != null && !"".equals( coef_str.trim() ) ) + { + try + { + int coef = Integer.parseInt( coef_str ); + a.setCoef_incapacidade( new Integer( coef ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + DateFormat formatador = new SimpleDateFormat( "yyyy-MM-dd" ); + +// java.util.Date ddate = ( java.util.Date ) calAvaliacaoIncap.getValue(); + Date ddate = getCalAvaliacaoIncap(); + try + { + String ddate_str = formatador.format( ddate ); + java.sql.Date ddate_sql = new java.sql.Date( formatador.parse( ddate_str ).getTime() ); + a.setData_aval_incapacidade( ddate_sql ); + } + catch ( Exception ex ) + { + a.setData_aval_incapacidade( null ); + } + +// ddate = ( java.util.Date ) calRevisaoIncap.getValue(); + ddate = getCalRevisaoIncap(); + + try + { + String ddate_str = formatador.format( ddate ); + java.sql.Date ddate_sql = new java.sql.Date( formatador.parse( ddate_str ).getTime() ); + a.setData_rev_incapacidade( ddate_sql ); + } + catch ( Exception ex ) + { + a.setData_rev_incapacidade( null ); + } + +// ddate = ( java.util.Date ) calPeridoIncapDe.getValue(); + ddate = getCalPeriodoIncapDe(); + try + { + String ddate_str = formatador.format( ddate ); + java.sql.Date ddate_sql = new java.sql.Date( formatador.parse( ddate_str ).getTime() ); + a.setPeriodo_incapacidade_de( ddate_sql ); + } + catch ( Exception ex ) + { + a.setPeriodo_incapacidade_de( null ); + } + +// ddate = ( java.util.Date ) calPeriodoIncapA.getValue(); + ddate = getCalPeriodoIncapA(); + try + { + String ddate_str = formatador.format( ddate ); + java.sql.Date ddate_sql = new java.sql.Date( formatador.parse( ddate_str ).getTime() ); + a.setPeriodo_incapacidade_a( ddate_sql ); + } + catch ( Exception ex ) + { + a.setPeriodo_incapacidade_a( null ); + } + return a; + } + + private AnaliseAcidente fillAnaliseFieldsConsolidacao( AnaliseAcidente a ) + { + String nome_resp_consolidacao = getSessionBean1().getCurrentUser().getNome(); + a.setNome_resp_consolidacao( nome_resp_consolidacao ); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + a.setData_consolidacao( sqlToday ); + a.setAss_consolidacao( "y" ); + return a; + } + + private AnaliseAcidente fillAnaliseFieldsParticipacao( AnaliseAcidente a ) + { + if( a.getParticipado() == null || !a.getParticipado() ) + { + a.setParticipado( Boolean.TRUE ); + String nome = getSessionBean1().getCurrentUser().getNome(); + a.setNomeResponsavelParticipacao( nome ); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + a.setDataParticipacao( sqlToday ); + } + return a; + } + + private AnaliseAcidente clearAnaliseFieldsParticipacao( AnaliseAcidente a ) + { + a.setParticipado( Boolean.FALSE ); + a.setNomeResponsavelParticipacao( null ); + a.setDataParticipacao( null ); + return a; + } + + private AnaliseAcidente fillAnaliseAssinaturas( AnaliseAcidente a ) + { +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + int estado = a.getEstado().intValue(); + switch ( estado ) + { + case Global.ESTADO_ASSINATURA_SEG: + //notifyNextSignature(new Integer(Global.ESTADO_ASSINATURA_RH)); + a.setData_assinatura_seg( sqlToday ); + a.setAss_resp_seg( "y" ); + a.setNome_resp_seg( getSessionBean1().getCurrentUser().getNome() ); + break; + case Global.ESTADO_ASSINATURA_RH: + a.setData_assinatura_rh( sqlToday ); + a.setAss_resp_rh( "y" ); + a.setNome_resp_rh( getSessionBean1().getCurrentUser().getNome() ); + break; + } + + return a; + } + + private boolean validateDataOcorrencia( AnaliseAcidente analise ) + { + Date d = analise == null ? getCalDataOcorrencia() : analise.getData_acidente(); + if ( d == null ) + { + getSessionBean1().setMsg( "Falta data da ocorrência!" ); + return false; + } + return true; + } + + private boolean validationDepartmentSectionOk() + { + Integer departmentId = ( Integer ) drpDepartamento.getSelected(); + if ( departmentId.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta departamento!" ); + return false; + } + Integer seccaoId = ( Integer ) drpSeccao.getSelected(); + if ( seccaoId.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta secção!" ); + return false; + } + return true; + } + + private boolean fieldsLenOk() + { + //System.out.println("VALIDATION GRAVAR OK"); +// AnalisesDataProvider adp = new AnalisesDataProvider(); + HashMap meta = new HashMap(); + HashMap meta_ac = new HashMap(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + meta = adp.getMetaData( "analises_acidentes" ); + meta_ac = adp.getMetaData( "acidentados" ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + meta = null; + meta_ac = null; + } + + if ( meta == null || meta_ac == null ) + { + getSessionBean1().setMsg( "Erro na aquisição da metadata!" ); + return false; + } + + int estado = 0; + if ( getSessionBean1().getCurrentAnalise() == null ) //null + { + estado = Global.ESTADO_SEG; + } + else + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + } + + if ( estado == Global.ESTADO_SEG ) + { + if ( txtAveriguador.getText() != null ) + { + String averiguador = txtAveriguador.getText().toString(); + int len = ( ( Integer ) meta.get( "averiguador" ) ).intValue(); + System.out.println( "Averiguador : " + len ); + if ( averiguador.length() > len ) + { + getSessionBean1().setMsg( "O campo Averiguador não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtLocal.getText() != null ) + { + String local = txtLocal.getText().toString(); + int len = ( ( Integer ) meta.get( "local_trabalho" ) ).intValue(); + System.out.println( "Local : " + len ); + if ( local.length() > len ) + { + getSessionBean1().setMsg( "O campo Local não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtTarefa.getText() != null ) + { + String tarefa = txtTarefa.getText().toString(); + int len = ( ( Integer ) meta.get( "tarefa" ) ).intValue(); + System.out.println( "Tarefa : " + len ); + if ( tarefa.length() > len ) + { + getSessionBean1().setMsg( "O campo Tarefa não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtSubstancias.getText() != null ) + { + String substancias = txtSubstancias.getText().toString(); + int len = ( ( Integer ) meta.get( "substancias" ) ).intValue(); + System.out.println( "Substancias : " + len ); + if ( substancias.length() > len ) + { + getSessionBean1().setMsg( "O campo Substancias não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtTestemunhas.getText() != null ) + { + String testemunhas = txtTestemunhas.getText().toString(); + int len = ( ( Integer ) meta.get( "testemunhas" ) ).intValue(); + System.out.println( "Testemunhas : " + len ); + if ( testemunhas.length() > len ) + { + getSessionBean1().setMsg( "O campo Testemunhas não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtDescricao.getText() != null ) + { + String descricao = txtDescricao.getText().toString(); + int len = ( ( Integer ) meta.get( "descricao" ) ).intValue(); + System.out.println( "Descricao : " + len ); + if ( descricao.length() > len ) + { + getSessionBean1().setMsg( "O campo Descrição não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtConclusoes.getText() != null ) + { + String conclusoes = txtConclusoes.getText().toString(); + int len = ( ( Integer ) meta.get( "conclusoes" ) ).intValue(); + System.out.println( "Conclusoes : " + len ); + if ( conclusoes.length() > len ) + { + getSessionBean1().setMsg( "O campo Conclusões não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtAccoes.getText() != null ) + { + String accoes = txtAccoes.getText().toString(); + int len = ( ( Integer ) meta.get( "accoes" ) ).intValue(); + System.out.println( "Accoes : " + len ); + if ( accoes.length() > len ) + { + getSessionBean1().setMsg( "O campo Accões não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtCondicoes.getText() != null ) + { + String condicoes = txtCondicoes.getText().toString(); + int len = ( ( Integer ) meta.get( "condicoes" ) ).intValue(); + System.out.println( "Condicoes : " + len ); + if ( condicoes.length() > len ) + { + getSessionBean1().setMsg( "O campo Condições não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtAveriguacaoObs.getText() != null ) + { + String averiguacao_obs = txtAveriguacaoObs.getText().toString(); + int len = ( ( Integer ) meta.get( "averiguacao_obs" ) ).intValue(); + System.out.println( "Observacoes : " + len ); + if ( averiguacao_obs.length() > len ) + { + getSessionBean1().setMsg( "O campo Observações não pode exceder " + len + " caracteres!" ); + return false; + } + } + } + else if ( estado == Global.ESTADO_RH1 ) + { + if ( txtBI.getText() != null ) + { + String bi = ( String ) txtBI.getText(); + int len = ( ( Integer ) meta_ac.get( "bilhete_identidade" ) ).intValue(); + System.out.println( "BI : " + len ); + if ( bi.length() > len ) + { + getSessionBean1().setMsg( "Campo Bilhete Identidade não pode exceder " + len + " caracteres!" ); + return false; + } +// try +// { +// int bi_nr = Integer.parseInt(bi); +// } +// catch(Exception ex) +// { +// getSessionBean1().setMsg("Nº do Bilhete de Identidade tem de ser numérico!"); +// return false; +// } + } + + if ( txtMorada.getText() != null ) + { + String morada = txtMorada.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "morada" ) ).intValue(); + System.out.println( "Morada : " + len ); + if ( morada.length() > len ) + { + getSessionBean1().setMsg( "O campo Morada não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtLocalidade.getText() != null ) + { + String localidade = txtLocalidade.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "localidade" ) ).intValue(); + System.out.println( "Localidade : " + len ); + if ( localidade.length() > len ) + { + getSessionBean1().setMsg( "O campo Localidade não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtContactoTelefonico.getText() != null ) + { + String contacto_telefonico = txtContactoTelefonico.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "contacto_telefonico" ) ).intValue(); + System.out.println( "Contacto Telefonico : " + len ); + if ( contacto_telefonico.length() > len ) + { + getSessionBean1().setMsg( "O campo Contacto Telefónico não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtNomeSuperior.getText() != null ) + { + String nome_superior = txtNomeSuperior.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "nome_superior_hierarquico" ) ).intValue(); + System.out.println( "Nome Superior : " + len ); + if ( nome_superior.length() > len ) + { + getSessionBean1().setMsg( "O campo Nome do Superior Hierárquico não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEmailSuperior.getText() != null ) + { + String email_superior = txtEmailSuperior.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "email_superior_hierarquico" ) ).intValue(); + System.out.println( "Email Superior : " + len ); + if ( email_superior.length() > len ) + { + getSessionBean1().setMsg( "O campo Email do Superior Hierárquico não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEmailSuperior.getText() != null ) + { + String email_superior = ( String ) txtEmailSuperior.getText(); + if ( email_superior.trim().length() > 0 ) + { + if ( !utils.Utils.isValidEmail( email_superior ) ) + { + getSessionBean1().setMsg( "Email do superior hierárquico inválido!" ); + return false; + } + } + } + + if ( txtFormacaoSHSTNWhy.getText() != null ) + { + String why = txtFormacaoSHSTNWhy.getText().toString(); + int len = ( ( Integer ) meta.get( "formacao_shst_nao_porque" ) ).intValue(); + System.out.println( "Porque Nao Teve Formacao : " + len ); + if ( why.length() > len ) + { + getSessionBean1().setMsg( "O campo Porquê o Colaborador Não Teve Formação não pode exceder " + len + " caracteres!" ); + return false; + } + } + } + else if ( estado == Global.ESTADO_HS ) + { + if ( !checkRecomendacoesLen() ) + { + return false; + } + } + else if ( estado == Global.ESTADO_RH2 ) + { + if ( !checkMedidasLen() ) + { + return false; + } + + if ( txtEspecif1.getText() != null ) + { + String especif = txtEspecif1.getText().toString(); + int len = ( ( Integer ) meta.get( "especif1" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEspecif2.getText() != null ) + { + String especif = txtEspecif2.getText().toString(); + int len = ( ( Integer ) meta.get( "especif2" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEspecif3.getText() != null ) + { + String especif = txtEspecif3.getText().toString(); + int len = ( ( Integer ) meta.get( "especif3" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEspecif4.getText() != null ) + { + String especif = txtEspecif4.getText().toString(); + int len = ( ( Integer ) meta.get( "especif4" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtTipoLesao.getText() != null ) + { + String tipo_lesao = txtTipoLesao.getText().toString(); + int len = ( ( Integer ) meta.get( "tipo_lesao" ) ).intValue(); + System.out.println( "Tipo Lesao : " + len ); + if ( tipo_lesao.length() > len ) + { + getSessionBean1().setMsg( "O campo Tipo Lesão não pode exceder " + len + " caracteres!" ); + return false; + } + } + } + + return true; + } + + private boolean validationOk() + { + + if ( getSessionBean1().isSubmetido() || getSessionBean1().isGravado() ) + { + return true; + } + if ( getSessionBean1().getAcidentado() == null ) + { + getSessionBean1().setMsg( "Não seleccionou trabalhador acidentado!" ); + return false; + } + + if ( !fieldsLenOk() ) + { + return false; + } + + AnaliseAcidente analise = getSessionBean1().getCurrentAnalise(); + int estado = 0; + int estado_assinatura = 0; + if ( analise == null ) + { + estado = Global.ESTADO_SEG; + } + else + { + estado = analise.getEstado().intValue(); + estado_assinatura = analise.getEstado_assinatura().intValue(); + } + + if ( estado == Global.ESTADO_SEG ) + { + if ( ! validateDataOcorrencia( analise ) ) + { + return false; + } + + if ( txtAveriguador.getText() == null ) + { + getSessionBean1().setMsg( "Falta averiguador!" ); + return false; + } + else + { + String averiguador = ( String ) txtAveriguador.getText(); + if ( averiguador.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta averiguador!" ); + return false; + } + + } + + if ( drpHours.getSelected() == null || drpMinutes.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta hora acidente!" ); + return false; + } + else + { + Integer h = ( Integer ) drpHours.getSelected(); + Integer m = ( Integer ) drpMinutes.getSelected(); + if ( h.intValue() == -1 || m.intValue() == -1 ) + { + getSessionBean1().setMsg( "Falta hora acidente!" ); + return false; + } + + } + + if ( txtHorasTurno.getText() != null ) + { + String horas_turno = txtHorasTurno.getText().toString(); + if ( horas_turno.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta nº horas trabalhadas no turno!" ); + return false; + } + else + { + try + { + int nr = Integer.parseInt( horas_turno ); + if ( nr > 9 ) + { + getSessionBean1().setMsg( "As horas turno devem ser entre 0 e 9!" ); + return false; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "As horas turno devem ser um valor numérico!" ); + return false; + } + } + } + else + { + getSessionBean1().setMsg( "Falta nº horas trabalhadas no turno!" ); + return false; + } + + + if ( drpDepartamento.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta departamento!" ); + return false; + } + else + { + Integer d = ( Integer ) drpDepartamento.getSelected(); + if ( d.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta departamento!" ); + return false; + } + } + + if ( drpSeccao.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta secção!" ); + return false; + } + else + { + Integer s = ( Integer ) drpSeccao.getSelected(); + if ( s.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta secção!" ); + return false; + } + } + + if ( txtLocal.getText() == null ) + { + getSessionBean1().setMsg( "Falta local específico!" ); + return false; + } + else + { + String local = ( String ) txtLocal.getText(); + if ( local.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta local específico!" ); + return false; + } + } + + if ( txtTarefa.getText() == null ) + { + getSessionBean1().setMsg( "Falta tarefa!" ); + return false; + } + else + { + String tarefa = ( String ) txtTarefa.getText(); + if ( tarefa.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta tarefa!" ); + return false; + } + } + + if ( txtSubstancias.getText() == null ) + { + getSessionBean1().setMsg( "Falta substâncias!" ); + return false; + } + else + { + String substancias = ( String ) txtSubstancias.getText(); + if ( substancias.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta substâncias!" ); + return false; + } + } + + if ( txtCondicoes.getText() == null ) + { + getSessionBean1().setMsg( "Falta condições!" ); + return false; + } + else + { + String condicoes = ( String ) txtCondicoes.getText(); + if ( condicoes.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta condições!" ); + return false; + } + } + + if ( txtTestemunhas.getText() == null ) + { + getSessionBean1().setMsg( "Falta testemunhas!" ); + return false; + } + else + { + String testemunhas = ( String ) txtTestemunhas.getText(); + if ( testemunhas.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta testemunhas!" ); + return false; + } + } + + if ( drpCausas.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta causa do acidente!" ); + return false; + } + else + { + Integer c = ( Integer ) drpCausas.getSelected(); + if ( c.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta causa do acidente!" ); + return false; + } + } + + if ( txtDescricao.getText() == null ) + { + getSessionBean1().setMsg( "Falta descrição do acidente!" ); + return false; + } + else + { + String descricao = ( String ) txtDescricao.getText(); + if ( descricao.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta descrição do acidente!" ); + return false; + } + } + + if ( txtConclusoes.getText() == null ) + { + getSessionBean1().setMsg( "Falta conclusões!" ); + return false; + } + else + { + String conclusoes = ( String ) txtConclusoes.getText(); + if ( conclusoes.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta conclusões!" ); + return false; + } + } + + if ( txtAccoes.getText() == null ) + { + getSessionBean1().setMsg( "Falta acções!" ); + return false; + } + else + { + String accoes = ( String ) txtAccoes.getText(); + if ( accoes.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta acções!" ); + return false; + } + } + + } + + + if ( estado == Global.ESTADO_RH1 ) + { + + if ( txtBI.getText() == null ) + { + getSessionBean1().setMsg( "Falta Nº Bilhete de Identidade!" ); + return false; + } + else + { + String bi = ( String ) txtBI.getText(); + if ( bi.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta Nº Bilhete de Identidade!" ); + return false; + } +// else +// { +// try +// { +// int bi_nr = Integer.parseInt(bi); +// } +// catch(Exception ex) +// { +// getSessionBean1().setMsg("Nº do Bilhete de Identidade tem de ser numérico!"); +// return false; +// } +// } + } + + if ( txtMorada.getText() == null ) + { + getSessionBean1().setMsg( "Falta morada!" ); + return false; + } + else + { + String morada = ( String ) txtMorada.getText(); + if ( morada.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta morada!" ); + return false; + } + } + + String cod_postal1 = ""; + String cod_postal2 = ""; + if ( txtCodPostal1.getText() == null || txtCodPostal2.getText() == null ) + { + getSessionBean1().setMsg( "Falta código postal!" ); + return false; + } + else + { + cod_postal1 = ( String ) txtCodPostal1.getText(); + cod_postal2 = ( String ) txtCodPostal2.getText(); + + if ( cod_postal1.trim().length() == 0 || cod_postal2.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta código postal!" ); + return false; + } + } + + if ( txtCodPostal1.getText() != null ) + { + if ( cod_postal1.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( cod_postal1 ); + if ( nr < 1000 || nr > 9999 ) + { + getSessionBean1().setMsg( "O formato do código postal é : '9999-999'" ); + return false; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O código postal tem de ser um valor numérico!" ); + return false; + } + } + } + + if ( txtCodPostal2.getText() != null ) + { + if ( cod_postal2.trim().length() > 0 ) + { + if ( cod_postal1.trim().length() == 0 ) + { + getSessionBean1().setMsg( "O formato do código postal é : '9999-999'" ); + return false; + } + try + { + int nr = Integer.parseInt( cod_postal2 ); + if ( cod_postal2.length() > 3 ) + { + getSessionBean1().setMsg( "O formato do código postal é : '9999-999'" ); + return false; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O código postal de ser um valor numérico!" ); + return false; + } + } + + if ( txtLocalidade.getText() == null ) + { + getSessionBean1().setMsg( "Falta localidade!" ); + return false; + } + else + { + String localidade = ( String ) txtLocalidade.getText(); + if ( localidade.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta localidade!" ); + return false; + } + } + + if ( txtContactoTelefonico.getText() == null ) + { + getSessionBean1().setMsg( "Falta contacto telefónico!" ); + return false; + } + else + { + String contacto_telefonico = ( String ) txtContactoTelefonico.getText(); + if ( contacto_telefonico.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta contacto telefónico!" ); + return false; + } + } + + if ( rbTurnoManha.getSelected() == null && rbTurnoTarde.getSelected() == null && rbTurnoNoite.getSelected() == null && rbTurnoOutro.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta turno de trabalho!" ); + return false; + } + + if ( txtNomeSuperior.getText() == null ) + { + getSessionBean1().setMsg( "Falta nome do superior hierárquico!" ); + return false; + } + else + { + String nome_superior = ( String ) txtNomeSuperior.getText(); + if ( nome_superior.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta nome do superior hierárquico!" ); + return false; + } + } + + if ( txtEmailSuperior.getText() != null ) + { + String email_superior = ( String ) txtEmailSuperior.getText(); + if ( email_superior.trim().length() > 0 ) + { + if ( !utils.Utils.isValidEmail( email_superior ) ) + { + getSessionBean1().setMsg( "Email do superior hierárquico inválido!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta email do superior hierárquico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta email do superior hierárquico!" ); + return false; + } + } + + if ( estado == Global.ESTADO_RH1 ) + { + + if ( rbFormacaoSHSTY.getSelected() == null && rbFormacaoSHSTN.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve formação em SHST!" ); + return false; + } + else + { + if ( rbFormacaoSHSTY.getSelected() != null ) + { + if ( rbFormacaoSHSTY.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbFormacaoSHSTN.getSelected() != null ) + { + if ( rbFormacaoSHSTN.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve formação em SHST!" ); + return false; + } + } + } + } + } + + if ( rbFormacaoSHSTN.getSelected() != null ) + { + if ( rbFormacaoSHSTN.getSelected().equals( new Boolean( true ) ) ) + { + if ( txtFormacaoSHSTNWhy.getText() == null ) + { + getSessionBean1().setMsg( "Falta indicar a razão porque o colaborador não teve formação em SHST!" ); + return false; + } + else + { + String why = ( String ) txtFormacaoSHSTNWhy.getText(); + if ( why.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta indicar a razão porque o colaborador não teve formação em SHST!" ); + return false; + } + } + } + + } + + if ( rbAcidentesColaboradorY.getSelected() == null && rbAcidentesColaboradorN.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve outras ocorrências, ou não!" ); + return false; + } + else + { + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + if ( rbAcidentesColaboradorY.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbAcidentesColaboradorN.getSelected() != null ) + { + if ( rbAcidentesColaboradorN.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve outras ocorrências, ou não!" ); + return false; + } + } + } + } + } + + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + + if ( rbAcidentesColaboradorY.getSelected().equals( new Boolean( true ) ) ) + { + if ( txtNrAcidentesColaborador.getText() != null ) + { + String nr_str = txtNrAcidentesColaborador.getText().toString(); + if ( nr_str.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( nr_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O º de acidentes do colaborador deve ser um valor numérico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências do colaborador!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências do colaborador!" ); + return false; + } + + if ( txtNrRelatorioAcidentesColaborador1.getText() == null && + txtNrRelatorioAcidentesColaborador2.getText() == null && + txtNrRelatorioAcidentesColaborador3.getText() == null && + txtNrRelatorioAcidentesColaborador1.getText() == null ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!" ); + return false; + } + else + { + String nr_relatorio1 = ""; + String nr_relatorio2 = ""; + String nr_relatorio3 = ""; + String nr_relatorio4 = ""; + if ( txtNrRelatorioAcidentesColaborador1.getText() != null ) + { + nr_relatorio1 = ( String ) txtNrRelatorioAcidentesColaborador1.getText(); + } + if ( txtNrRelatorioAcidentesColaborador2.getText() != null ) + { + nr_relatorio2 = ( String ) txtNrRelatorioAcidentesColaborador2.getText(); + } + if ( txtNrRelatorioAcidentesColaborador3.getText() != null ) + { + nr_relatorio3 = ( String ) txtNrRelatorioAcidentesColaborador3.getText(); + } + if ( txtNrRelatorioAcidentesColaborador4.getText() != null ) + { + nr_relatorio4 = ( String ) txtNrRelatorioAcidentesColaborador4.getText(); + } + + if ( nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!" ); + return false; + } + } + }// + + } + + + + if ( rbAcidentesColaboradoresY.getSelected() == null && rbAcidentesColaboradoresN.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar se houve outras ocorrências com outros colaboradores!" ); + return false; + } + else + { + if ( rbAcidentesColaboradoresY.getSelected() != null ) + { + if ( rbAcidentesColaboradoresY.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbAcidentesColaboradoresN.getSelected() != null ) + { + if ( rbAcidentesColaboradoresN.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar se houve outras ocorrências com outros colaboradores!" ); + return false; + } + } + } + } + } + + if ( rbAcidentesColaboradoresY.getSelected() != null ) + { + + if ( rbAcidentesColaboradoresY.getSelected().equals( new Boolean( true ) ) ) + { + if ( txtNrAcidentesColaboradores.getText() != null ) + { + String nr_str = txtNrAcidentesColaboradores.getText().toString(); + if ( nr_str.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( nr_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O º de acidentes dos colaboradores deve ser um valor numérico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências com outros colaboradores!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências com outros colaboradores!" ); + return false; + } + + if ( txtNrRelatorioAcidentesColaboradores1.getText() == null && + txtNrRelatorioAcidentesColaboradores2.getText() == null && + txtNrRelatorioAcidentesColaboradores3.getText() == null && + txtNrRelatorioAcidentesColaboradores1.getText() == null ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!" ); + return false; + } + else + { + String nr_relatorio1 = ""; + String nr_relatorio2 = ""; + String nr_relatorio3 = ""; + String nr_relatorio4 = ""; + if ( txtNrRelatorioAcidentesColaboradores1.getText() != null ) + { + nr_relatorio1 = ( String ) txtNrRelatorioAcidentesColaboradores1.getText(); + } + if ( txtNrRelatorioAcidentesColaboradores2.getText() != null ) + { + nr_relatorio2 = ( String ) txtNrRelatorioAcidentesColaboradores2.getText(); + } + if ( txtNrRelatorioAcidentesColaboradores3.getText() != null ) + { + nr_relatorio3 = ( String ) txtNrRelatorioAcidentesColaboradores3.getText(); + } + if ( txtNrRelatorioAcidentesColaboradores4.getText() != null ) + { + nr_relatorio4 = ( String ) txtNrRelatorioAcidentesColaboradores4.getText(); + } + + if ( nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!" ); + return false; + } + } + }// + + } + + } + } + else if ( estado == Global.ESTADO_HS ) //recomendacoes + { + if ( isRecomendacoesEmpty() ) + { + getSessionBean1().setMsg( "Tem de preencher pelo menos uma recomendação!" ); + return false; + } + } + else if ( estado == Global.ESTADO_RH2 ) //medidas + { + if ( isMedidasEmpty() ) + { + getSessionBean1().setMsg( "Tem de preencher pelo menos uma medida!" ); + return false; + } +// } +// //else if(estado == Global.ESTADO_MEDICINA) +// else if(estado == Global.ESTADO_RH2) +// { + if ( rbIncapacidadeNone.getSelected() == null && rbIncapacidadeTemp.getSelected() == null && rbIncapacidadePerm.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar o tipo de incapacidade!" ); + return false; + } + else + { + if ( rbIncapacidadeNone.getSelected() != null ) + { + if ( rbIncapacidadeNone.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbIncapacidadeTemp.getSelected() != null ) + { + if ( rbIncapacidadeTemp.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbIncapacidadePerm.getSelected() != null ) + { + if ( rbIncapacidadePerm.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar o tipo de incapacidade!" ); + return false; + } + } + } + } + } + } + } + + if ( txtCoefIncapacidade.getText() != null ) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + if ( coef_str.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( coef_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O coeficiente de incapacidade deve ser um valor numérico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta coeficiente de incapacidade!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta coeficiente de incapacidade!" ); + return false; + } + + if ( chkRestricaoCargas.getSelected() != null ) + { + Boolean b = ( Boolean ) chkRestricaoCargas.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + if ( txtKgs.getText() != null ) + { + String kgs_str = txtKgs.getText().toString(); + try + { + int nr = Integer.parseInt( kgs_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O valor de kgs deve ser um valor numérico!" ); + return false; + } + } + } + } + } + else if ( estado == Global.ESTADO_CONSOLIDACAO ) + { + if ( chkVerHs.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + else if ( chkVerHs.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + } + else if ( estado == Global.ESTADO_ASSINATURA_SEG ) + { + if ( chkVerRespSeg.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + else if ( chkVerRespSeg.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + } + else if ( estado == Global.ESTADO_ASSINATURA_RH ) + { + if ( chkVerRespRh.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + else if ( chkVerRespRh.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + } + + + return true; + } + + private void createImagesFolder( AnaliseAcidente a ) + //private void createImagesFolder(String folderName) + { + String folderName = a.getAnalise_nr().substring( 0, 2 ) + a.getAnalise_nr().substring( 3 ); + + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { +// String imageFileFolderTmp = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File f = new File( imageFileFolderTmp ); + if ( f.exists() ) + { + File folder = new File( imageFileFolder ); + folder.mkdir(); + + File files[] = f.listFiles(); + + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + // Move file to new directory + + boolean success = files[i].renameTo( new File( folder, files[i].getName() ) ); + } + } + + //delete tmp folder + f.delete(); + } + + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + //private void updateImagesFolder(String folderName) + private void updateImagesFolder( AnaliseAcidente a ) + { + String folderName = a.getAnalise_nr().substring( 0, 2 ) + a.getAnalise_nr().substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); + try + { + //checks if there are images in tmp +// String imageFileFolderTmp = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File ftmp = new File( imageFileFolderTmp ); + if ( ftmp.exists() ) + { + //if so, checks if there is already a image folder +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + File fimages = new File( imageFileFolder ); + if ( !fimages.exists() ) + { + // create image folder + fimages.mkdir(); + } + //copy images onto it + File files[] = ftmp.listFiles(); + + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + // Move file to new directory + boolean success = files[i].renameTo( new File( fimages, files[i].getName() ) ); + } + } + //delete tmp folder + ftmp.delete(); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void savePageState() + { + AnaliseAcidenteTrabalhoState a = new AnaliseAcidenteTrabalhoState(); + a.setHeader_nr( stHeaderNr.getText() ); + a.setHeader_date( stHeaderDate.getText() ); + if ( getSessionBean1().getCurrentAnalise() == null ) + { + a.setEstado( Global.ESTADO_SEG ); + } + else + { + a.setEstado( getSessionBean1().getCurrentAnalise().getEstado().intValue() ); + } + a.setEmpresa( txtEmpresa.getText() ); + a.setHoras_turno( txtHorasTurno.getText() ); + + a.setAveriguador( txtAveriguador.getText() ); + a.setData_nascimento( stDataNascimento.getText() ); + a.setData_admissao( stDataAdmissao1.getText() ); +// a.setData_acidente( calDataOcorrencia.getValue() ); + a.setData_acidente( getCalDataOcorrencia() ); + a.setBi( stBI.getText() ); + a.setMorada( stMorada.getText() ); + a.setContacto_telefonico( stContactoTelefonico.getText() ); + a.setFuncao( stFuncao1.getText() ); + a.setTurno( stTurno.getText() ); + + //////a.setData_acidente(stDataAcidente.getText()); +// a.setBi(txtBI.getText()); +// a.setMorada(txtMorada.getText()); +// a.setCod_postal1(txtCodPostal1.getText()); +// a.setCod_postal2(txtCodPostal2.getText()); +// a.setLocalidade(txtLocalidade.getText()); +// a.setContacto_telefonico(txtContactoTelefonico.getText()); +// a.setTurno("m"); +// if(rbTurnoManha.getSelected() != null) +// { +// Boolean b = (Boolean) rbTurnoManha.getSelected(); +// if(b.equals(new Boolean(true))) +// { +// a.setTurno("m"); +// } +// } +// +// if(rbTurnoTarde.getSelected() != null) +// { +// Boolean b = (Boolean) rbTurnoTarde.getSelected(); +// if(b.equals(new Boolean(true))) +// { +// a.setTurno("t"); +// } +// } +// +// if(rbTurnoNoite.getSelected() != null) +// { +// Boolean b = (Boolean) rbTurnoNoite.getSelected(); +// if(b.equals(new Boolean(true))) +// { +// a.setTurno("n"); +// } +// } + Integer hours = ( Integer ) drpHours.getSelected(); + Integer minutes = ( Integer ) drpMinutes.getSelected(); + a.setHours( hours ); + a.setMinutes( minutes ); + a.setLocal_trabalho( txtLocal.getText() ); + ////a.setSeccao(txtSeccao.getText()); + a.setSubstancias( txtSubstancias.getText() ); + a.setTarefa( txtTarefa.getText() ); + a.setEstabelecimento( txtEstabelecimento.getText() ); + a.setTrabalhador( txtTrabalhador.getText() ); + a.setData_nascimento( txtDataNascimento.getText() ); + +// a.setSuperior_hierarquico(txtSuperior.getText()); + a.setCondicoes( txtCondicoes.getText() ); + a.setTestemunhas( txtTestemunhas.getText() ); +// a.setCausas(txtCausas.getText()); + a.setCausas( drpCausas.getSelected() ); + a.setDescricao( txtDescricao.getText() ); + a.setConclusoes( txtConclusoes.getText() ); + a.setAccoes( txtAccoes.getText() ); + + a.setAveriguacao_posterior( "n" ); + if ( chkAveriguacaoPosterior.getSelected() != null ) + { + if ( chkAveriguacaoPosterior.getSelected().equals( new Boolean( true ) ) ) + { + a.setAveriguacao_posterior( "y" ); + } + } + a.setAveriguacao_obs( txtAveriguacaoObs.getText() ); + + if ( getSessionBean1().getCurrentAnalise() != null ) + { + if ( getSessionBean1().getCurrentAnalise().getEstado().intValue() == Global.ESTADO_RH1 ) + { + + a.setFormacao_shst( "n" ); + if ( rbFormacaoSHSTY.getSelected() != null ) + { + Boolean b = ( Boolean ) rbFormacaoSHSTY.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + a.setFormacao_shst( "y" ); + } + } + if ( rbFormacaoSHSTN.getSelected() != null ) + { + Boolean b = ( Boolean ) rbFormacaoSHSTN.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + a.setFormacao_shst( "n" ); + } + } + + a.setFormacao_shsht_n_why( txtFormacaoSHSTNWhy.getText() ); + + a.setAcidentes_colaborador( "n" ); + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + Boolean b = ( Boolean ) rbAcidentesColaboradorY.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + a.setAcidentes_colaborador( "y" ); + } + } + + if ( rbAcidentesColaboradorN.getSelected() != null ) + { + Boolean b = ( Boolean ) rbAcidentesColaboradorN.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + a.setAcidentes_colaborador( "n" ); + } + } + + a.setNr_acidentes_colaborador( txtNrAcidentesColaborador.getText() ); + a.setNr_relatorio_acidentes_colaborador_1( txtNrRelatorioAcidentesColaborador1.getText() ); + a.setNr_relatorio_acidentes_colaborador_2( txtNrRelatorioAcidentesColaborador2.getText() ); + a.setNr_relatorio_acidentes_colaborador_3( txtNrRelatorioAcidentesColaborador3.getText() ); + a.setNr_relatorio_acidentes_colaborador_4( txtNrRelatorioAcidentesColaborador4.getText() ); + + a.setAcidentes_colaboradores( "n" ); + if ( rbAcidentesColaboradoresY.getSelected() != null ) + { + Boolean b = ( Boolean ) rbAcidentesColaboradoresY.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + a.setAcidentes_colaboradores( "y" ); + } + } + + if ( rbAcidentesColaboradoresN.getSelected() != null ) + { + Boolean b = ( Boolean ) rbAcidentesColaboradoresN.getSelected(); + if ( b.equals( new Boolean( true ) ) ) + { + a.setAcidentes_colaboradores( "n" ); + } + } + + a.setNr_acidentes_colaboradores( txtNrAcidentesColaboradores.getText() ); + a.setNr_relatorio_acidentes_colaboradores_1( txtNrRelatorioAcidentesColaboradores1.getText() ); + a.setNr_relatorio_acidentes_colaboradores_2( txtNrRelatorioAcidentesColaboradores2.getText() ); + a.setNr_relatorio_acidentes_colaboradores_3( txtNrRelatorioAcidentesColaboradores3.getText() ); + a.setNr_relatorio_acidentes_colaboradores_4( txtNrRelatorioAcidentesColaboradores4.getText() ); + + } + + } + + getSessionBean1().setAnalise_acidente_trabalho_state( a ); + } + + private void restorePageState() + { + AnaliseAcidenteTrabalhoState a = getSessionBean1().getAnalise_acidente_trabalho_state(); + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butImprimir.setRendered( false ); + getSessionBean1().setIeBug( false ); //THIS MUST BE SEEN !!!!! + if ( a.getEstado() == Global.ESTADO_SEG ) + { + butEnviar.setText( "Enviar a RH" ); + gridSiprpView.setRendered( false ); + gridTrabalhadores.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSegView.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + } + else if ( a.getEstado() == Global.ESTADO_RH1 ) + { + butEnviar.setText( "Enviar a HS" ); + gridSiprpView.setRendered( false ); + gridAcidentadoView.setRendered( false ); + //gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + + if ( a.getFormacao_shst().matches( "y" ) ) + { + rbFormacaoSHSTY.setSelected( new Boolean( true ) ); + } + else + { + rbFormacaoSHSTN.setSelected( new Boolean( true ) ); + } + txtFormacaoSHSTNWhy.setText( a.getFormacao_shsht_n_why() ); + + if ( a.getAcidentes_colaborador().matches( "y" ) ) + { + rbAcidentesColaboradorY.setSelected( new Boolean( true ) ); + } + else + { + rbAcidentesColaboradorN.setSelected( new Boolean( true ) ); + } + + txtNrAcidentesColaborador.setText( a.getNr_acidentes_colaborador() ); + txtNrRelatorioAcidentesColaborador1.setText( a.getNr_relatorio_acidentes_colaborador_1() ); + txtNrRelatorioAcidentesColaborador2.setText( a.getNr_relatorio_acidentes_colaborador_2() ); + txtNrRelatorioAcidentesColaborador3.setText( a.getNr_relatorio_acidentes_colaborador_3() ); + txtNrRelatorioAcidentesColaborador4.setText( a.getNr_relatorio_acidentes_colaborador_4() ); + + + if ( a.getAcidentes_colaboradores().matches( "y" ) ) + { + rbAcidentesColaboradoresY.setSelected( new Boolean( true ) ); + } + else + { + rbAcidentesColaboradoresN.setSelected( new Boolean( true ) ); + } + + txtNrAcidentesColaboradores.setText( a.getNr_acidentes_colaboradores() ); + txtNrRelatorioAcidentesColaboradores1.setText( a.getNr_relatorio_acidentes_colaboradores_1() ); + txtNrRelatorioAcidentesColaboradores2.setText( a.getNr_relatorio_acidentes_colaboradores_2() ); + txtNrRelatorioAcidentesColaboradores3.setText( a.getNr_relatorio_acidentes_colaboradores_3() ); + txtNrRelatorioAcidentesColaboradores4.setText( a.getNr_relatorio_acidentes_colaboradores_4() ); + } + stHeaderNr.setText( a.getHeader_nr() ); + stHeaderDate.setText( a.getHeader_date() ); + txtEmpresa.setText( a.getEmpresa() ); + txtEstabelecimento.setText( a.getEstabelecimento() ); + txtTrabalhador.setText( a.getTrabalhador() ); + stNomeAcidentado.setText( a.getTrabalhador() ); + stDataNascimento.setText( a.getData_nascimento() ); + stDataAdmissao1.setText( a.getData_admissao() ); + //////stDataAcidente.setText(a.getData_acidente()); + txtAveriguador.setText( a.getAveriguador() ); + java.util.Date dtAcidente = ( java.util.Date ) a.getData_acidente(); +// calDataOcorrencia.setValue( dtAcidente ); + setCalDataOcorrencia( dtAcidente ); + + txtHorasTurno.setText( a.getHoras_turno() == null ? "" : a.getHoras_turno().toString() ); + + stBI.setText( a.getBi() ); + stMorada.setText( a.getMorada() ); + txtCodPostal1.setText( a.getCod_postal1() ); + txtCodPostal2.setText( a.getCod_postal2() ); + txtLocalidade.setText( a.getLocalidade() ); + stContactoTelefonico.setText( a.getContacto_telefonico() ); +// if(a.getTurno().matches("m")) +// { +// rbTurnoManha.setSelected(new Boolean(true)); +// } +// if(a.getTurno().matches("t")) +// { +// rbTurnoTarde.setSelected(new Boolean(true)); +// } +// if(a.getTurno().matches("n")) +// { +// rbTurnoNoite.setSelected(new Boolean(true)); +// } +// + stTurno.setText( a.getTurno() ); + stFuncao1.setText( a.getFuncao() ); + drpHours.setSelected( a.getHours() ); + drpMinutes.setSelected( a.getMinutes() ); + txtLocal.setText( a.getLocal_trabalho() ); + ////txtSeccao.setText(a.getSeccao()); + txtSubstancias.setText( a.getSubstancias() ); + txtTarefa.setText( a.getTarefa() ); + +// txtSuperior.setText(a.getSuperior_hierarquico()); + txtCondicoes.setText( a.getCondicoes() ); + txtTestemunhas.setText( a.getTestemunhas() ); +// txtCausas.setText(a.getCausas()); + drpCausas.setSelected( a.getCausas() ); + txtDescricao.setText( a.getDescricao() ); + txtConclusoes.setText( a.getConclusoes() ); + txtAccoes.setText( a.getAccoes() ); + chkAveriguacaoPosterior.setSelected( new Boolean( false ) ); + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + chkAveriguacaoPosterior.setSelected( new Boolean( true ) ); + } + txtAveriguacaoObs.setText( a.getAveriguacao_obs() ); + + if ( getSessionBean1().getCurrentAnalise() != null ) + { + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 0, 2 ) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 3 ); + //fill images + if ( gridImages.getChildren().size() > 0 ) + { + gridImages.getChildren().clear(); + } + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + + + File apacheAnaliseFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName ); + if ( apacheAnaliseFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheAnaliseFolder ); + System.out.println( "FILES DELETED" ); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + + + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File( imageFileFolder ); + + if ( f.exists() ) + { + File images[] = f.listFiles(); + Arrays.sort( images ); + for ( int i = 0; i < images.length; i++ ) + { + if ( images[i].isFile() ) + { + String imageName = images[i].getName(); + ImageComponent newImg = new ImageComponent(); + newImg.setId( "img_comp" + imageName ); + + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName + "/" + imageName ); + Global global = new Global(); + global.copyImage( images[i], apacheImage ); + + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/analises/" + folderName + "/" + imageName ); + + + //newImg.setUrl("/resources/images/" + folderName + "/" + imageName); + newImg.setRendered( true ); + gridImages.getChildren().add( newImg ); + + Hyperlink ln = new Hyperlink(); + ln.setId( "img" + imageName ); + ln.setText( "Apagar" ); + //ln.setValue(imageName); + Class args[] = + { + javax.faces.event.ActionEvent.class + }; + ApplicationFactory factory = ( ApplicationFactory ) FactoryFinder.getFactory( FactoryFinder.APPLICATION_FACTORY ); + //mb = factory.getApplication().createMethodBinding( "#{EditarQuestionario.lnkGrupo_onClick}", args); + MethodBinding mbAction = ( MethodBinding ) factory.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkDelImageReal_actionListener}", args ); + ln.setActionListener( mbAction ); + gridImages.getChildren().add( ln ); + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + } + + public String lnkLblTrabalhador_action() + { + // TODO: Replace with your code + gridTrabalhadores.setRendered( true ); + //fillTrabalhadoresTable(); + return null; + } + + public String lnkAnalisesAcidente_action() + { + getSessionBean1().setIeBug( true ); + ServletContext theApplicationsServletContext = ( ServletContext ) this.getExternalContext().getContext(); + + String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + + File ftmp = new File( imageFileFolderTmp ); + if ( ftmp.exists() ) + { + File files[] = ftmp.listFiles(); + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + files[i].delete(); + } + } + ftmp.delete(); + } + + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + return null; + } + + public String lnkMoreRec1_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + int seq = gridRecomendacoes.getChildren().size(); + seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grd" + seq ); + grd.setColumns( 3 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft90,gridColLeft5" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "st" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + TextArea ta = new TextArea(); + ta.setId( "ta" + seq ); + ta.setStyle( "height: 24px; width: 98%" ); + grd.getChildren().add( ta ); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId( "ln" + seq ); + ln.setWidth( 9 ); + ln.setHeight( 9 ); + ln.setImageURL( "/resources/plus_more.gif" ); + MethodBinding mbAction = this.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkMoreRec1_action}", null ); + ln.setAction( mbAction ); + + grd.getChildren().add( ln ); + + gridRecomendacoes.getChildren().add( grd ); + return null; + } + + public String lnkMoreMed_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + int seq = gridMedidas.getChildren().size(); + seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdMedida" + seq ); + grd.setColumns( 3 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft90,gridColLeft5" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "stNrMedida" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + TextArea ta = new TextArea(); + ta.setId( "taMedida" + seq ); + ta.setStyle( "height: 24px; width: 98%" ); + grd.getChildren().add( ta ); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId( "lnMedidaMore" + seq ); + ln.setWidth( 9 ); + ln.setHeight( 9 ); + ln.setImageURL( "/resources/plus_more.gif" ); + MethodBinding mbAction = this.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkMoreMed_action}", null ); + ln.setAction( mbAction ); + + grd.getChildren().add( ln ); + + gridMedidas.getChildren().add( grd ); + return null; + } + + public void lnkDelImageTmp_actionListener( ActionEvent ae ) + { + String imageFilePath = ""; + //UIComponent eventSrc = ae.getComponent(); + Hyperlink lnk = ( Hyperlink ) ae.getComponent(); + String imageName = ( String ) lnk.getId(); + imageName = imageName.substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// imageFilePath = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER); + imageFilePath = Global.IMAGE_FOLDER; + imageFilePath += "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName; + try + { + File f = new File( imageFilePath ); + if ( f.exists() ) + { + f.delete(); + ImageComponent img = ( ImageComponent ) gridImages.findComponent( "img_comp" + imageName ); + gridImages.getChildren().remove( img ); + gridImages.getChildren().remove( lnk ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + public void lnkDelImageReal_actionListener( ActionEvent ae ) + { + String imageFilePath = ""; + //UIComponent eventSrc = ae.getComponent(); + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 0, 2 ) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 3 ); + Hyperlink lnk = ( Hyperlink ) ae.getComponent(); + String imageName = ( String ) lnk.getId(); + imageName = imageName.substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// imageFilePath = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + imageFilePath = Global.IMAGE_FOLDER + "/" + folderName; + //imageFilePath = theApplicationsServletContext.getRealPath(IMAGE_URL); + imageFilePath += "/" + imageName; + try + { + File f = new File( imageFilePath ); + if ( f.exists() ) + { + f.delete(); + ImageComponent img = ( ImageComponent ) gridImages.findComponent( "img_comp" + imageName ); + gridImages.getChildren().remove( img ); + gridImages.getChildren().remove( lnk ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void initCalendars() + { +// java.util.GregorianCalendar gcalendar = new java.util.GregorianCalendar(); +// gcalendar.set( 1900, 1, 1 ); +// +// calAvaliacaoIncap.setMinDate( gcalendar.getTime() ); +// java.util.GregorianCalendar gcalendar1 = new java.util.GregorianCalendar(); +// gcalendar1.set( 2099, 1, 1 ); +// calAvaliacaoIncap.setMaxDate( gcalendar1.getTime() ); +// +// calRevisaoIncap.setMinDate( gcalendar.getTime() ); +// calRevisaoIncap.setMaxDate( gcalendar1.getTime() ); +// +// calPeridoIncapDe.setMinDate( gcalendar.getTime() ); +// calPeridoIncapDe.setMaxDate( gcalendar1.getTime() ); +// +// calPeriodoIncapA.setMinDate( gcalendar.getTime() ); +// calPeriodoIncapA.setMaxDate( gcalendar1.getTime() ); +// +// calDataOcorrencia.setMinDate( gcalendar.getTime() ); +// calDataOcorrencia.setMaxDate( gcalendar1.getTime() ); + } + + public void chkMembroSupDir_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + Boolean b = ( Boolean ) event.getNewValue(); + if ( b.equals( new Boolean( true ) ) ) + { + lblEspecif1.setRendered( true ); + txtEspecif1.setRendered( true ); + } + else + { + lblEspecif1.setRendered( false ); + txtEspecif1.setRendered( false ); + } + } + + public void chkMembroSupEsq_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + Boolean b = ( Boolean ) event.getNewValue(); + if ( b.equals( new Boolean( true ) ) ) + { + lblEspecif2.setRendered( true ); + txtEspecif2.setRendered( true ); + } + else + { + lblEspecif2.setRendered( false ); + txtEspecif2.setRendered( false ); + } + } + + public void chkMembroInfDir_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + Boolean b = ( Boolean ) event.getNewValue(); + if ( b.equals( new Boolean( true ) ) ) + { + lblEspecif3.setRendered( true ); + txtEspecif3.setRendered( true ); + } + else + { + lblEspecif3.setRendered( false ); + txtEspecif3.setRendered( false ); + } + } + + public void chkMembroInfEsq_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + Boolean b = ( Boolean ) event.getNewValue(); + if ( b.equals( new Boolean( true ) ) ) + { + lblEspecif4.setRendered( true ); + txtEspecif4.setRendered( true ); + } + else + { + lblEspecif4.setRendered( false ); + txtEspecif4.setRendered( false ); + } + } + +// public void drpTecnicos_processValueChange(ValueChangeEvent event) { +// // TODO: Replace with your code +// Integer selected = (Integer) drpTecnicos.getSelected(); +// if(selected.intValue() != 0) +// { +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); +// try +// { +// Utilizador u = udp.getUtilizador(selected); +// txtCap.setText(u.getCap()); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// +// } +// } +// public void drpMedicos_processValueChange(ValueChangeEvent event) { +// // TODO: Replace with your code +// Integer selected = (Integer) drpMedicos.getSelected(); +// if(selected.intValue() != 0) +// { +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); +// try +// { +// Utilizador u = udp.getUtilizador(selected); +// txtCedula.setText(u.getNumero_cedula()); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// } +// +// } + public void chkRestricaoCargas_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + Boolean b = ( Boolean ) event.getNewValue(); + if ( b.equals( new Boolean( true ) ) ) + { + rbKgs2.setRendered( true ); + rbKgs5.setRendered( true ); + rbKgs10.setRendered( true ); + rbKgs15.setRendered( true ); + rbKgsOutro.setRendered( true ); + txtKgs.setRendered( true ); + stKgs2.setRendered( true ); + stKgs5.setRendered( true ); + stKgs10.setRendered( true ); + stKgs15.setRendered( true ); + stKgsOutro.setRendered( true ); + stKg.setRendered( true ); + } + else + { + rbKgs2.setRendered( false ); + rbKgs5.setRendered( false ); + rbKgs10.setRendered( false ); + rbKgs15.setRendered( false ); + rbKgsOutro.setRendered( false ); + txtKgs.setRendered( false ); + stKgs2.setRendered( false ); + stKgs5.setRendered( false ); + stKgs10.setRendered( false ); + stKgs15.setRendered( false ); + stKgsOutro.setRendered( false ); + stKg.setRendered( false ); + } + } + +// private void notifyNextSignature(Integer estado) +// { +// Integer tipo = null; +// ArrayList list = null; +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); +// switch(estado.intValue()) +// { +// case Global.ESTADO_ASSINATURA_SEG: +// tipo = new Integer(Global.TIPO_UTILIZADOR_SEGURANCA); // seguranca +// try +// { +// list = udp.getUtilizadoresListByTipo(tipo); +// ListIterator iter = list.listIterator(); +// while(iter.hasNext()) +// { +// Utilizador u = (Utilizador) iter.next(); +// //sendEmail(u.getEmail(), getSessionBean1().getCurrentUser().getEmail()); +// } +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// +// break; +// +// case Global.ESTADO_ASSINATURA_RH: +// tipo = new Integer(Global.TIPO_UTILIZADOR_RH); // recursos humanos +// try +// { +// list = udp.getUtilizadoresListByTipo(tipo); +// ListIterator iter = list.listIterator(); +// while(iter.hasNext()) +// { +// Utilizador u = (Utilizador) iter.next(); +// //sendEmail(u.getEmail(), "", texto); +// } +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// break; +// } +// } + private String sendMailToNextUser( AnaliseAcidente a, Integer estado ) + { + String errorMessage = ""; + + Integer tipo = null; + String estabelecimentoNome = null; + try + { + estabelecimentoNome = AnalisesDataProvider.getInstance().getEstabelecimentoNome( a.getEstabelecimento_id() ); + } + catch( Exception ex ) + { + ex.printStackTrace(); + } + Acidentado ac = getSessionBean1().getAcidentado(); + if( estabelecimentoNome == null ) + { + if( ac == null ) + { + Integer acidentadoId = a.getAcidentado_id(); + try + { + ac = AnalisesDataProvider.getInstance().getAcidentado( acidentadoId ); + } + catch( Exception ex ) + { + ex.printStackTrace(); + } + } + if( ac != null ) + { + estabelecimentoNome = ac.getEstabelecimento_origem(); + } + else + { + estabelecimentoNome = ""; + } + } + String assunto = "Comunicacao de Analise de Acidentes de Trabalho" + ( ac != null ? " de " + ac.getNome() : "" ) + " - " + estabelecimentoNome; + + String texto_email = "

Esta é uma mensagem automática da equipa da SIPRP:

"; + texto_email += "

Recebeu um novo processo de análise de acidente de trabalho para tratar.

"; + texto_email += "

Por favor, aceda a www.siprp.pt, separador colaboradores em 'Acesso à Gestão de Análises de Acidentes de Trabalho' e prossiga com a gestão do processo " + a.getAnalise_nr() + ".

"; + + System.out.println( "Sending mail to next user." ); + + String responsavel_loja = "n"; + switch ( estado.intValue() ) + { + case Global.ESTADO_RH1: + tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); + break; + case Global.ESTADO_HS: + tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); + break; + case Global.ESTADO_RH2: + tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); + break; + case Global.ESTADO_CONSOLIDACAO: + tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); + break; + case Global.ESTADO_ASSINATURA_SEG: + tipo = new Integer( Global.TIPO_UTILIZADOR_SEGURANCA ); + responsavel_loja = "y"; + break; + case Global.ESTADO_ASSINATURA_RH: + tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); + responsavel_loja = "y"; + break; + case Global.ESTADO_FECHAR: + tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); + break; + } + +// if(estado.intValue() == Global.ESTADO_FECHAR) +// { +// tipo = new Integer(Global.TIPO_UTILIZADOR_HS); // hs +// } +// else +// { +// tipo = estado; +// } + +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + ArrayList list = udp.getUtilizadoresListByTipo( tipo, responsavel_loja, a.getEstabelecimento_id() ); + ListIterator iter = list.listIterator(); + while ( iter.hasNext() ) + { + Utilizador u = ( Utilizador ) iter.next(); + System.out.println( "USER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail() ); + try + { + //sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + sendEmailWithPdf( a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email ); + } + catch ( Exception ex1 ) + { + errorMessage += "Erro a enviar email para " + u.getEmail(); + boolean isValid = EmailValidator.getInstance().isValid( u.getEmail() ); + if ( !isValid ) + { + errorMessage += " : email inválido."; + } + errorMessage += "
"; + + ErrorLogger.logException( ex1 ); + System.out.println( "MAIL ERROR : " + ex1.getMessage() ); + } + + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + return errorMessage; + } + + private String sendEmailResponsavelHierarquico( AnaliseAcidente a ) + { + String errorMessage = ""; + + Acidentado ac = getSessionBean1().getAcidentado(); + if( ac == null ) + { + Integer acidentadoId = a.getAcidentado_id(); + try + { + ac = AnalisesDataProvider.getInstance().getAcidentado( acidentadoId ); + } + catch( Exception ex ) + { + ex.printStackTrace(); + } + } + String assunto = "Comunicacao de Analise de Acidentes de Trabalho de " + ac.getNome() + " - " + ( ac != null ? ac.getEstabelecimento_origem() : "" ); + + String data_acidente = ""; + try + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); + data_acidente = utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + + String texto_email = "

Caro(a) Colega,

"; + texto_email += "

Na sequência do acidente de trabalho do colaborador "; + texto_email += ac.getNome(); + texto_email += " no dia " + data_acidente; + texto_email += ", vimos pelo presente remeter cópia da análise do acidente " + a.getAnalise_nr() + " que se encontra em processo de averiguação pelo departamento de Segurança, Recursos Humanos e pela SIPRP para seu conhecimento. Caso tenha qualquer informação importante sobre o processo ou pretenda esclarecimentos adicionais contacte, por favor, a secção de Recursos Humanos.

"; + texto_email += "

Cumprimentos.

"; + try + { + sendEmailWithPdf( a, ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email ); + //sendEmail(ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email); + } + catch ( Exception ex ) + { + errorMessage += "Error a enviar email para " + ac.getEmail_superior_hierarquico(); + boolean isValid = EmailValidator.getInstance().isValid( ac.getEmail_superior_hierarquico() ); + if ( !isValid ) + { + errorMessage += " : email inválido."; + } + errorMessage += "
"; + ErrorLogger.logException( ex ); + } + + return errorMessage; + } + + private String sendEmailFimProcesso( AnaliseAcidente a ) + { + String errorMessage = ""; + + Acidentado ac = getSessionBean1().getAcidentado(); + String assunto = "Fecho do Processo de Analise de Acidente de Trabalho de " + ac.getNome() + " - " + ( ac != null ? ac.getEstabelecimento_origem() : "" ); + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + ArrayList responsavelRh_list = udp.getResponsavelRhList( a.getEstabelecimento_id() ); + if ( responsavelRh_list != null ) + { + ListIterator iter = responsavelRh_list.listIterator(); + while ( iter.hasNext() ) + { + Utilizador u = ( Utilizador ) iter.next(); + String texto_email = "

Exmo. (a) Senhor(a), " + u.getNome() + "

"; + texto_email += "

Informamos que o processo de análise de acidente de trabalho nº " + a.getAnalise_nr() + " se encontra finalizado, "; + texto_email += "pelo que solicitamos a sua impressão e arquivamento em pasta própria, juntamente com a participação de sinistro à seguradora.

"; + texto_email += "

Caso pretenda qualquer esclarecimento, contacte-nos, por favor, através de acidentes.auchan@siprp.pt ou pelo telefone 213 504 540.

"; + texto_email += "

Os melhores cumprimentos.

"; + texto_email += "

SIPRP

"; + try + { + //sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + sendEmailWithPdf( a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email ); + } + catch ( Exception ex ) + { + errorMessage += "Erro a enviar email para " + u.getEmail(); + boolean isValid = EmailValidator.getInstance().isValid( u.getEmail() ); + if ( !isValid ) + { + errorMessage += " : email inválido."; + } + errorMessage += "
"; + ErrorLogger.logException( ex ); + } + } + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + return errorMessage; + } + + private String sendEmailToRhFase4( AnaliseAcidente a ) + { + String errorMessage = ""; + + System.out.println( "SEND EMAIL TO RH FASE 4" ); + Acidentado ac = getSessionBean1().getAcidentado(); + //String assunto = "SIPRP ¯ Fecho do Processo de Análise de Acidente de Trabalho nº " + a.getAnalise_nr() + " ¯ Ficheiro para Impressão"; + String assunto = "SIPRP - Fecho do Processo de Analise de Acidente de Trabalho nr " + a.getAnalise_nr() + " - Ficheiro para Impressão" + " - " + ( ac != null ? ac.getEstabelecimento_origem() : "" ); + +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador urh = udp.getUtilizador( a.getRh_fase4() ); + String texto_email = "

Exmo. (a) Senhor(a),

"; + texto_email += "

Confirmamos que o processo de Análise de Acidente de Trabalho nº " + a.getAnalise_nr() + " se encontra encerrado após o preenchimento e validação de todos os intervenientes.

"; + texto_email += "

Sugerimos que imprima o ficheiro que enviamos em anexo e o junte à Participação de Sinistro à Seguradora para dar conhecimento ao Médico do Trabalho do seu estabelecimento. Após o seu conhecimento, aconselhamos que entregue uma cópia da Ficha de Análise de Acidente de Trabalho à equipa de Saúde Ocupacional, para que esta a arquive no processo clínico do trabalhador antes de juntar toda a documentação no processo individual do colaborador nos Recursos Humanos.

"; + texto_email += "

Agradecemos a sua colaboração e ficamos ao dispor para qualquer esclarecimento através dos telefones 213 504 544 (Catarina Leonardo) ou 213 504 542 (Sónia Campos).

"; + texto_email += "

Os melhores cumprimentos,

"; + texto_email += "

A equipa da SIPRP

"; + try + { + sendEmailWithPdf( a, urh.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email ); + } + catch ( Exception ex ) + { + errorMessage += "Erro a enviar email para " + urh.getEmail(); + boolean isValid = EmailValidator.getInstance().isValid( urh.getEmail() ); + if ( !isValid ) + { + errorMessage += " : email inválido."; + } + errorMessage += "
"; + ErrorLogger.logException( ex ); + System.out.println( "EMAIL FASE 4 ERROR : " + ex.getMessage() ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + return errorMessage; + } +// private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email) throws Exception +// { +// Properties props = new Properties(); +// //props.put("mail.transport.protocol", "smtp"); +// props.put("mail.smtp.host", "smtp.netcabo.pt"); +// props.put("mail.from", emailFrom); +// Session session1 = Session.getInstance(props); +// Message msg = new MimeMessage(session1); +// +//// try +//// { +// //Address Email_TO = new InternetAddress("myemail@bol.com.br"); +// msg.setFrom(new InternetAddress(emailFrom)); +// InternetAddress[] address = {new InternetAddress(emailTo)}; +// msg.setRecipients(Message.RecipientType.TO, address); +// msg.setSubject(assunto); +// msg.setSentDate(new Date()); +// Multipart multipart = new MimeMultipart(); +// BodyPart msgBodyPart = new MimeBodyPart(); +// String html; +// html=" "; +// html+=""; +// html+= texto_email; +// html+=""; +// msgBodyPart.setContent(html, "text/html"); +// multipart.addBodyPart(msgBodyPart); +// msg.setContent(multipart); +// Transport.send(msg); +// System.out.println("Email Enviado !!!! "); +//// } +//// catch (Exception ex) +//// { +//// System.out.println("MAIL ERROR : " + ex.getMessage()); +//// ErrorLogger.logException( ex ); +//// } +// +// } + private final String SMTP_HOST = "mail.evolute.pt"; + private final int SMTP_PORT = 587; + private final String mail_username = "acidentes.auchan@siprp.pt"; + private final String mail_password = "EghRzS2l"; + private final String mail_bcc = "acidentes.auchan@siprp.pt"; + private final String mail_bcc2 = "siprp.aat@evolute.pt"; + +// private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email) +// throws Exception +// { +// Properties props = new Properties(); +// //props.put("mail.transport.protocol", "smtp"); +// props.put("mail.smtp.host", SMTP_HOST ); +// props.put("mail.from", emailFrom); +// props.put("mail.smtp.auth", "true"); +// props.put("mail.smtp.user", mail_username ); +// props.put("mail.smtp.password", mail_password ); +// +// Session session = Session.getDefaultInstance( props ); +// +// Message msg = new MimeMessage(session); +// msg.setFrom(new InternetAddress(emailFrom)); +// InternetAddress[] address = {new InternetAddress(emailTo)}; +// msg.setRecipients(Message.RecipientType.TO, address); +// +// InternetAddress[] addressBCC = new InternetAddress[ 2 ]; +// addressBCC[ 0 ] = new InternetAddress( mail_bcc ); +// addressBCC[ 1 ] = new InternetAddress( mail_bcc2 ); +// msg.setRecipients( Message.RecipientType.BCC, addressBCC ); +// +// ((MimeMessage)msg).setSubject(assunto, "UTF-8"); +// msg.setSentDate(new Date()); +// Multipart multipart = new MimeMultipart(); +// BodyPart msgBodyPart = new MimeBodyPart(); +// String html; +// html=" "; +// html+=""; +// html+= texto_email; +// html+=""; +// msgBodyPart.setContent(html, "text/html"); +// multipart.addBodyPart(msgBodyPart); +// msg.setContent(multipart); +// +// Transport t; +// t = session.getTransport( "smtp" ); +// +// t.connect( SMTP_HOST, SMTP_PORT, mail_username, mail_password ); +// t.sendMessage( msg, msg.getAllRecipients() ); +// +// t.close(); +// System.out.println("Email Enviado !!!!" ); +// } + + private void sendEmailWithPdf( AnaliseAcidente a, String emailTo, String emailFrom, String assunto, String texto_email ) + throws Exception + { + boolean isDebug = SIPRPPropertiesLoader.getInstance().findProperty( "debug", false ); + System.out.println( "\nAnaliseAcidenteTrabalho . sendEmailWithPdf() : debug ? " + isDebug ); + if( assunto != null ) + { + assunto = StringPlainer.convertString( assunto, true, false ); + } + + if ( ! isDebug ) + { + System.out.println( "\temailTo : " + emailTo ); + System.out.println( "\temailFrom : " + emailFrom ); + System.out.println( "\tAnaliseAcidente : " + ( a == null ? "null" : a.getId() ) ); + System.out.println( "\t\tTecnicoSaudeID : " + ( a == null ? "a null" : "" + a.getTecnico_saude_id() ) ); + System.out.println( "\t\tMedicoID : " + ( a == null ? "a null" : "" + a.getMedico_id() ) ); + + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador ut = udp.getUtilizador( a.getTecnico_saude_id() ); + Utilizador um = udp.getUtilizador( a.getMedico_id() ); + // AnalisesDataProvider adp = new AnalisesDataProvider(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Acidentado ac = adp.getAcidentado( a.getAcidentado_id() ); + Estabelecimento e = new Estabelecimento(); + e.setId( a.getEstabelecimento_id() ); + e.setNome( adp.getEstabelecimentoNome( a.getEstabelecimento_id() ) ); + Seccao s = adp.getSeccao( a.getSeccao_id() ); + Causa c = adp.getCausa( a.getCausas() ); + ArrayList recList = adp.getRecomendacoesByAnalise( a.getId() ); + Recomendacao[] recArray = new Recomendacao[ recList.size() ]; + ListIterator iter = recList.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + Recomendacao rec = ( Recomendacao ) iter.next(); + recArray[i] = rec; + i++; + } + //Recomendacao recArray[] = (Recomendacao)recList.toArray(); + ArrayList medList = adp.getMedidasByAnalise( a.getId() ); + //Medida medArray[] = (Medida)medList.toArray(); + Medida[] medArray = new Medida[ medList.size() ]; + iter = medList.listIterator(); + i = 0; + while ( iter.hasNext() ) + { + Medida med = ( Medida ) iter.next(); + medArray[i] = med; + i++; + } + + PdfGenerator pdf = new PdfGenerator( Global.IMAGE_FOLDER, e, ut, um, a, ac, s, recArray, medArray, c ); + + ByteArrayDataSource ds = new ByteArrayDataSource( pdf.generatePdf(), "application/pdf" ); + Properties props = new Properties(); + //props.put("mail.transport.protocol", "smtp"); + props.put( "mail.smtp.host", SMTP_HOST ); + props.put( "mail.from", emailFrom ); + props.put( "mail.smtp.auth", "true" ); + props.put( "mail.smtp.user", mail_username ); + props.put( "mail.smtp.password", mail_password ); + + // Authenticator auth = new SMTPAuthenticator(); + // Session session = Session.getDefaultInstance(props, auth); + Session session = Session.getDefaultInstance( props ); + + Message msg = new MimeMessage( session ); + msg.setFrom( new InternetAddress( emailFrom ) ); + InternetAddress[] address = { new InternetAddress( emailTo ) }; + msg.setRecipients( Message.RecipientType.TO, address ); + + InternetAddress[] addressBCC = new InternetAddress[ 2 ]; + addressBCC[ 0 ] = new InternetAddress( mail_bcc ); + addressBCC[ 1 ] = new InternetAddress( mail_bcc2 ); + msg.setRecipients( Message.RecipientType.BCC, addressBCC ); + + ( ( MimeMessage ) msg ).setSubject( assunto, "UTF-8" ); + msg.setSentDate( new Date() ); + Multipart multipart = new MimeMultipart(); + BodyPart msgBodyPart = new MimeBodyPart(); + String html; + html = " "; + html += ""; + html += "
" + texto_email + "
"; + html += ""; + msgBodyPart.setContent( html, "text/html" ); + multipart.addBodyPart( msgBodyPart ); + + MimeBodyPart pdfPart = new MimeBodyPart(); + //pdfPart.setContent(ds,"application/pdf"); + pdfPart.setDataHandler( new DataHandler( ds ) ); + pdfPart.setHeader( "Content-Transfer-Encoding", "base64" ); + pdfPart.setHeader( "Content-Disposition", "attachment" ); + String pdfname = "Analise" + a.getAnalise_nr(); + pdfPart.setFileName( pdfname ); + multipart.addBodyPart( pdfPart, 1 ); + + msg.setContent( multipart ); + + Transport t; + t = session.getTransport( "smtp" ); + + t.connect( SMTP_HOST, SMTP_PORT, mail_username, mail_password ); + t.sendMessage( msg, msg.getAllRecipients() ); + + t.close(); + System.out.println( "Email Pdf Enviado !!!! " + emailTo ); + } + } + + public String butImprimir_action() + { +// AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); +// if(a.getEstado().intValue() == ESTADO_IMPRESSAO) +// { +// Pdf pdf = new Pdf(); +// pdf.generatePdf(a); +// } + + if ( validationOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) +// if(estado == Global.ESTADO_RH1) +// { +// ac = fillAcidentadoFields(); +// } +// else if(estado == Global.ESTADO_HS) +// { +// a.setTecnico_saude_id(getSessionBean1().getCurrentUser().getId()); +// recs = fillAnaliseRecomendacoesHs(a); +// } +// else if(estado == Global.ESTADO_RH2) +// { +// meds = fillAnaliseMedidasRh(a); +// } +// int novo_estado = a.getEstado().intValue(); +// +// if(a.getCorrecao().matches("y")) +// { +// a.setCorrecao("n"); +// a.setEstado(a.getEstado_antes_correcao()); +// a.setEstado_antes_correcao(null); +// a.setObservacoes_correcao(""); +// } +// else +// { +// if(novo_estado < Global.ESTADO_CONCLUIDO) +// { +// novo_estado++; +// // if(novo_estado == ESTADO_MEDICO) +// // { +// // novo_estado++; //skip medico +// // } +// if(novo_estado == Global.ESTADO_ASSINATURAS) +// { +// a.setEstado_assinatura(new Integer(ESTADO_ASSINATURA_1)); +// notifyNextSignature(new Integer(ESTADO_ASSINATURA_1)); +// } +// } +// a.setEstado(new Integer(novo_estado)); +// } + + try + { + update( a, ac, recs, meds ); + chkVerRespRh.setDisabled( true ); + //createImagesFolder(analiseId.toString()); +// updateImagesFolder(a.getId().toString()); +// sendMailToNextUser(new Integer(novo_estado)); +// String navFrom = getSessionBean1().getNavFrom(); +// if(navFrom.matches("FormSeguranca")) +// { +// return "form_seguranca"; +// } +// else if(navFrom.matches("FormRH")) +// { +// return "form_rh"; +// } +// else if(navFrom.matches("FormHS")) +// { +// return "form_hs"; +// } +// else if(navFrom.matches("FormMedico")) +// { +// return "form_medico"; +// } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na actualização da análise !" ); + ErrorLogger.logException( ex ); + } + } + + return null; + } + +// private void buildPdf(AnaliseAcidente a) +// { +// +// // create pdf folder +// String pdf_folder = createPdfFolder(a.getId().toString()); +// if(pdf_folder != null) +// { +// hidDisableEnviar.setValue(a.getId().toString()); +// Pdf pdf = new Pdf(); +// pdf.generatePdf(pdf_folder, a); +// } +// } +// private String createPdfFolder(String folderName) +// { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFileFolder = theApplicationsServletContext.getRealPath(PDFS_FOLDER_URL + "/" + folderName); +// try +// { +// //String imageFileFolderTmp = theApplicationsServletContext.getRealPath(IMAGE_URL + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); +// File folder = new File(pdfFileFolder); +// if(! folder.exists()) +// { +// folder.mkdir(); +// } +// else +// { +// //remove all existing files +// File files[] = folder.listFiles(); +// +// for(int i=0;i 0 ) + { + booNrOk = true; + } + else + { + nr_mecano = null; + } + } + + if ( txtNomeTrabalhador.getText() != null ) + { + nome = ( String ) txtNomeTrabalhador.getText(); + if ( nome.trim().length() > 0 ) + { + booNomeOk = true; + } + else + { + nome = null; + } + } + + if ( !booNrOk && !booNomeOk ) + { + getSessionBean1().setMsg( "Tem de preencher Numero Mecanográfico ou Nome" ); + return null; + } + +// AnalisesDataProvider adp = new AnalisesDataProvider(); + + Trabalhador t = null; + if ( nome != null ) + { + nome = utils.Utils.textToUnicode( nome.toUpperCase() ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.searchTrabalhador( getSessionBean1().getCurrentUser().getEmpresa_id(), getSessionBean1().getCurrentUser().getEstabelecimento_id(), nr_mecano, nome ); + if ( list.size() == 1 ) + { + t = ( Trabalhador ) list.get( 0 ); + txtTrabalhador.setText( t.getNome() ); + txtNomeAcidentado.setText( t.getNome() ); + txtDataNascimento.setText( t.getData_nascimento() ); + Acidentado a = new Acidentado(); + a.setTrabalhador_id( t.getId() ); + a.setData_nascimento( t.getData_nascimento() ); + a.setNome( t.getNome() ); + a.setFuncao( utils.Utils.unicodeToHTML( t.getFuncao() ) ); + a.setData_admissao( t.getData_admissao() ); + a.setNumero_mecanografico( t.getNumero_mecanografico() ); + getSessionBean1().setAcidentado( a ); + gridSiprp.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + } + else + { + tblTrabalhadores.setRendered( true ); + getSessionBean1().getTrabalhadoresListDataProvider().setList( list ); + } + if ( getSessionBean1().getCurrentAnalise() != null ) // new analise) + { + gridTrabalhadores.setRendered( false ); + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Trabalhador inexistente ! " ); + tblTrabalhadores.setRendered( false ); + txtTrabalhador.setText( "" ); + gridSiprp.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + ErrorLogger.logException( ex ); + } + + return null; + } + + public String lnkPOR_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado( t ); + gridSiprp.setRendered( true ); + gridAcidentadoView.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + fillAcidentadoView( ac ); + return null; + } + + public String lnkNomeTrabalhador_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado( t ); + gridSiprp.setRendered( true ); + gridAcidentadoView.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + fillAcidentadoView( ac ); + return null; + } + + public String lnkEstabelecimentoTrabalhador_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado( t ); + gridSiprp.setRendered( true ); + gridAcidentadoView.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + fillAcidentadoView( ac ); + return null; + } + + private Trabalhador getTrabalhadorRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + TrabalhadoresListDataProvider provider = ( TrabalhadoresListDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + Trabalhador t = ( Trabalhador ) list.get( k ); + return t; + } + + private Acidentado setAcidentado( Trabalhador t ) + { + txtTrabalhador.setText( t.getNome() ); + txtNomeAcidentado.setText( t.getNome() ); + txtDataNascimento.setText( t.getData_nascimento() ); + Acidentado a = new Acidentado(); + a.setTrabalhador_id( t.getId() ); + a.setData_nascimento( t.getData_nascimento() ); + a.setNome( t.getNome() ); + a.setMorada( "" ); + a.setFuncao( utils.Utils.unicodeToHTML( t.getFuncao() ) ); + a.setData_admissao( t.getData_admissao() ); + a.setNumero_mecanografico( t.getNumero_mecanografico() ); + a.setEstabelecimento_origem( t.getEstabelecimento() ); + getSessionBean1().setAcidentado( a ); + return a; + } + + public String butCorrecao_action() + { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + getSessionBean1().setIeBug( true ); + getSessionBean1().setCorrecao( null ); + return "correcao"; + } + + public String lnkNewUser_action() + { + // TODO: Replace with your code + + return null; + } + + private boolean isRecomendacoesEmpty() + { + boolean res = true; + + for ( int i = 0; i < gridRecomendacoes.getChildren().size(); i++ ) + { + HtmlPanelGrid g = ( HtmlPanelGrid ) gridRecomendacoes.getChildren().get( i ); + TextArea t = ( TextArea ) g.getChildren().get( 1 ); + if ( t.getText() != null ) + { + String txt = ( String ) t.getText(); + if ( txt.trim().length() > 0 ) + { + res = false; + break; + } + } + } + + return res; + } + + private boolean isMedidasEmpty() + { + boolean res = true; + + for ( int i = 0; i < gridMedidas.getChildren().size(); i++ ) + { + HtmlPanelGrid g = ( HtmlPanelGrid ) gridMedidas.getChildren().get( i ); + TextArea t = ( TextArea ) g.getChildren().get( 1 ); + if ( t.getText() != null ) + { + String txt = ( String ) t.getText(); + if ( txt.trim().length() > 0 ) + { + res = false; + break; + } + } + } + + return res; + } + + public void drpDepartamento_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + + Integer departamento_id = ( Integer ) drpDepartamento.getSelected(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + if ( departamento_id.intValue() == 0 ) + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( null ) ); + } + else + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( departamento_id ) ); + } + + drpSeccao.setSelected( new Integer( 0 ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + hidAnchor.setValue( "dados" ); + } + + public String lnkAjuda_action() + { + // TODO: Replace with your code +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + getSessionBean1().setIeBug( true ); + return null; + } + + private boolean checkRecomendacoesLen() + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + HashMap meta = new HashMap(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + meta = adp.getMetaData( "recomendacoes" ); + ArrayList list = new ArrayList(); + ListIterator iter = gridRecomendacoes.getChildren().listIterator(); + while ( iter.hasNext() ) + { + HtmlPanelGrid grd = ( HtmlPanelGrid ) iter.next(); + TextArea ta = ( TextArea ) grd.getChildren().get( 1 ); + if ( ta.getText() != null ) + { + String txt = ( String ) ta.getText(); + if ( txt.length() > 0 ) + { + int len = ( ( Integer ) meta.get( "recomendacao" ) ).intValue(); + if ( txt.length() > len ) + { + getSessionBean1().setMsg( "Os Campos Recomendações não podem exceder " + len + " caracteres!" ); + return false; + } + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + return false; + } + return true; + } + + private boolean checkMedidasLen() + { + HashMap meta = new HashMap(); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + meta = adp.getMetaData( "medidas" ); + ArrayList list = new ArrayList(); + ListIterator iter = gridMedidas.getChildren().listIterator(); + while ( iter.hasNext() ) + { + HtmlPanelGrid grd = ( HtmlPanelGrid ) iter.next(); + TextArea ta = ( TextArea ) grd.getChildren().get( 1 ); + if ( ta.getText() != null ) + { + String txt = ( String ) ta.getText(); + if ( txt.length() > 0 ) + { + int len = ( ( Integer ) meta.get( "medida" ) ).intValue(); + if ( txt.length() > len ) + { + getSessionBean1().setMsg( "Os Campos Medidas não podem exceder " + len + " caracteres!" ); + return false; + } + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + return false; + } + + return true; + } + + public String lnkPlanosActuacao_action() + { + // TODO: Replace with your code + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ApplicationBean1.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ApplicationBean1.java new file mode 100644 index 00000000..36df6ef2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ApplicationBean1.java @@ -0,0 +1,100 @@ +/* + * ApplicationBean1.java + * + * Created on September 18, 2007, 3:14 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractApplicationBean; +import javax.faces.FacesException; + +/** + *

Application scope data bean for your application. Create properties + * here to represent cached data that should be made available to all users + * and pages in the application.

+ * + *

An instance of this class will be created for you automatically, + * the first time your application evaluates a value binding expression + * or method binding expression that references a managed bean using + * this class.

+ */ +public class ApplicationBean1 extends AbstractApplicationBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + //
+ + /** + *

Construct a new application data bean instance.

+ */ + public ApplicationBean1() { + } + + /** + *

This method is called when this bean is initially added to + * application scope. Typically, this occurs as a result of evaluating + * a value binding or method binding expression, which utilizes the + * managed bean facility to instantiate this bean and store it into + * application scope.

+ * + *

You may customize this method to initialize and cache application wide + * data values (such as the lists of valid options for dropdown list + * components), or to allocate resources that are required for the + * lifetime of the application.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("ApplicationBean1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

This method is called when this bean is removed from + * application scope. Typically, this occurs as a result of + * the application being shut down by its owning container.

+ * + *

You may customize this method to clean up resources allocated + * during the execution of the init() method, or + * at any later time during the lifetime of the application.

+ */ + public void destroy() { + } + + /** + *

Return an appropriate character encoding based on the + * Locale defined for the current JavaServer Faces + * view. If no more suitable encoding can be found, return + * "UTF-8" as a general purpose default.

+ * + *

The default implementation uses the implementation from + * our superclass, AbstractApplicationBean.

+ */ + public String getLocaleCharacterEncoding() { + return super.getLocaleCharacterEncoding(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Bundle.properties b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Bundle.properties new file mode 100644 index 00000000..13e936fe --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Bundle.properties @@ -0,0 +1 @@ +# Sample ResourceBundle properties file diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ConfirmarDesactivar.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ConfirmarDesactivar.java new file mode 100644 index 00000000..3da91f5e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ConfirmarDesactivar.java @@ -0,0 +1,312 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +import beans.AnaliseAcidente; +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextArea; +import db.providers.AnalisesDataProvider; +import global.Global; +import java.util.Date; +import javax.faces.FacesException; +import javax.faces.context.FacesContext; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ * + * @version ConfirmarDesactivar.java + * @version Created on Oct 11, 2010, 3:38:04 PM + * @author dneves + */ + +public class ConfirmarDesactivar extends AbstractPageBean +{ + + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + + private StaticText lblUser = new StaticText(); + public StaticText getLblUser() + { + return lblUser; + } + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + + private StaticText txtMsg = new StaticText(); + public StaticText getTxtMsg() + { + return txtMsg; + } + public void setTxtMsg( StaticText st ) + { + this.txtMsg = st; + } + + private StaticText textAnalise = new StaticText(); + public StaticText getTextAnalise() + { + return textAnalise; + } + public void setTextAnalise( StaticText textAnalise ) + { + this.textAnalise = textAnalise; + } + + private TextArea textComentario = new TextArea(); + public TextArea getTextComentario() + { + return textComentario; + } + public void setTextComentario( TextArea textComentario ) + { + this.textComentario = textComentario; + } + + + private void _init() throws Exception + { + + } + + + public ConfirmarDesactivar() + { + + } + + + @Override + public void init() + { + super.init(); + + try + { + _init(); + } + catch ( Exception e ) + { + log( "ConfirmarDesactivar Initialization Failure", e ); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + if ( ! canAccess() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch( Exception e ) + { + ErrorLogger.logException( e ); + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "\n=== CONFIRMAR_DESACTIVACAO ===" ); + + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + AnaliseAcidente analise = getSessionBean1().getCurrentAnalise(); + if ( analise != null ) + { + textAnalise.setText( "Análise nº " + analise.getAnalise_nr() ); + System.out.println( "\nConfirmarDesactivar . prerender() : " + + "AnaliseID = " + analise.getId() + + " ; AnaliseNr = " + analise.getAnalise_nr() + + " ; AnaliseEstado = " + analise.getEstado() ); + } + else + { + textAnalise.setText( "Análise inválida." ); + System.out.println( "\nConfirmarDesactivar . prerender() : Analise = null !" ); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + private boolean canAccess() + { + boolean canAccess = false; + + if ( getSessionBean1().isLoggedIn() ) + { + Utilizador u = getSessionBean1().getCurrentUser(); + if ( u != null && u.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP ) + { + canAccess = true; + } + } + + return canAccess; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } + + public String lnkNewUser_action() + { + getSessionBean1().setNavFrom( "EstatisticasProcesso" ); + return "gestao_utilizadores"; + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "EstatisticasProcesso" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + + return null; + } + + public String buttonCancelar_action() + { + getSessionBean1().setCurrentAnalise( null ); + return "formDirSiprp"; + } + + public String buttonConfirmar_action() + { + Utilizador currentUser = getSessionBean1().getCurrentUser(); + AnaliseAcidente analise = getSessionBean1().getCurrentAnalise(); + if ( userCanDesactivarAnalise( currentUser ) && analise != null ) + { + try + { + String comentario = null; + if ( textComentario.getText() != null ) + { + comentario = ( ( String ) textComentario.getText() ).trim(); + comentario = "".equals( comentario ) ? null : comentario; + comentario = comentario != null ? comentario.replaceAll( "\n", "
" ) : null; + } + + analise.setEstado( Global.ESTADO_CONCLUIDO ); + analise.setConcluido_por_desactivacao( Boolean.TRUE ); + analise.setData_desactivacao( new Date() ); + analise.setComentario_desactivacao( comentario ); + + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + adp.updateAnalise( analise ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + getSessionBean1().setMsg( "Erro a desactivar análise.\n" + e.getMessage() ); + } + } + + return "formDirSiprp"; + } + + private boolean userCanDesactivarAnalise( Utilizador user ) + { + boolean canDesactivar = false; + if ( user != null ) + { + int userType = user.getTipo() == null ? -1 : user.getTipo().intValue(); + canDesactivar = userType == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP; + } + return canDesactivar; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Dummy.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Dummy.java new file mode 100644 index 00000000..eec74799 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Dummy.java @@ -0,0 +1,401 @@ +/* + * Dummy.java + * + * + * Created on September 19, 2007, 10:56 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; +import javax.faces.FacesException; +import javax.faces.event.ActionEvent; +import javax.faces.event.ValueChangeEvent; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class Dummy extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HiddenField hiddenField1 = new HiddenField(); + + public HiddenField getHiddenField1() { + return hiddenField1; + } + + public void setHiddenField1(HiddenField hf) { + this.hiddenField1 = hf; + } + + private HiddenField hidConfEnviar = new HiddenField(); + + public HiddenField getHidConfEnviar() { + return hidConfEnviar; + } + + public void setHidConfEnviar(HiddenField hf) { + this.hidConfEnviar = hf; + } + + private HiddenField hidConfDelete = new HiddenField(); + + public HiddenField getHidConfDelete() { + return hidConfDelete; + } + + public void setHidConfDelete(HiddenField hf) { + this.hidConfDelete = hf; + } + private SingleSelectOptionsList dropDown1DefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDropDown1DefaultOptions() { + return dropDown1DefaultOptions; + } + + public void setDropDown1DefaultOptions(SingleSelectOptionsList ssol) { + this.dropDown1DefaultOptions = ssol; + } + private SingleSelectOptionsList dropDown2DefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDropDown2DefaultOptions() { + return dropDown2DefaultOptions; + } + + public void setDropDown2DefaultOptions(SingleSelectOptionsList ssol) { + this.dropDown2DefaultOptions = ssol; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public Dummy() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Dummy Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + //txtIn.setText("OLA"); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + + + public String butCancelar_action() + { + return null; + } + + public String butGravar_action() + { + return null; + } + + public String butEnviar_action() + { + return null; + } + + public String butImagem_action() + { + return null; + } + + public String lnkMoreMed1_action() + { + return null; + } + + public String lnkNome_action() + { + return null; + } + + public String lnkDataNascimento_action() + { + return null; + } + + public String lnkEditUser_action() + { + return null; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), false ); + return null; + } + + public String butProcurarTrab_action() + { + return null; + } + + public String lnkPOR_action() + { + return null; + } + + public String lnkNomeTrabalhador_action() + { + return null; + } + + public String lnkEstabelecimentoTrabalhador_action() + { + return null; + } + + public void drpTipo_processValueChange(ValueChangeEvent event) + { + + } + + public void drpNome_processValueChange(ValueChangeEvent event) + { + + } + + public String hyperlink1_action() + { + return null; + } + + public void lnk_actionListener(ActionEvent e) + { + System.out.println("LINK"); + } + + + +// public String lnkAjuda_action() +// { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } +// return null; +// } + + public String butVoltar_action() + { + return null; + } + + public String butEliminar_action() + { + return null; + } + + public String lnkPlanosActuacao_action() + { + return null; + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public String lnkNewUser_action() + { + return null; + } + + public String lnkAjuda_action() + { + return null; + } + + public String lnkGerirUtilizadores_action() + { + return null; + } + + public String lnkAnalises_action() + { + return null; + } + + public String lnkPlanos_action() + { + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EditUser.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EditUser.java new file mode 100644 index 00000000..fee0ed5c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EditUser.java @@ -0,0 +1,24 @@ +/* + * EditUser.java + * + * Created on December 5, 2007, 2:02 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +import beans.Utilizador; + +/** + * + * @author lluis + */ +public class EditUser extends Utilizador{ + + /** Creates a new instance of EditUser */ + public EditUser() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EnviarCorrecao.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EnviarCorrecao.java new file mode 100644 index 00000000..7939af00 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EnviarCorrecao.java @@ -0,0 +1,753 @@ +/* + * EnviarCorrecao.java + * + * Created on November 28, 2007, 5:27 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Correcao; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextArea; +import db.providers.AnalisesDataProvider; +import db.providers.EstadosCorrecaoDataProvider; +import global.Global; +import java.util.ArrayList; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.event.ValueChangeEvent; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class EnviarCorrecao extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() { + return gridLayoutTop1; + } + + public void setGridLayoutTop1(HtmlPanelGrid hpg) { + this.gridLayoutTop1 = hpg; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private HtmlPanelGrid gridMain1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMain1() { + return gridMain1; + } + + public void setGridMain1(HtmlPanelGrid hpg) { + this.gridMain1 = hpg; + } + + private Table table1 = new Table(); + + public Table getTable1() { + return table1; + } + + public void setTable1(Table t) { + this.table1 = t; + } + + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() { + return tableRowGroup1; + } + + public void setTableRowGroup1(TableRowGroup trg) { + this.tableRowGroup1 = trg; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private TextArea txtObservacoes = new TextArea(); + + public TextArea getTxtObservacoes() { + return txtObservacoes; + } + + public void setTxtObservacoes(TextArea ta) { + this.txtObservacoes = ta; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() { + return tableColumn1; + } + + public void setTableColumn1(TableColumn tc) { + this.tableColumn1 = tc; + } + + private Hyperlink lnkEstadoCorr = new Hyperlink(); + + public Hyperlink getLnkEstadoCorr() { + return lnkEstadoCorr; + } + + public void setLnkEstadoCorr(Hyperlink h) { + this.lnkEstadoCorr = h; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private Button butConfirmar = new Button(); + + public Button getButConfirmar() { + return butConfirmar; + } + + public void setButConfirmar(Button b) { + this.butConfirmar = b; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public EnviarCorrecao() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("EnviarCorrecao Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin()); + fillTabelaEstados(); + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String lnkDataAcidente_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNr_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkPor_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNomeAcidentado_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkFase_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkDataAcidenteSeg_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNrSeg_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkPorSeg_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNomeAcidentadoSeg_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkFaseSeg_action() { + // TODO: Replace with your code + + return null; + } + + public void drpAno_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public void drpMes_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public void drpDia_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String butPesquisar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return null; + } + + public String lnkDataConcluida_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNrConcluida_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkPorConcluida_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNomeConcluida_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkEstabConcluida_action() { + // TODO: Replace with your code + + return null; + } + + private void fillTabelaEstados() + { + ArrayList list = new ArrayList(); + Correcao c = null; + int estado = getSessionBean1().getCurrentAnalise().getEstado().intValue(); + + switch(estado) + { + case Global.ESTADO_HS: + c = new Correcao(); + c.setCorrecao("y"); + c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId()); + c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado()); + c.setEstado_corr(new Integer(Global.ESTADO_SEG)); + c.setDescricao("FASE 1 - SEG - ABERTURA"); + list.add(c); + c = new Correcao(); + c.setCorrecao("y"); + c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId()); + c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado()); + c.setEstado_corr(new Integer(Global.ESTADO_RH1)); + c.setDescricao("FASE 2 - RH - ACOMPANHAMENTO"); + list.add(c); + getSessionBean1().getEstadosCorrecaoDataProvider().setList(list); + break; + case Global.ESTADO_CONSOLIDACAO: + c = new Correcao(); + c.setCorrecao("y"); + c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId()); + c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado()); + c.setEstado_corr(new Integer(Global.ESTADO_RH2)); + c.setDescricao("FASE 4 - RH - MEDIDAS + LESÃO"); + list.add(c); +// c = new Correcao(); +// c.setCorrecao("y"); +// c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId()); +// c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado()); +// c.setEstado_corr(new Integer(Global.ESTADO_MEDICINA)); +// c.setDescricao("Medicina"); +// list.add(c); + getSessionBean1().getEstadosCorrecaoDataProvider().setList(list); + break; + } + } + + public String lnkEstadoCorr_action() { + // TODO: Replace with your code + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + EstadosCorrecaoDataProvider provider = (EstadosCorrecaoDataProvider) tableRowGroup1.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + Correcao c = (Correcao)list.get(k); + + getSessionBean1().setCorrecao(c); + +// c.setObservacoes(""); +// if(txtObservacoes.getText() != null) +// { +// String obs = (String) txtObservacoes.getText(); +// c.setObservacoes(obs); +// } +// AnalisesDataProvider adp = new AnalisesDataProvider(); +// try +// { +// adp.changeEstado(c); +// +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// return "form_hs"; + return null; + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + + return null; + } + + public String butCancelar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + //return "form_hs"; + return "analise_acidente"; + } + + public String lnkAjuda_action() { + // TODO: Replace with your code +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String butConfirmar_action() + { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + Correcao c = getSessionBean1().getCorrecao(); + if(c != null) + { + c.setObservacoes(""); + if(txtObservacoes.getText() != null) + { + String obs = (String) txtObservacoes.getText(); + c.setObservacoes(obs); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + adp.changeEstado( c ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + return "form_hs"; + } + else + { + getSessionBean1().setMsg("Tem de indicar para onde enviar a correcção"); + return null; + } + + } + + public String lnkAnalisesAcidente_action() { + // TODO: Replace with your code + return null; + } + + public String lnkPlanosActuacao_action() { + // TODO: Replace with your code + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Erro.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Erro.java new file mode 100644 index 00000000..66aa2dc1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Erro.java @@ -0,0 +1,239 @@ +/* + * Error.java + * + * Created on September 19, 2007, 5:21 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextField; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class Erro extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private StaticText txtCab = new StaticText(); + + public StaticText getTxtCab() { + return txtCab; + } + + public void setTxtCab(StaticText st) { + this.txtCab = st; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public Erro() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Error Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg(""); + System.out.println("ERROR PAGE"); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EstatisticasProcesso.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EstatisticasProcesso.java new file mode 100644 index 00000000..60194e3d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/EstatisticasProcesso.java @@ -0,0 +1,1027 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +import beans.EstatisticaProcessoBean; +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.RadioButton; +import com.sun.rave.web.ui.component.RadioButtonGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.EstatisticasConstants; +import db.data.siprp.outer.SeccoesData; +import db.providers.AnalisesDataProvider; +import db.providers.EstatisticasDataProvider; +import global.Global; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.faces.FacesException; +import javax.faces.context.FacesContext; +import javax.servlet.http.HttpServletResponse; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import utils.Utils; + +/** + * + * @author dneves + */ +public class EstatisticasProcesso extends AbstractPageBean +{ + + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + + private Hyperlink lnkAnaliseAcidentes = new Hyperlink(); + public Hyperlink getLnkAnaliseAcidentes() + { + return lnkAnaliseAcidentes; + } + public void setLnkAnaliseAcidentes( Hyperlink lnkAnaliseAcidentes ) + { + this.lnkAnaliseAcidentes = lnkAnaliseAcidentes; + } + + + private StaticText lblUser = new StaticText(); + public StaticText getLblUser() + { + return lblUser; + } + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + + private StaticText txtMsg = new StaticText(); + public StaticText getTxtMsg() + { + return txtMsg; + } + public void setTxtMsg( StaticText st ) + { + this.txtMsg = st; + } + + private TextField textPOR = new TextField(); + public TextField getTextPOR() + { + return textPOR; + } + public void setTextPOR( TextField tf ) + { + this.textPOR = tf; + } + + private TextField textNome = new TextField(); + public TextField getTextNome() + { + return textNome; + } + public void setTextNome( TextField tf ) + { + this.textNome = tf; + } + + private TextField textAnoOcorrencia = new TextField(); + public TextField getTextAnoOcorrencia() + { + return textAnoOcorrencia; + } + public void setTextAnoOcorrencia( TextField tf ) + { + this.textAnoOcorrencia = tf; + } + +// private com.sun.rave.web.ui.component.Calendar calDataOcorrencia = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalDataOcorrencia() +// { +// return this.calDataOcorrencia; +// } +// public void setCalDataOcorrencia( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calDataOcorrencia = c; +// } + + + private Date calDataOcorrencia = null; + public Date getCalDataOcorrencia() + { + return calDataOcorrencia; + } + + public void setCalDataOcorrencia( Date calDataOcorrencia ) + { + this.calDataOcorrencia = calDataOcorrencia; + } + + + private TextField textHoraOcorrencia = new TextField(); + public TextField getTextHoraOcorrencia() + { + return textHoraOcorrencia; + } + public void setTextHoraOcorrencia( TextField tf ) + { + this.textHoraOcorrencia = tf; + } + + private TextField textHorasTrabalhadas = new TextField(); + public TextField getTextHorasTrabalhadas() + { + return textHorasTrabalhadas; + } + public void setTextHorasTrabalhadas( TextField tf ) + { + this.textHorasTrabalhadas = tf; + } + + private Table tableEstatisticas = new Table(); + public Table getTableEstatisticas() + { + return tableEstatisticas; + } + public void setTableEstatisticas( Table t ) + { + this.tableEstatisticas = t; + } + + private DropDown dropCausas = new DropDown(); + + public DropDown getDropCausas() { + return dropCausas; + } + + public void setDropCausas(DropDown dropCausas) { + this.dropCausas = dropCausas; + } + +// private TextField textDepartamento = new TextField(); +// public TextField getTextDepartamento() { +// return textDepartamento; +// } +// public void setTextDepartamento(TextField textDepartamento) { +// this.textDepartamento = textDepartamento; +// } + + private DropDown dropEstabelecimentos = new DropDown(); + + public DropDown getDropEstabelecimentos() + { + return dropEstabelecimentos; + } + + public void setDropEstabelecimentos( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentos = dropEstabelecimentos; + } + + private DropDown dropSeccoes = new DropDown(); + + public DropDown getDropSeccoes() { + return dropSeccoes; + } + + public void setDropSeccoes(DropDown dropSeccoes) { + this.dropSeccoes = dropSeccoes; + } + + private DropDown dropTurno = new DropDown(); + + public DropDown getDropTurno() { + return dropTurno; + } + + public void setDropTurno(DropDown dropTurno) { + this.dropTurno = dropTurno; + } + + private RadioButtonGroup formacaoSHST = new RadioButtonGroup(); + public RadioButtonGroup getFormacaoSHST() + { + return formacaoSHST; + } + public void setFormacaoSHST( RadioButtonGroup bg ) + { + this.formacaoSHST = bg; + } + + private RadioButton formacaoSHST_true = new RadioButton(); + public RadioButton getFormacaoSHST_true() { + return formacaoSHST_true; + } + public void setFormacaoSHST_true(RadioButton formacaoSHST_true) { + this.formacaoSHST_true = formacaoSHST_true; + } + + private RadioButton formacaoSHST_false = new RadioButton(); + public RadioButton getFormacaoSHST_false() { + return formacaoSHST_false; + } + public void setFormacaoSHST_false(RadioButton formacaoSHST_false) { + this.formacaoSHST_false = formacaoSHST_false; + } + + private RadioButton formacaoSHST_none = new RadioButton(); + public RadioButton getFormacaoSHST_none() + { + return formacaoSHST_none; + } + public void setFormacaoSHST_none( RadioButton formacaoSHST_none ) + { + this.formacaoSHST_none = formacaoSHST_none; + } + + private RadioButton participacaoSeguro_true = new RadioButton(); + public RadioButton getParticipacaoSeguro_true() { + return participacaoSeguro_true; + } + public void setParticipacaoSeguro_true(RadioButton participacaoSeguro_true) { + this.participacaoSeguro_true = participacaoSeguro_true; + } + + private RadioButton participacaoSeguro_none = new RadioButton(); + public RadioButton getParticipacaoSeguro_none() + { + return participacaoSeguro_none; + } + public void setParticipacaoSeguro_none( RadioButton participacaoSeguro_none ) + { + this.participacaoSeguro_none = participacaoSeguro_none; + } + + private RadioButton postoAcidentado_true = new RadioButton(); + private RadioButton postoAcidentado_false = new RadioButton(); + private RadioButton outrosColaboradores_true = new RadioButton(); + private RadioButton outrosColaboradores_false = new RadioButton(); + + public RadioButton getOutrosColaboradores_false() { + return outrosColaboradores_false; + } + public void setOutrosColaboradores_false(RadioButton outrosColaboradores_false) { + this.outrosColaboradores_false = outrosColaboradores_false; + } + + public RadioButton getOutrosColaboradores_true() { + return outrosColaboradores_true; + } + public void setOutrosColaboradores_true(RadioButton outrosColaboradores_true) { + this.outrosColaboradores_true = outrosColaboradores_true; + } + + public RadioButton getPostoAcidentado_false() { + return postoAcidentado_false; + } + public void setPostoAcidentado_false(RadioButton postoAcidentado_false) { + this.postoAcidentado_false = postoAcidentado_false; + } + + public RadioButton getPostoAcidentado_true() { + return postoAcidentado_true; + } + public void setPostoAcidentado_true(RadioButton postoAcidentado_true) { + this.postoAcidentado_true = postoAcidentado_true; + } + + private Button buttonExport = new Button(); + + public Button getButtonExport() { + return buttonExport; + } + public void setButtonExport(Button buttonExport) { + this.buttonExport = buttonExport; + } + + + private List< EstatisticaProcessoBean > listEstatisticas = new LinkedList< EstatisticaProcessoBean >(); + public List< EstatisticaProcessoBean > getListEstatisticas() + { + return this.listEstatisticas; + } + public void setListEstatisticas( List< EstatisticaProcessoBean > l ) + { + this.listEstatisticas = l; + } + + private boolean canAccess() + { + boolean canAccess = false; + canAccess = getSessionBean1().getCanAccessEstatisticas(); + return canAccess; + } + + @Override + public void init() + { + super.init(); + + try + { + _init(); + } + catch ( Exception e ) + { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e : new FacesException(e); + } + + if ( ! canAccess() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch( Exception e ) + { + ErrorLogger.logException( e ); + } + } + + formacaoSHST_none.setSelected( true ); + + participacaoSeguro_none.setSelected( true ); + } + + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "=== ESTATISTICAS_PROCESSO ===" ); + + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + Option[] turnosOptions = new Option[ 5 ]; + turnosOptions[ 0 ] = new Option( "", "" ); + turnosOptions[ 1 ] = new Option( "m", "Manhã" ); + turnosOptions[ 2 ] = new Option( "t", "Tarde" ); + turnosOptions[ 3 ] = new Option( "n", "Noite" ); + turnosOptions[ 4 ] = new Option( "o", "Outro" ); + dropTurno.setItems( turnosOptions ); + + try + { + EstatisticasDataProvider statsProvider = EstatisticasDataProvider.getInstance(); + + Option[] causas = AnalisesDataProvider.getInstance().getCausasAcidente( true ); + if ( causas != null ) + { + dropCausas.setItems( causas ); + } + + Option[] seccoes = statsProvider.getSeccoesList(); + if ( seccoes != null ) + { + dropSeccoes.setItems( seccoes ); + } + + Option[] estabelecimentos = null; + if ( getSessionBean1().isLoggedIn() && getSessionBean1().getCurrentUser() != null && + getSessionBean1().getCurrentUser().getTipo() != null ) + { + int tipo = getSessionBean1().getCurrentUser().getTipo().intValue(); + + if( tipo == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP || tipo == Global.TIPO_UTILIZADOR_HS + || tipo == Global.TIPO_UTILIZADOR_GESTOR || tipo == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH + || tipo == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA ) + { + estabelecimentos = statsProvider.getEstabelecimentos(); + + } + else + { + Integer estabelecimentoId = getSessionBean1().getCurrentUser().getEstabelecimento_id(); + String estabelecimentoNome = statsProvider.getEstabelecimentoByID( estabelecimentoId ); + estabelecimentos = new com.sun.rave.web.ui.model.Option[]{ + new Option( estabelecimentoId, estabelecimentoNome ) + }; + } + } + if ( estabelecimentos != null ) + { + dropEstabelecimentos.setItems( estabelecimentos ); + } + + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + + } + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() + { + + } + + public String lnkAnalisesAcidente_action() + { + Utilizador currentUser = getSessionBean1().getCurrentUser(); + int userType = currentUser == null ? -1 : currentUser.getTipo() == null ? -1 : currentUser.getTipo().intValue(); + + switch ( userType ) + { + case Global.TIPO_UTILIZADOR_SEGURANCA : + return "form_seguranca"; + case Global.TIPO_UTILIZADOR_RH : + return "form_rh"; + case Global.TIPO_UTILIZADOR_HS : + return "form_hs"; + case Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP : + return "form_dir_siprp"; + case Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH : + return "form_dir_ger_rh"; + case Global.TIPO_UTILIZADOR_GESTOR : + return "form_gestor"; + } + return null; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } + + public String lnkNewUser_action() + { + getSessionBean1().setNavFrom( "EstatisticasProcesso" ); + return "gestao_utilizadores"; + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "EstatisticasProcesso" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + + return null; + } + + private Map< String, Object > getFormFieldValues() + { + String por = null; + if ( textPOR.getText() != null ) + { + por = ( ( String ) textPOR.getText() ).trim(); + por = "".equals( por ) ? null : por; + } + String nome = null; + if ( textNome.getText() != null ) + { + nome = ( ( String ) textNome.getText() ).trim(); + nome = "".equals( nome ) ? null : nome; + } + String anoOcorrencia = null; + if ( textAnoOcorrencia.getText() != null ) + { + anoOcorrencia = ( ( String ) textAnoOcorrencia.getText() ).trim(); + anoOcorrencia = "".equals( anoOcorrencia ) ? null : anoOcorrencia; + } + Date dataOcorrencia = null; +// if ( calDataOcorrencia.getValue() != null ) +// { +// dataOcorrencia = ( Date )calDataOcorrencia.getValue(); +// } + dataOcorrencia = calDataOcorrencia; + + String horaOcorrencia = null; + if ( textHoraOcorrencia.getText() != null ) + { + horaOcorrencia = ( ( String ) textHoraOcorrencia.getText() ).trim(); + horaOcorrencia = "".equals( horaOcorrencia ) ? null : horaOcorrencia; + } + String horasTrabalhadas = null; + if ( textHorasTrabalhadas.getText() != null ) + { + horasTrabalhadas = ( ( String ) textHorasTrabalhadas.getText() ).trim(); + horasTrabalhadas = "".equals( horasTrabalhadas ) ? null : horasTrabalhadas; + } +// String departamento = null; +// if ( textDepartamento.getText() != null ) +// { +// departamento = ( ( String ) textDepartamento.getText() ).trim(); +// departamento = "".equals( departamento ) ? null : departamento; +// } + + Integer estabelecimentoID = null; + if ( dropEstabelecimentos.getSelected() != null ) + { + String estabelecimento = ( String ) dropEstabelecimentos.getSelected(); + if ( estabelecimento != null ) + { + try { estabelecimentoID = Integer.parseInt( estabelecimento ); } + catch ( Exception e ) { } + } + } + + Integer seccaoID = null; + if ( dropSeccoes.getSelected() != null ) + { +// seccaoID = ( Integer ) dropSeccoes.getSelected(); + String seccao = ( String ) dropSeccoes.getSelected(); + if ( seccao != null ) + { + try { seccaoID = Integer.parseInt( seccao ); } + catch ( Exception e ) { } + } + } + Integer causas = null; + if ( dropCausas.getSelected() != null ) + { + String causaID = ( String ) dropCausas.getSelected(); + if ( causaID != null ) + { + try { causas = Integer.parseInt( causaID ); } + catch ( Exception e ) { } + } + } + String turno = null; + if ( dropTurno.getSelected() != null ) + { + turno = ( String ) dropTurno.getSelected(); + turno = turno == null || "".equals( turno.trim() ) ? null : turno; + } + Boolean shst = null; + if ( formacaoSHST_true.getSelected() != null || formacaoSHST_false.getSelected() != null || formacaoSHST_none.getSelected() != null ) + { + Boolean trueSelected = ( Boolean ) formacaoSHST_true.getSelected(); + Boolean falseSelected = ( Boolean ) formacaoSHST_false.getSelected(); + Boolean noneSelected = ( Boolean ) formacaoSHST_none.getSelected(); + + if ( trueSelected != null && trueSelected ) + { + shst = Boolean.TRUE; + } + if ( falseSelected != null && falseSelected ) + { + shst = Boolean.FALSE; + } + if ( noneSelected != null && noneSelected ) + { + shst = null; + } + } + Boolean participadoSeguro = ( participacaoSeguro_true.getSelected() != null && (Boolean) participacaoSeguro_true.getSelected() ) ? Boolean.TRUE : null; + Boolean postoAcidentado = null; + if ( postoAcidentado_true.getSelected() != null || postoAcidentado_false.getSelected() != null ) + { + postoAcidentado = ( Boolean ) postoAcidentado_true.getSelected(); + } + Boolean outrosAcidentados = null; + if ( outrosColaboradores_true.getSelected() != null || outrosColaboradores_false.getSelected() != null ) + { + outrosAcidentados = ( Boolean ) outrosColaboradores_true.getSelected(); + } + + Map< String, Object > searchProperties = new HashMap< String, Object >(); + searchProperties.put( EstatisticasConstants.KEY_POR, por ); + searchProperties.put( EstatisticasConstants.KEY_NOME, nome ); + searchProperties.put( EstatisticasConstants.KEY_ANO_OCORRENCIA, anoOcorrencia ); + searchProperties.put( EstatisticasConstants.KEY_DATA_OCORRENCIA, dataOcorrencia ); + searchProperties.put( EstatisticasConstants.KEY_HORA_OCORRENCIA, horaOcorrencia ); + searchProperties.put( EstatisticasConstants.KEY_HORAS_TRABALHADAS, horasTrabalhadas ); +// searchProperties.put( EstatisticasConstants.KEY_DEPARTAMENTO, departamento ); + searchProperties.put( EstatisticasConstants.KEY_ESTABELECIMENTO, estabelecimentoID ); + searchProperties.put( EstatisticasConstants.KEY_SECCAO, seccaoID ); + searchProperties.put( EstatisticasConstants.KEY_CAUSAS_ACIDENTE, causas ); + searchProperties.put( EstatisticasConstants.KEY_TURNO_TRABALHO, turno ); + searchProperties.put( EstatisticasConstants.KEY_FORMACAO_SHST, shst ); + searchProperties.put( EstatisticasConstants.KEY_PARTICIPADO_SEGURO, participadoSeguro ); + searchProperties.put( EstatisticasConstants.KEY_POSTO_ACIDENTADO, postoAcidentado ); + searchProperties.put( EstatisticasConstants.KEY_OUTROS_ACIDENTADOS, outrosAcidentados ); + + return searchProperties; + } + + private void getEstatisticas() + { + Map< String, Object > searchProperties = getFormFieldValues(); + + listEstatisticas = new LinkedList< EstatisticaProcessoBean >(); + try + { + EstatisticasDataProvider edp = EstatisticasDataProvider.getInstance(); + listEstatisticas = edp.getEstatisticas( searchProperties ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + setListEstatisticas( listEstatisticas ); + } + + public String buttonEstatistica_action() + { + getEstatisticas(); + buttonExport.setRendered( true ); + return null; + } + + public String buttonExport_action() + { + System.out.println( "=== EXPORT TO EXCEL ===" ); + + getEstatisticas(); + System.out.println( "-> " + getListEstatisticas().size() ); + + + HSSFWorkbook book = new HSSFWorkbook(); + Map< String, HSSFCellStyle > styles = createStyles( book ); + HSSFSheet sheet = book.createSheet( "Estatisticas" ); + + int row = writeFilters( sheet, 0 ); + + HSSFRow headerRow = getRow( sheet, row ); + HSSFCell columnEstado = getCell( headerRow, 0 ); + columnEstado.setCellValue( "Estado" ); + columnEstado.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER ) ); + + HSSFCell columnFase = getCell( headerRow, 1 ); + columnFase.setCellValue( "Fase" ); + columnFase.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER ) ); + + HSSFCell columnCount = getCell( headerRow, 2 ); + columnCount.setCellValue( "Contagem" ); + columnCount.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER ) ); + + row++; + for ( EstatisticaProcessoBean line : getListEstatisticas() ) + { + HSSFRow lineRow = getRow( sheet, row ); + + HSSFCell columnEstadoValue = getCell( lineRow, 0 ); + columnEstadoValue.setCellValue( line.getEstado() ); + columnEstadoValue.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL ) ); + + HSSFCell columnFaseValue = getCell( lineRow, 1 ); + columnFaseValue.setCellValue( line.getFase() ); + columnFaseValue.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL ) ); + + HSSFCell columnCountValue = getCell( lineRow, 2 ); + columnCountValue.setCellValue( line.getCount() ); + columnCountValue.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL ) ); + + row++; + } + + sheet.autoSizeColumn( 0, true ); + sheet.autoSizeColumn( 1, true ); + sheet.autoSizeColumn( 2, true ); + + try + { + saveWorkbook( book ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + getSessionBean1().setMsg( "Erro a gerar o ficheiro." ); + } + + return null; + } + + + private Map< String, HSSFCellStyle > createStyles( HSSFWorkbook book ) + { + Map< String, HSSFCellStyle > styles = new HashMap< String, HSSFCellStyle >(); + + HSSFCellStyle style; + + HSSFFont headerFont = book.createFont(); + headerFont.setFontHeightInPoints( ( short ) 12 ); + headerFont.setBoldweight( HSSFFont.BOLDWEIGHT_BOLD ); + + HSSFFont normalFont = book.createFont(); + headerFont.setFontHeightInPoints( ( short ) 12 ); + + style = book.createCellStyle(); +// style.setAlignment( HSSFCellStyle.ALIGN_CENTER ); + style.setVerticalAlignment( HSSFCellStyle.VERTICAL_CENTER ); + style.setFont( headerFont ); + styles.put( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER, style ); + + style = book.createCellStyle(); + style.setVerticalAlignment( HSSFCellStyle.VERTICAL_CENTER ); + style.setFont( normalFont ); + styles.put( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL, style ); + + return styles; + } + + private HSSFRow getRow( HSSFSheet sheet, int rowNumber ) + { + HSSFRow row = sheet.getRow( rowNumber ); + if ( row == null ) + { + row = sheet.createRow( rowNumber ); + } + return row; + } + + private HSSFCell getCell( HSSFRow row, int cellNumber ) + { + HSSFCell cell = row.getCell( cellNumber ); + if ( cell == null ) + { + cell = row.createCell( cellNumber ); + } + return cell; + } + + private int writeFilters( HSSFSheet sheet, int row ) + { + Map< String, Object > searchProperties = getFormFieldValues(); + String por = ( String ) searchProperties.get( EstatisticasConstants.KEY_POR ); + String nome = ( String ) searchProperties.get( EstatisticasConstants.KEY_NOME ); + String anoOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_ANO_OCORRENCIA ); + Date dataOcorrencia = ( Date ) searchProperties.get( EstatisticasConstants.KEY_DATA_OCORRENCIA ); + String horaOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORA_OCORRENCIA ); + String horasTrabalhadas = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORAS_TRABALHADAS ); +// String departamento = ( String ) searchProperties.get( EstatisticasConstants.KEY_DEPARTAMENTO ); + Integer estabelecimentoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_ESTABELECIMENTO ); + Integer seccaoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_SECCAO ); + String estabelecimento = null; + try + { + estabelecimento = EstatisticasDataProvider.getInstance().getEstabelecimentoByID( estabelecimentoID ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + String seccao = null; + try + { + SeccoesData seccaoData = EstatisticasDataProvider.getInstance().loadSeccaoByID( seccaoID ); + seccao = seccaoData == null ? null : seccaoData.getDescricao(); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + + Integer causas = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_CAUSAS_ACIDENTE ); + String turno = ( String ) searchProperties.get( EstatisticasConstants.KEY_TURNO_TRABALHO ); + Boolean formacao_shst = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_FORMACAO_SHST ); + Boolean participado_seguro = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_PARTICIPADO_SEGURO ); + Boolean postoAcidentado = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_POSTO_ACIDENTADO ); + Boolean outrosAcidentados = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_OUTROS_ACIDENTADOS ); + + String keyName = null; + HSSFRow currentRow = null; + HSSFCell columnLabel = null; + HSSFCell columnValue = null; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( por ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( nome ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( anoOcorrencia ); + row++; + + final SimpleDateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( dataOcorrencia == null ? "" : D_F.format( dataOcorrencia ) ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( horaOcorrencia ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( horasTrabalhadas ); + row++; + +// keyName = EstatisticasConstants.KEY_NAMES[ row ]; +// currentRow = getRow( sheet, row ); +// columnLabel = getCell( currentRow, 0 ); +// columnLabel.setCellValue( keyName ); +// columnValue = getCell( currentRow, 1 ); +// columnValue.setCellValue( departamento ); +// row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( estabelecimento ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( seccao ); + row++; + + + String causa = ""; + if ( causas != null ) + { + try + { + EstatisticasDataProvider statsProvider = EstatisticasDataProvider.getInstance(); + causa = statsProvider.getCausaByID( causas ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + } + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( causa ); + row++; + + String turnoDesc = ""; + if ( turno != null ) + { + if ( "m".equals( turno ) ) + { + turnoDesc = "Manhã"; + } + else if ( "t".equals( turno ) ) + { + turnoDesc = "Tarde"; + } + else if ( "n".equals( turno ) ) + { + turnoDesc = "Noite"; + } + } + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + columnValue.setCellValue( turnoDesc ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + String fshst = ""; + if ( formacao_shst != null ) + { + fshst = formacao_shst ? "Sim" : "Não"; + } + columnValue.setCellValue( fshst ); + row++; + + keyName = EstatisticasConstants.KEY_NAMES[ row ]; + currentRow = getRow( sheet, row ); + columnLabel = getCell( currentRow, 0 ); + columnLabel.setCellValue( keyName ); + columnValue = getCell( currentRow, 1 ); + String fparticiapdo = ""; + if ( participado_seguro != null ) + { + fparticiapdo = participado_seguro ? "Sim" : "Não"; + } + columnValue.setCellValue( fparticiapdo ); + + row++; + row++; + return row++; + } + + private void saveWorkbook( HSSFWorkbook book ) + throws Exception + { + byte[] bytes = book.getBytes(); + + System.out.println( "BOOK LEN : " + bytes.length ); + + FacesContext context = FacesContext.getCurrentInstance(); + HttpServletResponse response = ( HttpServletResponse ) context.getExternalContext().getResponse(); + + response.setHeader( "Expires", "0" ); + response.setHeader( "Cache-Control", "must-revalidate, post-check=0, pre-check=0" ); + response.setHeader( "Pragma", "public" ); + response.setContentType( "application/vnd.ms-excel" ); + response.addHeader( "Content-disposition", "attachment;filename=\"EstatisticasProcesso.xls\"" ); + response.setContentLength( bytes.length ); + + response.getOutputStream().write( bytes ); + response.getOutputStream().flush(); + response.getOutputStream().close(); + context.responseComplete(); + + System.out.println( "SHOW workbook DONE" ); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FichaUtilizador.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FichaUtilizador.java new file mode 100644 index 00000000..cc04d117 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FichaUtilizador.java @@ -0,0 +1,1595 @@ +/* + * FichaUtilizador.java + * + * Created on October 11, 2007, 9:49 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Permissao; +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Checkbox; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.PasswordField; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; +import db.providers.AnalisesDataProvider; +import db.providers.UtilizadoresDataProvider; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; +import global.Global; +import javax.faces.context.FacesContext; +import utils.JSFUtils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FichaUtilizador extends AbstractPageBean +{ + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg1() { + return gridMsg1; + } + + public void setGridMsg1(HtmlPanelGrid hpg) { + this.gridMsg1 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText stCriarEditar = new StaticText(); + + public StaticText getStCriarEditar() { + return stCriarEditar; + } + + public void setStCriarEditar(StaticText st) { + this.stCriarEditar = st; + } + + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() { + return staticText4; + } + + public void setStaticText4(StaticText st) { + this.staticText4 = st; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private DropDown drpTipo = new DropDown(); + + public DropDown getDrpTipo() { + return drpTipo; + } + + public void setDrpTipo(DropDown dd) { + this.drpTipo = dd; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private DropDown drpNome = new DropDown(); + + public DropDown getDrpNome() { + return drpNome; + } + + public void setDrpNome(DropDown dd) { + this.drpNome = dd; + } + + private TextField txtNome = new TextField(); + + public TextField getTxtNome() { + return txtNome; + } + + public void setTxtNome(TextField tf) { + this.txtNome = tf; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private TextField txtLogin = new TextField(); + + public TextField getTxtLogin() { + return txtLogin; + } + + public void setTxtLogin(TextField tf) { + this.txtLogin = tf; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private PasswordField txtPassword = new PasswordField(); + + public PasswordField getTxtPassword() { + return txtPassword; + } + + public void setTxtPassword(PasswordField pf) { + this.txtPassword = pf; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private TextField txtEmail = new TextField(); + + public TextField getTxtEmail() { + return txtEmail; + } + + public void setTxtEmail(TextField tf) { + this.txtEmail = tf; + } + + private StaticText lblCap = new StaticText(); + + public StaticText getLblCap() { + return lblCap; + } + + public void setLblCap(StaticText st) { + this.lblCap = st; + } + + private TextField txtCap = new TextField(); + + public TextField getTxtCap() { + return txtCap; + } + + public void setTxtCap(TextField tf) { + this.txtCap = tf; + } + + private StaticText lblCedula = new StaticText(); + + public StaticText getLblCedula() { + return lblCedula; + } + + public void setLblCedula(StaticText st) { + this.lblCedula = st; + } + + private StaticText stCedula = new StaticText(); + + public StaticText getStCedula() { + return stCedula; + } + + public void setStCedula(StaticText st) { + this.stCedula = st; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() { + return staticText13; + } + + public void setStaticText13(StaticText st) { + this.staticText13 = st; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + + private Button butGravar = new Button(); + + public Button getButGravar() { + return butGravar; + } + + public void setButGravar(Button b) { + this.butGravar = b; + } + + private HiddenField hidConfDelUser = new HiddenField(); + + public HiddenField getHidConfDelUser() { + return hidConfDelUser; + } + + public void setHidConfDelUser(HiddenField hf) { + this.hidConfDelUser = hf; + } + + //
+ private boolean isPostData = false; + + private final static int SEG = 1; + private final static int RH = 2; + private final static int HS = 3; + private final static int MEDICO = 5; + private final static int GESTOR = 6; + private final static int DIRECTOR_RH = 7; + private final static int DIRECTOR_SIPRP = 8; + private final static int DIRECTOR_LOJA = 9; + private final static int DIRECTOR_NACIONAL_SEGURANCA = 10; + + private boolean isFromPlanos = false; + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() + { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private DropDown drpEstabelecimentos = new DropDown(); + + public DropDown getDrpEstabelecimentos() { + return drpEstabelecimentos; + } + + public void setDrpEstabelecimentos(DropDown dd) { + this.drpEstabelecimentos = dd; + } + + private SingleSelectOptionsList drpEstabelecimentosDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpEstabelecimentosDefaultOptions() { + return drpEstabelecimentosDefaultOptions; + } + + public void setDrpEstabelecimentosDefaultOptions(SingleSelectOptionsList ssol) { + this.drpEstabelecimentosDefaultOptions = ssol; + } + + private StaticText lblResponsavelLoja = new StaticText(); + + public StaticText getLblResponsavelLoja() { + return lblResponsavelLoja; + } + + public void setLblResponsavelLoja(StaticText st) { + this.lblResponsavelLoja = st; + } + + private Checkbox chkResponsavelLoja = new Checkbox(); + + public Checkbox getChkResponsavelLoja() { + return chkResponsavelLoja; + } + + public void setChkResponsavelLoja(Checkbox c) { + this.chkResponsavelLoja = c; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private PasswordField txtConfPassword = new PasswordField(); + + public PasswordField getTxtConfPassword() { + return txtConfPassword; + } + + public void setTxtConfPassword(PasswordField pf) { + this.txtConfPassword = pf; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + private Hyperlink lnkGerirUtilizadores = new Hyperlink(); + + public Hyperlink getLnkGerirUtilizadores() { + return lnkGerirUtilizadores; + } + + public void setLnkGerirUtilizadores(Hyperlink h) { + this.lnkGerirUtilizadores = h; + } + + /** + *

Construct a new Page bean instance.

+ */ + public FichaUtilizador() + { + + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FichaUtilizador Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e : new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + if ( ! getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect("Login.jsp"); + } + catch (Exception e) + { + // . . . handle exception . . . + } + } + else + { + FacesContext fc = getFacesContext(); + System.out.println( "REQUEST PARAMETERS : " + JSFUtils.requestHasParameters( fc ) ); + isFromPlanos = false; + + if ( JSFUtils.requestHasParameters( fc ) ) + { + isFromPlanos = true; + String user_id = JSFUtils.getRequestParameter(fc, "user"); + String mode = JSFUtils.getRequestParameter(fc, "mode"); + if (mode != null) + { + if (mode.matches("edit")) + { + System.out.println("MODE PARAMETER : " + mode); + getSessionBean1().setModoEdicaoUtilizador("edit"); + } + } + + Utilizador u = null; + if (user_id != null ) + { + try + { + Integer userId = new Integer( Integer.parseInt( user_id ) ); + System.out.println( "USER ID FROM PLANOS : " + user_id ); + + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + //udp.checkConnection(); + u = udp.getUtilizador( userId ); + getSessionBean1().setCurrentUser( u ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + if ( getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH + || getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP ) + { + lnkGerirUtilizadores.setDisabled( false ); + } + else + { + lnkGerirUtilizadores.setDisabled( true ); + } + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if ( isFromPlanos ) + { + isPostData = false; + } + else + { + if ( pageFrom.matches( "FichaUtilizador.jsp" ) ) + { + isPostData = true; + System.out.println( "IS POSTDATA : " + isPostData ); + } + } + + if ( ! isPostData ) + { + lblUser.setText(getSessionBean1().getCurrentUser().getLogin()); + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Integer permissao = udp.getPermissionCode( getSessionBean1().getCurrentUser().getId() ); + getSessionBean1().setTiposOptions( adp.getTiposList( permissao ) ); + drpTipo.setSelected( new Integer( 0 ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + getSessionBean1().setEstabelecimentosOptions(adp.getEstabelecimentosList(getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(false))); + System.out.println("ESTABELECIMENTOS OPTIONS : " + getSessionBean1().getEstabelecimentosOptions().length); + drpEstabelecimentos.setSelected(new Integer(-1)); + } + catch (Exception ex) + { + ErrorLogger.logException(ex); + } + } + else //postData + { + String del_user = (String) getExternalContext().getRequestParameterMap().get("del_user"); + if (del_user != null) + { + if (del_user.matches("yes")) + { + hidConfDelUser.setValue(""); + try + { + deleteUser(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + getSessionBean1().setMsg("Erro na eliminação do utilizador!"); + } + + //force a page reload + // try + // { + // getExternalContext().redirect("FichaUtilizador.jsp"); + // System.out.println("REDIRECT"); + // } + // catch(Exception ex) + // { + // ErrorLogger.logException( ex ); + // } + + } + else if ( del_user.matches( "no" ) ) + { + hidConfDelUser.setValue(""); + showUser(); + } + } + + } + + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + stCriarEditar.setText("EDITAR"); + + if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) + { + if(!isPostData) + { + txtNome.setStyleClass("hide"); + stCriarEditar.setText("CRIAR"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + } + } + if(getSessionBean1().getModoEdicaoUtilizador().matches("edit")) + { + //drpNome.setRendered(true); + if(!isPostData) + { + showUser(); + } + } + + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + + if(getSessionBean1().isMudarPassword()) + { + //txtMsg.setStyle("color: #000000; font-weight: bold"); + if(!isPostData) + { + txtMsg.setText("Por favor confirme os seus dados e altere a password para uma apenas do seu conhecimento."); + } + //getSessionBean1().setMudarPassword(false); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return (RequestBean1)getBean("RequestBean1"); + } + + public String lnkAnalisesAcidente_action() + { + //return navigate(); + int tipo = getSessionBean1().getCurrentUser().getTipo().intValue(); + if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + return "form_dir_siprp"; + } + else if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + return "form_dir_ger_rh"; + } + else if(tipo == Global.TIPO_UTILIZADOR_SEGURANCA) + { + return "form_seguranca"; + } + else if(tipo == Global.TIPO_UTILIZADOR_RH) + { + return "form_rh"; + } + else if(tipo == Global.TIPO_UTILIZADOR_RH) + { + return "form_rh"; + } + else if(tipo == Global.TIPO_UTILIZADOR_HS) + { + return "form_hs"; + } + else if(tipo == Global.TIPO_UTILIZADOR_GESTOR) + { + return "form_gestor"; + } + else if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA) + { + return "form_gestor"; + } + else if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA) + { + return "form_gestor"; + } + + return null; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + + return null; + } + + + public String butCancelar_action() + { + return navigate(); + } + + public String butGravar_action() + { + if(validationOk()) + { + if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) + { + try + { + Utilizador u = addUser(); + addPermissao(u); + getSessionBean1().setMsg("Utilizador criado"); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na criação do utilizador!"); + ErrorLogger.logException( ex ); + } + } + else //edit + { + try + { + updateUser(); + //getSessionBean1().setMsg("Dados actualizados"); + return navigate(); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na actualização do utilizador"); + ErrorLogger.logException( ex ); + } + } + + if(getSessionBean1().isMudarPassword()) + { + getSessionBean1().setMudarPassword(false); + } + } + return null; + } + + public void drpTipo_processValueChange(ValueChangeEvent event) + { + drpNome.setVisible(true); + Integer tipo = (Integer) drpTipo.getSelected(); + boolean booGestor = false; + if(tipo.intValue() == GESTOR) + { + booGestor = true; + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + getSessionBean1().setEstabelecimentosOptions(adp.getEstabelecimentosList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(booGestor) )); + drpEstabelecimentos.setSelected(new Integer(-1)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == GESTOR || tipo.intValue() == DIRECTOR_RH || tipo.intValue() == DIRECTOR_SIPRP) + { + drpNome.setRendered(false); + txtNome.setStyleClass("show"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + } + else if(tipo.intValue() == HS || tipo.intValue() == MEDICO) + { + drpNome.setRendered(true); + txtNome.setStyleClass("hide"); + if(tipo.intValue() == HS) + { + lblCap.setRendered(true); + txtCap.setRendered(true); + lblCedula.setRendered(false); + stCedula.setRendered(false); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + getSessionBean1().setMedicosOptions(adp.getTecnicosSaudeList()); + drpNome.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + else // medicos + { + lblCedula.setRendered(true); + stCedula.setRendered(true); + lblCap.setRendered(false); + txtCap.setRendered(false); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + getSessionBean1().setMedicosOptions(adp.getMedicosList()); + drpNome.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + } + } + + private boolean validationOk() + { + Integer tipo = (Integer) drpTipo.getSelected(); +// if(tipo.intValue() == 0) +// { +// getSessionBean1().setMsg("Tem de escolher um tipo!"); +// return false; +// } +// Integer estabelecimento = (Integer) drpEstabelecimentos.getSelected(); +// if(estabelecimento.intValue() == -1) +// { +// getSessionBean1().setMsg("Tem de escolher um estabelecimento!"); +// return false; +// } + +// if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == GESTOR || tipo.intValue() == DIRECTOR_RH || tipo.intValue() == DIRECTOR_SIPRP) +// { +// if(txtNome.getText() == null) +// { +// getSessionBean1().setMsg("Tem de indicar o nome!"); +// return false; +// } +// else +// { +// String nome = (String) txtNome.getText(); +// if(nome.trim().length() == 0) +// { +// getSessionBean1().setMsg("Tem de indicar o nome!"); +// return false; +// } +// } +// } +// else if(tipo.intValue() == HS || tipo.intValue() == MEDICO) +// { +// Integer nome = (Integer) drpNome.getSelected(); +// if(nome.intValue() == 0) +// { +// getSessionBean1().setMsg("Tem de indicar o nome!"); +// return false; +// } +// } + +// if(txtLogin.getText() == null) +// { +// getSessionBean1().setMsg("Tem de indicar o login!"); +// return false; +// } +// else +// { +// String login = (String) txtLogin.getText(); +// if(login.trim().length() == 0) +// { +// getSessionBean1().setMsg("Tem de indicar o login!"); +// return false; +// } +// } + + if(txtPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar a password!"); + return false; + } + else + { + String password = (String) txtPassword.getText(); + if(password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar a password!"); + return false; + } + else + { + if(txtConfPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + String conf_password = (String) txtConfPassword.getText(); + if(conf_password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + if(!password.equals(conf_password)) + { + getSessionBean1().setMsg("A confirmação tem de ser igual à a password!"); + return false; + } + } + } + } // + } + + if(getSessionBean1().isMudarPassword()) + { + String password = (String) txtPassword.getText(); + if(password.matches(getSessionBean1().getCurrentUser().getPassword())) + { + getSessionBean1().setMsg("A nova password tem de ser diferente da password actual!"); + return false; + } + + } + +// if(tipo.intValue() == HS) +// { +// if(txtCap.getText() == null ) +// { +// getSessionBean1().setMsg("Tem de indicar o c.a.p.!"); +// return false; +// } +// else +// { +// String cap = (String) txtCap.getText(); +// if(cap.trim().length() == 0) +// { +// getSessionBean1().setMsg("Tem de indicar o c.a.p.!"); +// return false; +// } +// } +// } + + return true; + } + + public void drpNome_processValueChange( ValueChangeEvent event ) + { + Integer tipo = (Integer) drpTipo.getSelected(); + if(tipo.intValue() == MEDICO) + { + Integer medico_id = (Integer) drpNome.getSelected(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + String numero_cedula = adp.getNumeroCedula(medico_id); + stCedula.setText(numero_cedula); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + } + + private Utilizador addUser() throws Exception + { + Utilizador u = fillUser(); + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Integer id = udp.createNewUtilizador( u ); + u.setId( id ); + return u; + } + + private void addPermissao(Utilizador u) throws Exception + { + Permissao p = new Permissao(); + p.setUser_id(u.getId()); + p.setCodigo_permissao(u.getTipo()); + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + udp.createPermissao(p); + } + + private void updateUser() throws Exception + { + Utilizador u = fillUser(); + u.setId(getSessionBean1().getCurrentUser().getId()); + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + udp.updateUtilizador(u); + } + + private void deleteUser() throws Exception + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + udp.deleteUser(getSessionBean1().getCurrentUser().getId()); + } + + private void showUser() + { + Utilizador u = getSessionBean1().getCurrentUser(); + drpTipo.setSelected(u.getTipo()); + if(u.getTipo().intValue() == SEG || u.getTipo().intValue() == RH || u.getTipo().intValue() == HS || u.getTipo().intValue() == MEDICO || u.getTipo().intValue() == GESTOR || u.getTipo().intValue() == DIRECTOR_RH || u.getTipo().intValue() == DIRECTOR_SIPRP) + { + drpNome.setRendered(false); + txtNome.setStyleClass("show"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + txtNome.setText(utils.Utils.unicodeToHTML(u.getNome())); + } + else if(u.getTipo().intValue() == HS) + { + //txtNome.setRendered(false); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + getSessionBean1().setMedicosOptions(adp.getTecnicosSaudeList()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + drpNome.setSelected(u.getFuncionario_hst_id()); + drpNome.setStyleClass("show"); + lblCap.setRendered(true); + txtCap.setRendered(true); + lblCedula.setRendered(false); + stCedula.setRendered(false); + txtCap.setText(u.getCap()); + } + else if(u.getTipo().intValue() == DIRECTOR_LOJA || u.getTipo().intValue() == DIRECTOR_NACIONAL_SEGURANCA) + { + drpNome.setRendered(false); + txtNome.setStyleClass("show"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + lblResponsavelLoja.setRendered(false); + chkResponsavelLoja.setRendered(false); + txtNome.setText(utils.Utils.unicodeToHTML(u.getNome())); + } + else if(u.getTipo().intValue() == MEDICO) //medico + { + drpNome.setRendered(true); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + getSessionBean1().setMedicosOptions(adp.getMedicosList()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + drpNome.setSelected(u.getMedico_id()); + txtNome.setStyleClass("hide"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(true); + stCedula.setRendered(true); + stCedula.setText(u.getNumero_cedula()); + + } + if(u.getEstabelecimento_id() != null) + { + drpEstabelecimentos.setSelected(u.getEstabelecimento_id()); + } + + txtLogin.setText(u.getLogin()); + //txtPassword.setText(u.getPassword()); + txtEmail.setText(u.getEmail()); + } + + private Utilizador fillUser() + { + //Utilizador u = new Utilizador(); + Utilizador u = getSessionBean1().getCurrentUser(); +// u.setActivo("y"); +// u.setAdministrador("n"); +// u.setTipo((Integer) drpTipo.getSelected()); +// u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); +// u.setEstabelecimento_id( (Integer) drpEstabelecimentos.getSelected() ); +// u.setLogin( (String) txtLogin.getText() ); + String password = (String) txtPassword.getText(); + u.setPassword( password ); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date(today.getTime()); + u.setData_password(sqlToday); + + + u.setEmail(""); + if(txtEmail.getText() != null) + { + u.setEmail( (String) txtEmail.getText() ); + } + + Integer tipo = (Integer) drpTipo.getSelected(); + +// u.setNumero_cedula(""); +// u.setCap(""); +// if(tipo.intValue() == HS || tipo.intValue() == MEDICO) +// { +// AnalisesDataProvider adp = new AnalisesDataProvider(); +// if(tipo.intValue() == HS) +// { +// try +// { +// Integer tecnico_id = (Integer) drpNome.getSelected(); +// u.setFuncionario_hst_id(tecnico_id); +// u.setNome( adp.getTecnicoSaudeNome(tecnico_id) ); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// u.setCap( (String) txtCap.getText()); +// } +// else // medico +// { +// try +// { +// Integer medico_id = (Integer) drpNome.getSelected(); +// u.setMedico_id(medico_id); +// u.setNome( adp.getMedicoNome(medico_id) ); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } +// u.setNumero_cedula( (String) stCedula.getText()); +// } +// } +// else +// { +// u.setNome( (String) txtNome.getText() ); +// } + +// u.setResponsavel_loja("n"); +// if(chkResponsavelLoja.getSelected() != null) +// { +// if(chkResponsavelLoja.getSelected().equals(new Boolean(true))) +// { +// u.setResponsavel_loja("y"); +// } +// } +// +// if(u.getGestor_geral() == null) +// { +// u.setGestor_geral("n"); +// } + + u.setPrimeiro_login("n"); + return u; + } + + public String lnkEditUser_action() + { + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String butApagar_action() + { + hidConfDelUser.setValue("apagar"); + return null; + } + + private String navigate() + { + if(isFromPlanos) + { + Utilizador u = getSessionBean1().getCurrentUser(); + // String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } + String nav_from = getSessionBean1().getNavFrom(); + if(nav_from.matches("FormSeguranca")) + { + return "form_seguranca"; + } + else if(nav_from.matches("FormRH")) + { + return "form_rh"; + } + else if(nav_from.matches("FormHS")) + { + return "form_hs"; + } + else if(nav_from.matches("FormMedico")) + { + return "form_medico"; + } + else if(nav_from.matches("AnaliseAcidenteTrabalho")) + { + return "analise_acidente"; + } + else if(nav_from.matches("ViewAnaliseAcidenteTrabalho")) + { + return "view_analise"; + } + else if(nav_from.matches("FormGestor")) + { + return "form_gestor"; + } + else if(nav_from.matches("FormDirGerRh")) + { + return "form_dir_ger_rh"; + } + else if(nav_from.matches("FormDirSiprp")) + { + return "form_dir_siprp"; + } + else if(nav_from.matches("GestaoUtilizadores")) + { + return "gestao_utilizadores"; + } + else if(nav_from.matches("NovoUtilizador")) + { + return "novo_utilizador"; + } + else if(nav_from.matches("Login")) // first login + { + int tipo = getSessionBean1().getCurrentUser().getTipo().intValue(); + switch(tipo) + { + case Global.TIPO_UTILIZADOR_SEGURANCA: + return "form_seguranca"; + case Global.TIPO_UTILIZADOR_RH: + return "form_rh"; + case Global.TIPO_UTILIZADOR_HS: + return "form_hs"; + case Global.TIPO_UTILIZADOR_MEDICO: + return "form_medico"; + case Global.TIPO_UTILIZADOR_GESTOR: + return "form_gestor"; + case Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH: + return "form_dir_ger_rh"; + case Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP: + return "form_dir_siprp"; + case Global.TIPO_UTILIZADOR_DIRECTOR_LOJA: + return "form_gestor"; + case Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA: + return "form_gestor"; + } + } + return null; + } + + public String lnkNewUser_action() + { + if(getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + getSessionBean1().setNavFrom("FormDirGerRh"); + } + else if(getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + getSessionBean1().setNavFrom("FormDirSiprp"); + } + return "gestao_utilizadores"; + } + + public String lnkAjuda_action() + { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Footer.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Footer.java new file mode 100644 index 00000000..52f9e49d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Footer.java @@ -0,0 +1,152 @@ +/* + * Footer.java + * + * Created on September 19, 2007, 10:57 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractFragmentBean; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; + +/** + *

Fragment bean that corresponds to a similarly named JSP page + * fragment. This class contains component definitions (and initialization + * code) for all components that you have defined on this fragment, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class Footer extends AbstractFragmentBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + //
+ + public Footer() { + } + + /** + *

Callback method that is called whenever a page containing + * this page fragment is navigated to, either directly via a URL, + * or indirectly via page navigation. Override this method to acquire + * resources that will be needed for event handlers and lifecycle methods.

+ * + *

The default implementation does nothing.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called. Override this + * method to release resources acquired in the init() + * resources that will be needed for event handlers and lifecycle methods.

+ * + *

The default implementation does nothing.

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormDirGerRh.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormDirGerRh.java new file mode 100644 index 00000000..bcdf5c43 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormDirGerRh.java @@ -0,0 +1,1735 @@ +/* + * FormDirGerRh.java + * + * Created on December 19, 2007, 11:48 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesConcluidasDataProvider; +import db.providers.AnalisesDataProvider; +import db.providers.AnalisesSeguimentoDataProvider; +import global.Global; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormDirGerRh extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() + { + return gridLayoutTop1; + } + + public void setGridLayoutTop1( HtmlPanelGrid hpg ) + { + this.gridLayoutTop1 = hpg; + } + private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento1() + { + return gridSeguimento1; + } + + public void setGridSeguimento1( HtmlPanelGrid hpg ) + { + this.gridSeguimento1 = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() + { + return staticText2; + } + + public void setStaticText2( StaticText st ) + { + this.staticText2 = st; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private Table table1 = new Table(); + + public Table getTable1() + { + return table1; + } + + public void setTable1( Table t ) + { + this.table1 = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() + { + return tableColumn4; + } + + public void setTableColumn4( TableColumn tc ) + { + this.tableColumn4 = tc; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() + { + return tableColumn5; + } + + public void setTableColumn5( TableColumn tc ) + { + this.tableColumn5 = tc; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + private Hyperlink lnkEstabelecimentoSeg = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg() + { + return lnkEstabelecimentoSeg; + } + + public void setLnkEstabelecimentoSeg( Hyperlink h ) + { + this.lnkEstabelecimentoSeg = h; + } + private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos1() + { + return gridConcluidos1; + } + + public void setGridConcluidos1( HtmlPanelGrid hpg ) + { + this.gridConcluidos1 = hpg; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() + { + return tableColumn10; + } + + public void setTableColumn10( TableColumn tc ) + { + this.tableColumn10 = tc; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkDataAberturaSeg = new Hyperlink(); + + public Hyperlink getLnkDataAberturaSeg() + { + return lnkDataAberturaSeg; + } + + public void setLnkDataAberturaSeg( Hyperlink h ) + { + this.lnkDataAberturaSeg = h; + } + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() + { + return tableColumn12; + } + + public void setTableColumn12( TableColumn tc ) + { + this.tableColumn12 = tc; + } + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private Hyperlink lnkDataAberturaConcluida = new Hyperlink(); + + public Hyperlink getLnkDataAberturaConcluida() + { + return lnkDataAberturaConcluida; + } + + public void setLnkDataAberturaConcluida( Hyperlink h ) + { + this.lnkDataAberturaConcluida = h; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + private StaticText labelFilterEstabelecimentoSeg = new StaticText(); + + public StaticText getLabelFilterEstabelecimentoSeg() + { + return labelFilterEstabelecimentoSeg; + } + + public void setLabelFilterEstabelecimentoSeg( StaticText labelFilterEstabelecimentoSeg ) + { + this.labelFilterEstabelecimentoSeg = labelFilterEstabelecimentoSeg; + } + + + + private DropDown dropEstabelecimentosSeguimento = new DropDown(); + public DropDown getDropEstabelecimentosSeguimento() + { + return dropEstabelecimentosSeguimento; + } + public void setDropEstabelecimentosSeguimento( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosSeguimento = dropEstabelecimentos; + } + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar(); +// +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// +// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + + + + private DropDown dropEstabelecimentosConcluidos = new DropDown(); + public DropDown getDropEstabelecimentosConcluidos() + { + return dropEstabelecimentosConcluidos; + } + public void setDropEstabelecimentosConcluidos( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosConcluidos = dropEstabelecimentos; + } + +// private TextField textFilterEstabelecimentoConc = new TextField(); +// public TextField getTextFilterEstabelecimentoConc() +// { +// return textFilterEstabelecimentoConc; +// } +// public void setTextFilterEstabelecimentoConc( TextField textFilterEstabelecimentoConc ) +// { +// this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc; +// } + + + + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormDirGerRh() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormDirGerRh Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + private void fillInitialForm() + { + Integer fromYear = getSelectedYear(); + + try + { + table1.setRendered( true ); + + ArrayList seguimentoList = AnalisesDataProvider.getInstance().getAnalisesSeguimentoDirGerRhList( fromYear ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception ex ) + { + table1.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + table2.setRendered( true ); + + ArrayList concluidasList = AnalisesDataProvider.getInstance().getAnalisesConcluidasList( null, fromYear ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "=== FORM_DIR_GER_RH ===" ); + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + if ( !pageFrom.matches( "FormDirGerRh.jsp" ) + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + Utils.fillEstabelecimentos( dropEstabelecimentosSeguimento, dropEstabelecimentosConcluidos ); + fillInitialForm(); + + fillAnoDropDown(); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public String lnkNewUser_action() + { + return null; + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "FormDirGerRh" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkDataAberturaSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkPorSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkFaseSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkEstabelecimentoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + if ( ano == null ) + { + lblMes.setVisible( false ); + drpMes.setVisible( false ); + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblMes.setVisible( true ); + drpMes.setVisible( true ); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + if ( mes == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblDia.setVisible( true ); + drpDia.setVisible( true ); + //fillDiaDropDown(); + } + } + + public void drpDia_processValueChange( ValueChangeEvent event ) + { + } + + public String butPesquisar_action() + { + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if ( obAno != null ) + { + ano = ( Integer ) obAno; + } + + if ( obMes != null ) + { + mes = ( Integer ) obMes; + } + + if ( obDia != null ) + { + dia = ( Integer ) obDia; + } + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoConc.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoConc.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosConcluidos ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAnalisesConcluidasList( + null, ano, mes, dia, por, nome, estabelecimentoID, getSelectedYear() ); + + table2.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + return null; + } + + public String lnkDataConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkDataAberturaConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkNrConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkPorConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkNomeConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + public String lnkEstabConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirGerRh" ); + return "view_analise"; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkGerirUtilizadores_action() + { + getSessionBean1().setNavFrom( "FormDirGerRh" ); + //getSessionBean1().setModoEdicaoUtilizador("new"); + return "gestao_utilizadores"; + + } + + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList anosList = adp.getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + int i = 1; + while ( iter.hasNext() ) + { + Integer ano = ( Integer ) iter.next(); + + anoOptions[i] = new Option( ano, ano.toString() ); + i++; + } + getSessionBean1().setAnoOptions( anoOptions ); + Calendar cal = new GregorianCalendar(); + int year = cal.get( Calendar.YEAR ); + //drpAno.setSelected( new Integer(year) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[0] = new Option( "", "" ); + mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + Calendar cal = new GregorianCalendar(); + int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + +// private void fillDiaDropDown() +// { +// +// } + public String lnkAjuda_action() + { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos( fc, u ); +// Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); +// FacesContext fc = getFacesContext().getCurrentInstance(); +// try +// { +// JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String buttonFilterSeg_action() + { +// Date visitaDate = ( Date ) calFilterDateSeg.getValue(); + Date visitaDate = calFilterDateSeguimento; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORSeg.getText() != null ) + { + POR = (( String ) textFilterPORSeg.getText()).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameSeg.getText() != null ) + { + nome = (( String ) textFilterNameSeg.getText()).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoSeg.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoSeg.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosSeguimento ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList seguimentoList = adp.searchAnalisesSeguimentoDirGerRh( + nome, estabelecimentoID, visitaDateStr, POR, getSelectedYear() ); + + table1.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception e ) + { + table1.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public void dropCurrentYear_valueChangeListener( ValueChangeEvent event ) + { + Object oldValue = event.getOldValue(); + Object newValue = event.getNewValue(); + + if ( newValue != null && newValue instanceof Integer ) + { + Integer newYear = ( Integer ) newValue; + getSessionBean1().setAnoChoice( newYear); + Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null; + if ( oldYear == null || !newYear.equals( oldYear ) ) + { + fillInitialForm(); + } + } + } + + private Integer getSelectedYear() + { + Integer result = getSessionBean1().getAnoChoice(); + if ( result == null && dropCurrentYear != null ) + { + Object selected = dropCurrentYear.getSelected(); + if ( selected != null && selected instanceof Integer ) + { + result = ( Integer ) selected; + } + } + return result; + } + + private void fillCurrentYearDrop() + { + Integer selectedYear = getSelectedYear(); + + Option[] opts = Utils.getYearDropValues(); + dropCurrentYear.setItems( opts ); + + dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() ); + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormDirSiprp.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormDirSiprp.java new file mode 100755 index 00000000..6d585644 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormDirSiprp.java @@ -0,0 +1,1795 @@ +/* + * FormDirSiprp.java + * + * Created on November 21, 2007, 1:25 PM + * Copyright lluis2 + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesConcluidasDataProvider; +import db.providers.AnalisesDataProvider; +import db.providers.AnalisesSeguimentoDataProvider; +import global.Global; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormDirSiprp extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() + { + return gridLayoutTop1; + } + + public void setGridLayoutTop1( HtmlPanelGrid hpg ) + { + this.gridLayoutTop1 = hpg; + } + private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento1() + { + return gridSeguimento1; + } + + public void setGridSeguimento1( HtmlPanelGrid hpg ) + { + this.gridSeguimento1 = hpg; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() + { + return tableColumn10; + } + + public void setTableColumn10( TableColumn tc ) + { + this.tableColumn10 = tc; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos1() + { + return gridConcluidos1; + } + + public void setGridConcluidos1( HtmlPanelGrid hpg ) + { + this.gridConcluidos1 = hpg; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } + + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private Table table3 = new Table(); + + public Table getTable3() + { + return table3; + } + + public void setTable3( Table t ) + { + this.table3 = t; + } + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() + { + return tableRowGroup3; + } + + public void setTableRowGroup3( TableRowGroup trg ) + { + this.tableRowGroup3 = trg; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() + { + return tableColumn12; + } + + public void setTableColumn12( TableColumn tc ) + { + this.tableColumn12 = tc; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() + { + return tableColumn14; + } + + public void setTableColumn14( TableColumn tc ) + { + this.tableColumn14 = tc; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() + { + return tableColumn15; + } + + public void setTableColumn15( TableColumn tc ) + { + this.tableColumn15 = tc; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } + + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() + { + return staticText9; + } + + public void setStaticText9( StaticText st ) + { + this.staticText9 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() + { + return staticText10; + } + + public void setStaticText10( StaticText st ) + { + this.staticText10 = st; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText txtMsg1 = new StaticText(); + + public StaticText getTxtMsg1() + { + return txtMsg1; + } + + public void setTxtMsg1( StaticText st ) + { + this.txtMsg1 = st; + } + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private Hyperlink lnkDataAberturaSeg1 = new Hyperlink(); + + public Hyperlink getLnkDataAberturaSeg1() + { + return lnkDataAberturaSeg1; + } + + public void setLnkDataAberturaSeg1( Hyperlink h ) + { + this.lnkDataAberturaSeg1 = h; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private Hyperlink lnkDataAberturaConcluida1 = new Hyperlink(); + + public Hyperlink getLnkDataAberturaConcluida1() + { + return lnkDataAberturaConcluida1; + } + + public void setLnkDataAberturaConcluida1( Hyperlink h ) + { + this.lnkDataAberturaConcluida1 = h; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private Hyperlink lnkEstabelecimentoSeg1 = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg1() + { + return lnkEstabelecimentoSeg1; + } + + public void setLnkEstabelecimentoSeg1( Hyperlink h ) + { + this.lnkEstabelecimentoSeg1 = h; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + + + public TableColumn tableColumnDesactivarAnalise = new TableColumn(); + + public TableColumn getTableColumnDesactivarAnalise() + { + return tableColumnDesactivarAnalise; + } + + public void setTableColumnDesactivarAnalise( TableColumn tableColumnDesactivarAnalise ) + { + this.tableColumnDesactivarAnalise = tableColumnDesactivarAnalise; + } + public Button buttonDesactivarAnalise = new Button(); + + public Button getButtonDesactivarAnalise() + { + return buttonDesactivarAnalise; + } + + public void setButtonDesactivarAnalise( Button buttonDesactivarAnalise ) + { + this.buttonDesactivarAnalise = buttonDesactivarAnalise; + } + + + public TableColumn tableColumnDesactivarAnaliseConcluidos = new TableColumn(); + + public TableColumn getTableColumnDesactivarAnaliseConcluidos() + { + return tableColumnDesactivarAnaliseConcluidos; + } + + public void setTableColumnDesactivarAnaliseConcluidos( TableColumn tableColumnDesactivarAnaliseConcluidos ) + { + this.tableColumnDesactivarAnaliseConcluidos = tableColumnDesactivarAnaliseConcluidos; + } + public Button buttonDesactivarAnaliseConcluidos = new Button(); + + public Button getButtonDesactivarAnaliseConcluidos() + { + return buttonDesactivarAnaliseConcluidos; + } + + public void setButtonDesactivarAnaliseConcluidos( Button buttonDesactivarAnaliseConcluidos ) + { + this.buttonDesactivarAnaliseConcluidos = buttonDesactivarAnaliseConcluidos; + } + + + + //
+ private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + private StaticText labelFilterEstabelecimentoSeg = new StaticText(); + + public StaticText getLabelFilterEstabelecimentoSeg() + { + return labelFilterEstabelecimentoSeg; + } + + public void setLabelFilterEstabelecimentoSeg( StaticText labelFilterEstabelecimentoSeg ) + { + this.labelFilterEstabelecimentoSeg = labelFilterEstabelecimentoSeg; + } + + + private DropDown dropEstabelecimentosSeguimento = new DropDown(); + public DropDown getDropEstabelecimentosSeguimento() + { + return dropEstabelecimentosSeguimento; + } + public void setDropEstabelecimentosSeguimento( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosSeguimento = dropEstabelecimentos; + } + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar(); +// +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// +// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + + + private DropDown dropEstabelecimentosConcluidos = new DropDown(); + public DropDown getDropEstabelecimentosConcluidos() + { + return dropEstabelecimentosConcluidos; + } + public void setDropEstabelecimentosConcluidos( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosConcluidos = dropEstabelecimentos; + } + +// private TextField textFilterEstabelecimentoConc = new TextField(); +// public TextField getTextFilterEstabelecimentoConc() +// { +// return textFilterEstabelecimentoConc; +// } +// public void setTextFilterEstabelecimentoConc( TextField textFilterEstabelecimentoConc ) +// { +// this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc; +// } + + + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + + public FormDirSiprp() + { + } + + @Override + public void init() + { + super.init(); + + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormDirSiprp Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + } + + @Override + public void preprocess() + { + txtMsg1.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + } + + private void fillInitialForm() + { + Integer fromYear = getSelectedYear(); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table2.setRendered( true ); + + ArrayList seguimentoList = adp.getAnalisesSeguimentoDirSiprpList( fromYear ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table3.setRendered( true ); + + ArrayList concluidasList = adp.getAnalisesConcluidasList( null, fromYear ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + @Override + public void prerender() + { + System.out.println( "=== FORM_DIR_SIPRP ===" ); + + Utilizador currentUser = getSessionBean1().getCurrentUser(); + lblUser.setText( currentUser == null ? "" : currentUser.getLogin() ); + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + + if ( (!pageFrom.matches( "FormDirSiprp.jsp" )) || getSessionBean1().isFromAnaliseDeletion() + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + Utils.fillEstabelecimentos( dropEstabelecimentosSeguimento, dropEstabelecimentosConcluidos ); + fillInitialForm(); + + fillAnoDropDown(); + } + //Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP + int uType = currentUser == null ? -1 : currentUser.getTipo().intValue(); + boolean renderOrNot = uType == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP; + + tableColumnDesactivarAnalise.setRendered( renderOrNot ); + buttonDesactivarAnalise.setRendered( renderOrNot ); + tableColumnDesactivarAnaliseConcluidos.setRendered( renderOrNot ); +// buttonDesactivarAnaliseConcluidos.setRendered( renderOrNot ); + } + + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "FormDirSiprp" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String lnkDataAcidente_action() + { + return null; + } + + public String lnkNr_action() + { + return null; + } + + public String lnkPor_action() + { + return null; + } + + public String lnkNomeAcidentado_action() + { + return null; + } + + public String lnkFase_action() + { + return null; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkDataAberturaSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkPorSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkFaseSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkEstabelecimentoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + if ( ano == null ) + { + lblMes.setVisible( false ); + drpMes.setVisible( false ); + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblMes.setVisible( true ); + drpMes.setVisible( true ); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + if ( mes == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblDia.setVisible( true ); + drpDia.setVisible( true ); + //fillDiaDropDown(); + } + } + + public void drpDia_processValueChange( ValueChangeEvent event ) + { + } + + public String butPesquisar_action() + { + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if ( obAno != null ) + { + ano = ( Integer ) obAno; + } + + if ( obMes != null ) + { + mes = ( Integer ) obMes; + } + + if ( obDia != null ) + { + dia = ( Integer ) obDia; + } + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoConc.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoConc.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosConcluidos ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList concluidasList = adp.searchAnalisesConcluidasList( + null, ano, mes, dia, por, nome, estabelecimentoID, getSelectedYear() ); + + table3.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + + return null; + } + + public String lnkDataConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkDataAberturaConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkNrConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkPorConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkNomeConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + public String lnkEstabConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormDirSiprp" ); + return "view_analise"; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup3.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkNewUser_action() + { + getSessionBean1().setNavFrom( "FormDirSiprp" ); + //getSessionBean1().setModoEdicaoUtilizador("new"); + return "gestao_utilizadores"; + } + + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList anosList = adp.getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + int i = 1; + while ( iter.hasNext() ) + { + Integer ano = ( Integer ) iter.next(); + + anoOptions[i] = new Option( ano, ano.toString() ); + i++; + } + getSessionBean1().setAnoOptions( anoOptions ); + Calendar cal = new GregorianCalendar(); + int year = cal.get( Calendar.YEAR ); + //drpAno.setSelected( new Integer(year) ); + + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[0] = new Option( "", "" ); + mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + Calendar cal = new GregorianCalendar(); + int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + +// private void fillDiaDropDown() +// { +// +// } + public String lnkAjuda_action() + { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos( fc, u ); +// Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); +// FacesContext fc = getFacesContext().getCurrentInstance(); +// try +// { +// JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String buttonFilterSeg_action() + { +// Date visitaDate = ( Date ) calFilterDateSeg.getValue(); + Date visitaDate = calFilterDateSeguimento; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORSeg.getText() != null ) + { + POR = (( String ) textFilterPORSeg.getText()).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameSeg.getText() != null ) + { + nome = (( String ) textFilterNameSeg.getText()).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoSeg.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoSeg.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosSeguimento ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList seguimentoList = adp.searchAnalisesSeguimentoDirSiprp( + nome, estabelecimentoID, visitaDateStr, POR, getSelectedYear() ); + + table2.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception e ) + { + table2.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public String buttonDesactivarAnalise_action() + { + System.out.println( "\nbuttonDesactivarAnalise_action() : " ); + AnaliseAcidente selectedAnalise = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( selectedAnalise ); + return "confirmar_desactivar"; + } + + public String buttonDesactivarAnaliseConcluidos_action() + { + System.out.println( "\nbuttonDesactivarAnaliseConcluidos_action() : " ); + AnaliseAcidente selectedAnalise = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( selectedAnalise ); + return "confirmar_desactivar"; + } + + public void dropCurrentYear_valueChangeListener( ValueChangeEvent event ) + { + Object oldValue = event.getOldValue(); + Object newValue = event.getNewValue(); + + if ( newValue != null && newValue instanceof Integer ) + { + Integer newYear = ( Integer ) newValue; + getSessionBean1().setAnoChoice( newYear); + Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null; + if ( oldYear == null || !newYear.equals( oldYear ) ) + { + fillInitialForm(); + } + } + } + + private Integer getSelectedYear() + { + Integer result = getSessionBean1().getAnoChoice(); + if ( result == null && dropCurrentYear != null ) + { + Object selected = dropCurrentYear.getSelected(); + if ( selected != null && selected instanceof Integer ) + { + result = ( Integer ) selected; + } + } + return result; + } + + private void fillCurrentYearDrop() + { + Integer selectedYear = getSelectedYear(); + + Option[] opts = Utils.getYearDropValues(); + dropCurrentYear.setItems( opts ); + + dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() ); + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormGestor.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormGestor.java new file mode 100644 index 00000000..e0e85cca --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormGestor.java @@ -0,0 +1,1788 @@ +/* + * FormGestor.java + * + * Created on December 19, 2007, 3:58 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesConcluidasDataProvider; +import db.providers.AnalisesDataProvider; +import db.providers.AnalisesSeguimentoDataProvider; +import global.Global; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormGestor extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() + { + return gridLayoutTop1; + } + + public void setGridLayoutTop1( HtmlPanelGrid hpg ) + { + this.gridLayoutTop1 = hpg; + } + private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento1() + { + return gridSeguimento1; + } + + public void setGridSeguimento1( HtmlPanelGrid hpg ) + { + this.gridSeguimento1 = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() + { + return staticText2; + } + + public void setStaticText2( StaticText st ) + { + this.staticText2 = st; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private Table table1 = new Table(); + + public Table getTable1() + { + return table1; + } + + public void setTable1( Table t ) + { + this.table1 = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() + { + return tableColumn4; + } + + public void setTableColumn4( TableColumn tc ) + { + this.tableColumn4 = tc; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() + { + return tableColumn5; + } + + public void setTableColumn5( TableColumn tc ) + { + this.tableColumn5 = tc; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos1() + { + return gridConcluidos1; + } + + public void setGridConcluidos1( HtmlPanelGrid hpg ) + { + this.gridConcluidos1 = hpg; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() + { + return tableColumn10; + } + + public void setTableColumn10( TableColumn tc ) + { + this.tableColumn10 = tc; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkDataAberturaSeg1 = new Hyperlink(); + + public Hyperlink getLnkDataAberturaSeg1() + { + return lnkDataAberturaSeg1; + } + + public void setLnkDataAberturaSeg1( Hyperlink h ) + { + this.lnkDataAberturaSeg1 = h; + } + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() + { + return tableColumn12; + } + + public void setTableColumn12( TableColumn tc ) + { + this.tableColumn12 = tc; + } + private Hyperlink lnkDataAberturaConcluida1 = new Hyperlink(); + + public Hyperlink getLnkDataAberturaConcluida1() + { + return lnkDataAberturaConcluida1; + } + + public void setLnkDataAberturaConcluida1( Hyperlink h ) + { + this.lnkDataAberturaConcluida1 = h; + } + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private Hyperlink lnkEstabelecimentoSeg1 = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg1() + { + return lnkEstabelecimentoSeg1; + } + + public void setLnkEstabelecimentoSeg1( Hyperlink h ) + { + this.lnkEstabelecimentoSeg1 = h; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + private StaticText labelFilterEstabelecimentoSeg = new StaticText(); + + public StaticText getLabelFilterEstabelecimentoSeg() + { + return labelFilterEstabelecimentoSeg; + } + + public void setLabelFilterEstabelecimentoSeg( StaticText labelFilterEstabelecimentoSeg ) + { + this.labelFilterEstabelecimentoSeg = labelFilterEstabelecimentoSeg; + } + + + private DropDown dropEstabelecimentosSeguimento = new DropDown(); + public DropDown getDropEstabelecimentosSeguimento() + { + return dropEstabelecimentosSeguimento; + } + public void setDropEstabelecimentosSeguimento( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosSeguimento = dropEstabelecimentos; + } + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + + + private DropDown dropEstabelecimentosConcluidos = new DropDown(); + public DropDown getDropEstabelecimentosConcluidos() + { + return dropEstabelecimentosConcluidos; + } + public void setDropEstabelecimentosConcluidos( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosConcluidos = dropEstabelecimentos; + } + +// private TextField textFilterEstabelecimentoConc = new TextField(); +// public TextField getTextFilterEstabelecimentoConc() +// { +// return textFilterEstabelecimentoConc; +// } +// public void setTextFilterEstabelecimentoConc( TextField textFilterEstabelecimentoConc ) +// { +// this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc; +// } + + + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormGestor() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormGestor Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + private void fillInitialForm() + { + Utilizador curUser = getSessionBean1().getCurrentUser(); + Integer fromYear = getSelectedYear(); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Integer estabelecimento_id = null; + table1.setRendered( true ); + ArrayList seguimentoList = null; + + //if(curUser.getGestor_geral().matches("y") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA) + if ( curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR ) + { + estabelecimento_id = curUser.getEstabelecimento_gestor(); + if ( estabelecimento_id == null || estabelecimento_id.intValue() == 0 ) + { + seguimentoList = adp.getAnalisesSeguimentoGestorList( null, fromYear ); + } + else + { + seguimentoList = adp.getAnalisesSeguimentoGestorList( curUser.getEstabelecimento_id(), fromYear ); + } + } + else if ( curUser.getGestor_geral().matches( "y" ) || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA ) + { + seguimentoList = adp.getAnalisesSeguimentoGestorList( null, fromYear ); + } + else if ( curUser.getGestor_geral().matches( "n" ) || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA ) + { + seguimentoList = adp.getAnalisesSeguimentoGestorList( curUser.getEstabelecimento_id(), fromYear ); + } + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception ex ) + { + table1.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + table2.setRendered( true ); + ArrayList concluidasList = null; + Integer estabelecimento_id = getSessionBean1().getCurrentUser().getEstabelecimento_id(); + Integer estabelecimento_gestor_id = curUser.getEstabelecimento_gestor(); + if ( getSessionBean1().getCurrentUser().getGestor_geral().matches( "y" ) || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA + || ( curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR && ( estabelecimento_gestor_id == null || estabelecimento_gestor_id.intValue() == 0 ) ) + /*|| curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA*/ ) + { + concluidasList = adp.getAnalisesConcluidasList( null, fromYear ); + } + else + { + concluidasList = adp.getAnalisesConcluidasList( estabelecimento_id, fromYear ); + } + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "=== FORM_GESTOR ===" ); + Utilizador curUser = getSessionBean1().getCurrentUser(); + lblUser.setText( curUser.getLogin() ); + if ( curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR ) + { + if ( "n".equals( curUser.getGestor_geral() ) ) + { + lnkPlanosActuacao.setDisabled( true ); + } + } + else if ( curUser.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA + && curUser.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_LOJA ) + { + lnkPlanosActuacao.setDisabled( true ); + } + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + if ( !pageFrom.matches( "FormGestor.jsp" ) + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + Utils.fillEstabelecimentos( dropEstabelecimentosSeguimento, dropEstabelecimentosConcluidos ); + fillInitialForm(); + fillAnoDropDown(); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos( fc, u ); + +// Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); +// FacesContext fc = getFacesContext().getCurrentInstance(); +// try +// { +// JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public String lnkGerirUtilizadores_action() + { + return null; + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "FormGestor" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkDataAberturaSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkPorSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkFaseSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkEstabelecimentoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + if ( ano == null ) + { + lblMes.setVisible( false ); + drpMes.setVisible( false ); + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblMes.setVisible( true ); + drpMes.setVisible( true ); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + if ( mes == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblDia.setVisible( true ); + drpDia.setVisible( true ); + //fillDiaDropDown(); + } + } + + public void drpDia_processValueChange( ValueChangeEvent event ) + { + } + + public String butPesquisar_action() + { + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if ( obAno != null ) + { + ano = ( Integer ) obAno; + } + + if ( obMes != null ) + { + mes = ( Integer ) obMes; + } + + if ( obDia != null ) + { + dia = ( Integer ) obDia; + } + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoConc.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoConc.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosConcluidos ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Integer fromYear = getSelectedYear(); + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = null; + if ( getSessionBean1().getCurrentUser().getGestor_geral().matches( "y" ) ) + { + concluidasList = adp.searchAnalisesConcluidasList( + null, ano, mes, dia, por, nome, estabelecimentoID, fromYear ); + } + else + { + concluidasList = adp.searchAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + ano, mes, dia, por, nome, null, fromYear ); + } + + table2.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + + return null; + } + + public String lnkDataConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkDataAberturaConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkNrConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkPorConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkNomeConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + public String lnkEstabConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormGestor" ); + return "view_analise"; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList anosList = adp.getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + int i = 1; + while ( iter.hasNext() ) + { + Integer ano = ( Integer ) iter.next(); + + anoOptions[i] = new Option( ano, ano.toString() ); + i++; + } + getSessionBean1().setAnoOptions( anoOptions ); + Calendar cal = new GregorianCalendar(); + int year = cal.get( Calendar.YEAR ); + //drpAno.setSelected( new Integer(year) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[0] = new Option( "", "" ); + mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + Calendar cal = new GregorianCalendar(); + int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + +// private void fillDiaDropDown() +// { +// +// } + public String lnkAjuda_action() + { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkEstabelecimento_action() + { + return null; + } + + public String buttonFilterSeg_action() + { +// Date visitaDate = ( Date ) calFilterDateSeg.getValue(); + Date visitaDate = calFilterDateSeguimento; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORSeg.getText() != null ) + { + POR = (( String ) textFilterPORSeg.getText()).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameSeg.getText() != null ) + { + nome = (( String ) textFilterNameSeg.getText()).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoSeg.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoSeg.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosSeguimento ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Utilizador curUser = getSessionBean1().getCurrentUser(); + ArrayList seguimentoList = null; + Integer estabelecimento_id = null; + Integer fromYear = getSelectedYear(); + + if ( curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR ) + { + estabelecimento_id = curUser.getEstabelecimento_gestor(); + if ( estabelecimento_id.intValue() == 0 ) + { + seguimentoList = adp.searchAnalisesSeguimentoGestor( null, nome, estabelecimentoID, visitaDateStr, POR, fromYear ); + } + else + { + seguimentoList = adp.searchAnalisesSeguimentoGestor( curUser.getEstabelecimento_id(), nome, estabelecimentoID, visitaDateStr, POR, fromYear ); + } + } + else if ( curUser.getGestor_geral().matches( "y" ) || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA ) + { + seguimentoList = adp.searchAnalisesSeguimentoGestor( null, nome, estabelecimentoID, visitaDateStr, POR, fromYear ); + } + else if ( curUser.getGestor_geral().matches( "n" ) || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA ) + { + seguimentoList = adp.searchAnalisesSeguimentoGestor( curUser.getEstabelecimento_id(), nome, estabelecimentoID, visitaDateStr, POR, fromYear ); + } + + table1.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception e ) + { + table1.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public void dropCurrentYear_valueChangeListener( ValueChangeEvent event ) + { + Object oldValue = event.getOldValue(); + Object newValue = event.getNewValue(); + + if ( newValue != null && newValue instanceof Integer ) + { + Integer newYear = ( Integer ) newValue; + getSessionBean1().setAnoChoice( newYear); + Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null; + if ( oldYear == null || !newYear.equals( oldYear ) ) + { + fillInitialForm(); + } + } + } + + private Integer getSelectedYear() + { + Integer result = getSessionBean1().getAnoChoice(); + if ( result == null && dropCurrentYear != null ) + { + Object selected = dropCurrentYear.getSelected(); + if ( selected != null && selected instanceof Integer ) + { + result = ( Integer ) selected; + } + } + return result; + } + + private void fillCurrentYearDrop() + { + Integer selectedYear = getSelectedYear(); + + Option[] opts = Utils.getYearDropValues(); + dropCurrentYear.setItems( opts ); + + dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() ); + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormHS.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormHS.java new file mode 100644 index 00000000..feaeee1d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormHS.java @@ -0,0 +1,2104 @@ +/* + * FormHS.java + * + * Created on October 1, 2007, 1:43 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesActualDataProvider; +import db.providers.AnalisesConcluidasDataProvider; +import db.providers.AnalisesDataProvider; +import db.providers.AnalisesSeguimentoDataProvider; +import global.Global; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormHS extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() + { + return gridLayoutTop1; + } + + public void setGridLayoutTop1( HtmlPanelGrid hpg ) + { + this.gridLayoutTop1 = hpg; + } + private HtmlPanelGrid gridActual1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridActual1() + { + return gridActual1; + } + + public void setGridActual1( HtmlPanelGrid hpg ) + { + this.gridActual1 = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private Table table1 = new Table(); + + public Table getTable1() + { + return table1; + } + + public void setTable1( Table t ) + { + this.table1 = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + + private Hyperlink lnkDataAcidente = new Hyperlink(); + + public Hyperlink getLnkDataAcidente() + { + return lnkDataAcidente; + } + + public void setLnkDataAcidente( Hyperlink h ) + { + this.lnkDataAcidente = h; + } + + private Hyperlink lnkNr = new Hyperlink(); + + public Hyperlink getLnkNr() + { + return lnkNr; + } + + public void setLnkNr( Hyperlink h ) + { + this.lnkNr = h; + } + private Hyperlink lnkNomeAcidentado = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentado() + { + return lnkNomeAcidentado; + } + + public void setLnkNomeAcidentado( Hyperlink h ) + { + this.lnkNomeAcidentado = h; + } + private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento1() + { + return gridSeguimento1; + } + + public void setGridSeguimento1( HtmlPanelGrid hpg ) + { + this.gridSeguimento1 = hpg; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + + private TableColumn tableColumnActualParticipado = new TableColumn(); + + public TableColumn getTableColumnActualParticipado() + { + return tableColumnActualParticipado; + } + + public void setTableColumnActualParticipado( TableColumn tc ) + { + this.tableColumnActualParticipado = tc; + } + + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() + { + return tableColumn4; + } + + public void setTableColumn4( TableColumn tc ) + { + this.tableColumn4 = tc; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() + { + return tableColumn5; + } + + public void setTableColumn5( TableColumn tc ) + { + this.tableColumn5 = tc; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos1() + { + return gridConcluidos1; + } + + public void setGridConcluidos1( HtmlPanelGrid hpg ) + { + this.gridConcluidos1 = hpg; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() + { + return staticText9; + } + + public void setStaticText9( StaticText st ) + { + this.staticText9 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } + + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private Table table3 = new Table(); + + public Table getTable3() + { + return table3; + } + + public void setTable3( Table t ) + { + this.table3 = t; + } + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() + { + return tableRowGroup3; + } + + public void setTableRowGroup3( TableRowGroup trg ) + { + this.tableRowGroup3 = trg; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() + { + return lnkFase; + } + + public void setLnkFase( Hyperlink h ) + { + this.lnkFase = h; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() + { + return tableColumn14; + } + + public void setTableColumn14( TableColumn tc ) + { + this.tableColumn14 = tc; + } + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() + { + return tableColumn15; + } + + public void setTableColumn15( TableColumn tc ) + { + this.tableColumn15 = tc; + } + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() + { + return lnkPor; + } + + public void setLnkPor( Hyperlink h ) + { + this.lnkPor = h; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } + + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() + { + return staticText10; + } + + public void setStaticText10( StaticText st ) + { + this.staticText10 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() + { + return staticText11; + } + + public void setStaticText11( StaticText st ) + { + this.staticText11 = st; + } + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() + { + return txtMsg; + } + + public void setTxtMsg( StaticText st ) + { + this.txtMsg = st; + } + + private Hyperlink lnkDataAbertura = new Hyperlink(); + + public Hyperlink getLnkDataAbertura() + { + return lnkDataAbertura; + } + + public void setLnkDataAbertura( Hyperlink h ) + { + this.lnkDataAbertura = h; + } + private TableColumn tableColumn17 = new TableColumn(); + + public TableColumn getTableColumn17() + { + return tableColumn17; + } + + public void setTableColumn17( TableColumn tc ) + { + this.tableColumn17 = tc; + } + private Hyperlink lnkDataAberturaSeg = new Hyperlink(); + + public Hyperlink getLnkDataAberturaSeg() + { + return lnkDataAberturaSeg; + } + + public void setLnkDataAberturaSeg( Hyperlink h ) + { + this.lnkDataAberturaSeg = h; + } + private TableColumn tableColumn18 = new TableColumn(); + + public TableColumn getTableColumn18() + { + return tableColumn18; + } + + public void setTableColumn18( TableColumn tc ) + { + this.tableColumn18 = tc; + } + private Hyperlink lnkDataAberturaConcluida = new Hyperlink(); + + public Hyperlink getLnkDataAberturaConcluida() + { + return lnkDataAberturaConcluida; + } + + public void setLnkDataAberturaConcluida( Hyperlink h ) + { + this.lnkDataAberturaConcluida = h; + } + + private Hyperlink lnkEstabelecimento = new Hyperlink(); + + public Hyperlink getLnkEstabelecimento() + { + return lnkEstabelecimento; + } + + public void setLnkEstabelecimento( Hyperlink h ) + { + this.lnkEstabelecimento = h; + } + private TableColumn tableColumn20 = new TableColumn(); + + public TableColumn getTableColumn20() + { + return tableColumn20; + } + + public void setTableColumn20( TableColumn tc ) + { + this.tableColumn20 = tc; + } + private Hyperlink lnkEstabelecimentoSeg = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg() + { + return lnkEstabelecimentoSeg; + } + + public void setLnkEstabelecimentoSeg( Hyperlink h ) + { + this.lnkEstabelecimentoSeg = h; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + private HtmlPanelGrid gridPanelFilterActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterActual() + { + return this.gridPanelFilterActual; + } + + public void setGridPanelFilterActual( HtmlPanelGrid pg ) + { + this.gridPanelFilterActual = pg; + } + private PanelGroup groupPanelFilterActual = new PanelGroup(); + + public PanelGroup getGroupPanelFilterActual() + { + return this.groupPanelFilterActual; + } + + public void setGroupPanelFilterActual( PanelGroup pg ) + { + this.groupPanelFilterActual = pg; + } + private StaticText labelFilterNameActual = new StaticText(); + + public StaticText getLabelFilterNameActual() + { + return this.labelFilterNameActual; + } + + public void setLabelFilterNameActual( StaticText st ) + { + this.labelFilterNameActual = st; + } + private TextField textFilterNameActual = new TextField(); + + public TextField getTextFilterNameActual() + { + return this.textFilterNameActual; + } + + public void setTextFilterNameActual( TextField tf ) + { + this.textFilterNameActual = tf; + } + private StaticText labelFilterEstabelecimentoActual = new StaticText(); + + public StaticText getLabelFilterEstabelecimentoActual() + { + return labelFilterEstabelecimentoActual; + } + + public void setLabelFilterEstabelecimentoActual( StaticText labelFilterEstabelecimentoActual ) + { + this.labelFilterEstabelecimentoActual = labelFilterEstabelecimentoActual; + } + + + private DropDown dropEstabelecimentosActuais = new DropDown(); + public DropDown getDropEstabelecimentosActuais() + { + return dropEstabelecimentosActuais; + } + public void setDropEstabelecimentosActuais( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosActuais = dropEstabelecimentos; + } + + +// private Calendar calFilterDateActual = new Calendar(); +// public Calendar getCalFilterDateActual() +// { +// return this.calFilterDateActual; +// } +// public void setCalFilterDateActual( Calendar c ) +// { +// this.calFilterDateActual = c; +// } + + private Date calFilterDateActual = null; + public Date getCalFilterDateActual() + { + return calFilterDateActual; + } + public void setCalFilterDateActual( Date calFilterDateActual ) + { + this.calFilterDateActual = calFilterDateActual; + } + + + + + private TextField textFilterPORActual = new TextField(); + + public TextField getTextFilterPORActual() + { + return textFilterPORActual; + } + + public void setTextFilterPORActual( TextField textFilterPORActual ) + { + this.textFilterPORActual = textFilterPORActual; + } + private Button buttonFilterActual = new Button(); + + public Button getButtonFilterActual() + { + return this.buttonFilterActual; + } + + public void setButtonFilterActual( Button b ) + { + this.buttonFilterActual = b; + } + private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + private StaticText labelFilterEstabelecimentoSeg = new StaticText(); + + public StaticText getLabelFilterEstabelecimentoSeg() + { + return labelFilterEstabelecimentoSeg; + } + + public void setLabelFilterEstabelecimentoSeg( StaticText labelFilterEstabelecimentoSeg ) + { + this.labelFilterEstabelecimentoSeg = labelFilterEstabelecimentoSeg; + } + + + private DropDown dropEstabelecimentosSeguimento = new DropDown(); + public DropDown getDropEstabelecimentosSeguimento() + { + return dropEstabelecimentosSeguimento; + } + public void setDropEstabelecimentosSeguimento( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosSeguimento = dropEstabelecimentos; + } + + +// private Calendar calFilterDateSeg = new Calendar(); +// public Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// public void setCalFilterDateSeg( Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + + + private DropDown dropEstabelecimentosConcluidos = new DropDown(); + public DropDown getDropEstabelecimentosConcluidos() + { + return dropEstabelecimentosConcluidos; + } + public void setDropEstabelecimentosConcluidos( DropDown dropEstabelecimentos ) + { + this.dropEstabelecimentosConcluidos = dropEstabelecimentos; + } + +// private TextField textFilterEstabelecimentoConc = new TextField(); +// public TextField getTextFilterEstabelecimentoConc() +// { +// return textFilterEstabelecimentoConc; +// } +// public void setTextFilterEstabelecimentoConc( TextField textFilterEstabelecimentoConc ) +// { +// this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc; +// } + + + + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormHS() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormHS Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + private void fillInitialForm() + { + Integer fromYear = getSelectedYear(); + + try + { + getSessionBean1().getAnalisesActualDataProvider().setList( null ); + ArrayList actuaisList = AnalisesDataProvider.getInstance().getAnalisesActuaisHsList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), fromYear ); + getSessionBean1().getAnalisesActualDataProvider().setList( actuaisList ); + table1.setRendered( true ); + } + catch ( Exception ex ) + { + table1.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( null ); + ArrayList seguimentoList = AnalisesDataProvider.getInstance().getAnalisesSeguimentoHsList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), fromYear ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + table2.setRendered( true ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + getSessionBean1().getAnalisesConcluidasDataProvider().setList( null ); + ArrayList concluidasList = AnalisesDataProvider.getInstance().getAnalisesConcluidasHsList( fromYear ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + table3.setRendered( true ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "=== FORM_HS ===" ); + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + System.out.println( "PAGE FROM : " + pageFrom ); + if ( ! pageFrom.matches( "FormHS.jsp" ) || getSessionBean1().isFromAnaliseDeletion() + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + Utils.fillEstabelecimentos( dropEstabelecimentosActuais, dropEstabelecimentosSeguimento, dropEstabelecimentosConcluidos ); + fillInitialForm(); + + fillAnoDropDown(); + } + + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String lnkDataAcidente_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + public String lnkDataAbertura_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + public String lnkNr_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + public String lnkNomeAcidentado_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + private AnaliseAcidente getTableActivosRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesActualDataProvider provider = ( AnalisesActualDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkDataAberturaSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup3.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + + lblMes.setVisible( ano != null ); + drpMes.setVisible( ano != null ); + + if ( ano == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + lblDia.setVisible( mes != null ); + drpDia.setVisible( mes != null ); + } + + public void drpDia_processValueChange( ValueChangeEvent event ) + { + } + + public String butPesquisar_action() + { + Object obAno = drpAno == null ? null : drpAno.getSelected(); + Object obMes = drpMes == null ? null : drpMes.getSelected(); + Object obDia = drpDia == null ? null : drpDia.getSelected(); + + Integer ano = obAno == null ? null : ( Integer ) obAno; + Integer mes = obMes == null ? null : ( Integer ) obMes; + Integer dia = obDia == null ? null : ( Integer ) obDia; + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoConc.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoConc.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosConcluidos ); + + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList concluidasList = adp.searchAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + ano, mes, dia, por, nome, estabelecimentoID, getSelectedYear() ); + + table3.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + + return null; + } + + private void fillAnoDropDown() + { + try + { + ArrayList anosList = AnalisesDataProvider.getInstance().getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[ 0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + for ( int i = 1; iter.hasNext(); i++ ) + { + Integer ano = ( Integer ) iter.next(); + anoOptions[i] = new Option( ano, ano.toString() ); + } + getSessionBean1().setAnoOptions( anoOptions ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[ 0] = new Option( "", "" ); + mesOptions[ 1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[ 2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[ 3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[ 4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[ 5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[ 6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[ 7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[ 8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[ 9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[ 10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[ 11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[ 12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "FormHS" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkDataConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkDataAberturaConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkNrConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkNomeConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkFase_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + public String lnkEstabelecimento_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkEstabelecimentoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkPor_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "analise_acidente"; + } + + public String lnkPorSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHs" ); + return "view_analise"; + } + + public String lnkPorConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkEstabConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormHS" ); + return "view_analise"; + } + + public String lnkNewUser_action() + { + return null; + } + + public String lnkAjuda_action() + { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos( fc, u ); + return null; + } + + public String buttonFilterActual_action() + { +// Date visitaDate = ( Date ) calFilterDateActual.getValue(); + Date visitaDate = calFilterDateActual; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORActual.getText() != null ) + { + POR = (( String ) textFilterPORActual.getText()).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameActual.getText() != null ) + { + nome = (( String ) textFilterNameActual.getText()).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoActual.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoActual.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosActuais ); + + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList actualList = adp.searchAnalisesActuaisHS( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + nome, estabelecimentoID, visitaDateStr, POR, getSelectedYear() ); + + table1.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesActualDataProvider().setList( actualList ); + } + catch ( Exception e ) + { + table1.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public String buttonFilterSeg_action() + { +// Date visitaDate = ( Date ) calFilterDateSeg.getValue(); + Date visitaDate = calFilterDateSeguimento; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORSeg.getText() != null ) + { + POR = (( String ) textFilterPORSeg.getText()).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameSeg.getText() != null ) + { + nome = (( String ) textFilterNameSeg.getText()).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + + +// String estabelecimento = null; +// if ( textFilterEstabelecimentoSeg.getText() != null ) +// { +// estabelecimento = (( String ) textFilterEstabelecimentoSeg.getText()).trim(); +// if ( estabelecimento.length() == 0 ) +// { +// estabelecimento = null; +// } +// } + Integer estabelecimentoID = Utils.getSelectedID( dropEstabelecimentosSeguimento ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList seguimentoList = adp.searchAnalisesSeguimentoHS( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + nome, estabelecimentoID, visitaDateStr, POR, getSelectedYear() ); + + table2.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception e ) + { + table2.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + return null; + } + + private Integer getSelectedYear() + { + Integer result = getSessionBean1().getAnoChoice(); + if ( result == null && dropCurrentYear != null ) + { + Object selected = dropCurrentYear.getSelected(); + if ( selected != null && selected instanceof Integer ) + { + result = ( Integer ) selected; + } + } + return result; + } + + private void fillCurrentYearDrop() + { + Integer selectedYear = getSelectedYear(); + + Option[] opts = Utils.getYearDropValues(); + dropCurrentYear.setItems( opts ); + + dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() ); + } + + public void dropCurrentYear_valueChangeListener( ValueChangeEvent event ) + { + Object oldValue = event.getOldValue(); + Object newValue = event.getNewValue(); + + if ( newValue != null && newValue instanceof Integer ) + { + Integer newYear = ( Integer ) newValue; + getSessionBean1().setAnoChoice( newYear); + Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null; + if ( oldYear == null || !newYear.equals( oldYear ) ) + { + fillInitialForm(); + } + } + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormMedico.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormMedico.java new file mode 100644 index 00000000..b2214676 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormMedico.java @@ -0,0 +1,1992 @@ +/* + * FormMedico.java + * + * Created on October 22, 2007, 1:56 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesActualDataProvider; +import db.providers.AnalisesConcluidasDataProvider; +import db.providers.AnalisesDataProvider; +import db.providers.AnalisesSeguimentoDataProvider; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormMedico extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() + { + return groupPanel2; + } + + public void setGroupPanel2( PanelGroup pg ) + { + this.groupPanel2 = pg; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() + { + return staticText1; + } + + public void setStaticText1( StaticText st ) + { + this.staticText1 = st; + } + private Hyperlink lnkEditUser = new Hyperlink(); + + public Hyperlink getLnkEditUser() + { + return lnkEditUser; + } + + public void setLnkEditUser( Hyperlink h ) + { + this.lnkEditUser = h; + } + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() + { + return staticText2; + } + + public void setStaticText2( StaticText st ) + { + this.staticText2 = st; + } + private Hyperlink lnkLogout = new Hyperlink(); + + public Hyperlink getLnkLogout() + { + return lnkLogout; + } + + public void setLnkLogout( Hyperlink h ) + { + this.lnkLogout = h; + } + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() + { + return gridLayoutTop1; + } + + public void setGridLayoutTop1( HtmlPanelGrid hpg ) + { + this.gridLayoutTop1 = hpg; + } + private HtmlPanelGrid gridActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridActual() + { + return gridActual; + } + + public void setGridActual( HtmlPanelGrid hpg ) + { + this.gridActual = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private Table table1 = new Table(); + + public Table getTable1() + { + return table1; + } + + public void setTable1( Table t ) + { + this.table1 = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private Hyperlink lnkDataAcidente = new Hyperlink(); + + public Hyperlink getLnkDataAcidente() + { + return lnkDataAcidente; + } + + public void setLnkDataAcidente( Hyperlink h ) + { + this.lnkDataAcidente = h; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private Hyperlink lnkNr = new Hyperlink(); + + public Hyperlink getLnkNr() + { + return lnkNr; + } + + public void setLnkNr( Hyperlink h ) + { + this.lnkNr = h; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private Hyperlink lnkNomeAcidentado = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentado() + { + return lnkNomeAcidentado; + } + + public void setLnkNomeAcidentado( Hyperlink h ) + { + this.lnkNomeAcidentado = h; + } + private HtmlPanelGrid gridSeguimento = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento() + { + return gridSeguimento; + } + + public void setGridSeguimento( HtmlPanelGrid hpg ) + { + this.gridSeguimento = hpg; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() + { + return tableColumn4; + } + + public void setTableColumn4( TableColumn tc ) + { + this.tableColumn4 = tc; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() + { + return tableColumn5; + } + + public void setTableColumn5( TableColumn tc ) + { + this.tableColumn5 = tc; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private HtmlPanelGrid gridConcluidos = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos() + { + return gridConcluidos; + } + + public void setGridConcluidos( HtmlPanelGrid hpg ) + { + this.gridConcluidos = hpg; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() + { + return staticText9; + } + + public void setStaticText9( StaticText st ) + { + this.staticText9 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } + + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private Table table3 = new Table(); + + public Table getTable3() + { + return table3; + } + + public void setTable3( Table t ) + { + this.table3 = t; + } + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() + { + return tableRowGroup3; + } + + public void setTableRowGroup3( TableRowGroup trg ) + { + this.tableRowGroup3 = trg; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() + { + return tableColumn10; + } + + public void setTableColumn10( TableColumn tc ) + { + this.tableColumn10 = tc; + } + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() + { + return lnkFase; + } + + public void setLnkFase( Hyperlink h ) + { + this.lnkFase = h; + } + private Hyperlink lnkEstabelecimento = new Hyperlink(); + + public Hyperlink getLnkEstabelecimento() + { + return lnkEstabelecimento; + } + + public void setLnkEstabelecimento( Hyperlink h ) + { + this.lnkEstabelecimento = h; + } + private TableColumn tableColumn16 = new TableColumn(); + + public TableColumn getTableColumn16() + { + return tableColumn16; + } + + public void setTableColumn16( TableColumn tc ) + { + this.tableColumn16 = tc; + } + private TableColumn tableColumn17 = new TableColumn(); + + public TableColumn getTableColumn17() + { + return tableColumn17; + } + + public void setTableColumn17( TableColumn tc ) + { + this.tableColumn17 = tc; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + private Hyperlink lnkEstabelecimentoSeg = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg() + { + return lnkEstabelecimentoSeg; + } + + public void setLnkEstabelecimentoSeg( Hyperlink h ) + { + this.lnkEstabelecimentoSeg = h; + } + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() + { + return tableColumn12; + } + + public void setTableColumn12( TableColumn tc ) + { + this.tableColumn12 = tc; + } + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() + { + return tableColumn14; + } + + public void setTableColumn14( TableColumn tc ) + { + this.tableColumn14 = tc; + } + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() + { + return tableColumn15; + } + + public void setTableColumn15( TableColumn tc ) + { + this.tableColumn15 = tc; + } + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() + { + return lnkPor; + } + + public void setLnkPor( Hyperlink h ) + { + this.lnkPor = h; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } + + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() + { + return staticText10; + } + + public void setStaticText10( StaticText st ) + { + this.staticText10 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() + { + return staticText11; + } + + public void setStaticText11( StaticText st ) + { + this.staticText11 = st; + } + private HtmlPanelGrid gridPanelFilterActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterActual() + { + return this.gridPanelFilterActual; + } + + public void setGridPanelFilterActual( HtmlPanelGrid pg ) + { + this.gridPanelFilterActual = pg; + } + private PanelGroup groupPanelFilterActual = new PanelGroup(); + + public PanelGroup getGroupPanelFilterActual() + { + return this.groupPanelFilterActual; + } + + public void setGroupPanelFilterActual( PanelGroup pg ) + { + this.groupPanelFilterActual = pg; + } + private StaticText labelFilterNameActual = new StaticText(); + + public StaticText getLabelFilterNameActual() + { + return this.labelFilterNameActual; + } + + public void setLabelFilterNameActual( StaticText st ) + { + this.labelFilterNameActual = st; + } + private TextField textFilterNameActual = new TextField(); + + public TextField getTextFilterNameActual() + { + return this.textFilterNameActual; + } + + public void setTextFilterNameActual( TextField tf ) + { + this.textFilterNameActual = tf; + } + + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateActual = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateActual() +// { +// return this.calFilterDateActual; +// } +// public void setCalFilterDateActual( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateActual = c; +// } + + private Date calFilterDateActual = null; + public Date getCalFilterDateActual() + { + return calFilterDateActual; + } + public void setCalFilterDateActual( Date calFilterDateActual ) + { + this.calFilterDateActual = calFilterDateActual; + } + + + private TextField textFilterPORActual = new TextField(); + + public TextField getTextFilterPORActual() + { + return textFilterPORActual; + } + + public void setTextFilterPORActual( TextField textFilterPORActual ) + { + this.textFilterPORActual = textFilterPORActual; + } + private Button buttonFilterActual = new Button(); + + public Button getButtonFilterActual() + { + return this.buttonFilterActual; + } + + public void setButtonFilterActual( Button b ) + { + this.buttonFilterActual = b; + } + private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormMedico() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormMedico Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + private void fillInitialForm() + { + Integer fromYear = getSelectedYear(); + + try + { + table1.setRendered( true ); + +// ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(5)); +// ArrayList actuaisList = adp.getAnalisesActuaisMedicoList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); +// getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); + } + catch ( Exception ex ) + { + table1.setRendered( false ); + ErrorLogger.logException( ex ); + } + + table2.setRendered( false ); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + table2.setRendered( true ); + + ArrayList seguimentoList = adp.getAnalisesSeguimentoMedList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), fromYear ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table3.setRendered( true ); + + ArrayList concluidasList = adp.getAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), fromYear ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + if ( !pageFrom.matches( "FormMedico.jsp" ) + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + fillInitialForm(); + + fillAnoDropDown(); + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom( "FormMedico" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), false ); + return "login"; + } + + public String lnkDataAcidente_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "analise_acidente"; + } + + public String lnkNr_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "analise_acidente"; + } + + public String lnkNomeAcidentado_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "analise_acidente"; + } + + private AnaliseAcidente getTableActivosRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesActualDataProvider provider = ( AnalisesActualDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup3.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + if ( ano == null ) + { + lblMes.setVisible( false ); + drpMes.setVisible( false ); + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblMes.setVisible( true ); + drpMes.setVisible( true ); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + if ( mes == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblDia.setVisible( true ); + drpDia.setVisible( true ); + fillDiaDropDown(); + } + } + + public void drpDia_processValueChange( ValueChangeEvent event ) + { + } + + public String butPesquisar_action() + { + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if ( obAno != null ) + { + ano = ( Integer ) obAno; + } + + if ( obMes != null ) + { + mes = ( Integer ) obMes; + } + + if ( obDia != null ) + { + dia = ( Integer ) obDia; + } + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList concluidasList = adp.searchAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + ano, mes, dia, por, nome, null, getSelectedYear() ); + + table3.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + return null; + } + + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList anosList = adp.getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + int i = 1; + while ( iter.hasNext() ) + { + Integer ano = ( Integer ) iter.next(); + + anoOptions[i] = new Option( ano, ano.toString() ); + i++; + } + getSessionBean1().setAnoOptions( anoOptions ); + Calendar cal = new GregorianCalendar(); + int year = cal.get( Calendar.YEAR ); + //drpAno.setSelected( new Integer(year) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[0] = new Option( "", "" ); + mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + Calendar cal = new GregorianCalendar(); + int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + + private void fillDiaDropDown() + { + } + + public String lnkDataConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkNrConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkNomeConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkFase_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "analise_acidente"; + } + + public String lnkEstabelecimento_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkEstabelecimentoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkPor_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "analise_acidente"; + } + + public String lnkPorSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkPorConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String lnkEstabConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormMedico" ); + return "view_analise"; + } + + public String buttonFilterActual_action() + { +// Date visitaDate = ( Date ) calFilterDateActual.getValue(); + Date visitaDate = calFilterDateActual; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORActual.getText() != null ) + { + POR = ( ( String ) textFilterPORActual.getText() ).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameActual.getText() != null ) + { + nome = ( ( String ) textFilterNameActual.getText() ).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + + try + { +// ArrayList actualList = adp.searchAnalisesActuaisMedico( +// getSessionBean1().getCurrentUser().getEstabelecimento_id(), nome, visitaDateStr ); + + table1.setRendered( true ); + txtSearchMsg.setRendered( false ); +// getSessionBean1().getAnalisesActualDataProvider().setList( actualList ); + } + catch ( Exception e ) + { + table1.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public String buttonFilterSeg_action() + { +// Date visitaDate = ( Date ) calFilterDateSeg.getValue(); + Date visitaDate = calFilterDateSeguimento; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORSeg.getText() != null ) + { + POR = ( ( String ) textFilterPORSeg.getText() ).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameSeg.getText() != null ) + { + nome = ( ( String ) textFilterNameSeg.getText() ).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList seguimentoList = adp.searchAnalisesSeguimentoMedico( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + nome, visitaDateStr, POR, getSelectedYear() ); + + table2.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception e ) + { + table2.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public void dropCurrentYear_valueChangeListener( ValueChangeEvent event ) + { + Object oldValue = event.getOldValue(); + Object newValue = event.getNewValue(); + + if ( newValue != null && newValue instanceof Integer ) + { + Integer newYear = ( Integer ) newValue; + getSessionBean1().setAnoChoice( newYear); + Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null; + if ( oldYear == null || !newYear.equals( oldYear ) ) + { + fillInitialForm(); + } + } + } + + private Integer getSelectedYear() + { + Integer result = getSessionBean1().getAnoChoice(); + if ( result == null && dropCurrentYear != null ) + { + Object selected = dropCurrentYear.getSelected(); + if ( selected != null && selected instanceof Integer ) + { + result = ( Integer ) selected; + } + } + return result; + } + + private void fillCurrentYearDrop() + { + Integer selectedYear = getSelectedYear(); + + Option[] opts = Utils.getYearDropValues(); + dropCurrentYear.setItems( opts ); + + dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() ); + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormRH.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormRH.java new file mode 100644 index 00000000..05797272 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/FormRH.java @@ -0,0 +1,2224 @@ +/* + * FormRH.java + * + * Created on October 1, 2007, 11:43 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesActualDataProvider; +import db.providers.AnalisesConcluidasDataProvider; +import db.providers.AnalisesDataProvider; +import db.providers.AnalisesSeguimentoDataProvider; +import global.Global; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormRH extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } + + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } + + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop1() + { + return gridLayoutTop1; + } + + public void setGridLayoutTop1( HtmlPanelGrid hpg ) + { + this.gridLayoutTop1 = hpg; + } + private HtmlPanelGrid gridActual1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridActual1() + { + return gridActual1; + } + + public void setGridActual1( HtmlPanelGrid hpg ) + { + this.gridActual1 = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private Table table1 = new Table(); + + public Table getTable1() + { + return table1; + } + + public void setTable1( Table t ) + { + this.table1 = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + + private TableColumn tableColumnActualParticipado = new TableColumn(); + + public TableColumn getTableColumnActualParticipado() + { + return tableColumnActualParticipado; + } + + public void setTableColumnActualParticipado( TableColumn tc ) + { + this.tableColumnActualParticipado = tc; + } + + private TableColumn tableColumnSeguimentoParticipado = new TableColumn(); + + public TableColumn getTableColumnSeguimentoParticipado() + { + return tableColumnSeguimentoParticipado; + } + + public void setTableColumnSeguimentoParticipado( TableColumn tc ) + { + this.tableColumnSeguimentoParticipado = tc; + } + + private TableColumn tableColumnConcluidoParticipado = new TableColumn(); + + public TableColumn getTableColumnConcluidoParticipado() + { + return tableColumnConcluidoParticipado; + } + + public void setTableColumnConcluidoParticipado( TableColumn tc ) + { + this.tableColumnConcluidoParticipado = tc; + } + + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private Hyperlink lnkDataAcidente = new Hyperlink(); + + public Hyperlink getLnkDataAcidente() + { + return lnkDataAcidente; + } + + public void setLnkDataAcidente( Hyperlink h ) + { + this.lnkDataAcidente = h; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private Hyperlink lnkNr = new Hyperlink(); + + public Hyperlink getLnkNr() + { + return lnkNr; + } + + public void setLnkNr( Hyperlink h ) + { + this.lnkNr = h; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private Hyperlink lnkNomeAcidentado = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentado() + { + return lnkNomeAcidentado; + } + + public void setLnkNomeAcidentado( Hyperlink h ) + { + this.lnkNomeAcidentado = h; + } + private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento1() + { + return gridSeguimento1; + } + + public void setGridSeguimento1( HtmlPanelGrid hpg ) + { + this.gridSeguimento1 = hpg; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() + { + return tableColumn4; + } + + public void setTableColumn4( TableColumn tc ) + { + this.tableColumn4 = tc; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() + { + return tableColumn5; + } + + public void setTableColumn5( TableColumn tc ) + { + this.tableColumn5 = tc; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos1() + { + return gridConcluidos1; + } + + public void setGridConcluidos1( HtmlPanelGrid hpg ) + { + this.gridConcluidos1 = hpg; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } + + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() + { + return staticText9; + } + + public void setStaticText9( StaticText st ) + { + this.staticText9 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } + + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private Table table3 = new Table(); + + public Table getTable3() + { + return table3; + } + + public void setTable3( Table t ) + { + this.table3 = t; + } + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() + { + return tableRowGroup3; + } + + public void setTableRowGroup3( TableRowGroup trg ) + { + this.tableRowGroup3 = trg; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() + { + return tableColumn10; + } + + public void setTableColumn10( TableColumn tc ) + { + this.tableColumn10 = tc; + } + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() + { + return lnkFase; + } + + public void setLnkFase( Hyperlink h ) + { + this.lnkFase = h; + } + private Hyperlink lnkEstabelecimento = new Hyperlink(); + + public Hyperlink getLnkEstabelecimento() + { + return lnkEstabelecimento; + } + + public void setLnkEstabelecimento( Hyperlink h ) + { + this.lnkEstabelecimento = h; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + private Hyperlink lnkEstabelecimentoSeg = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg() + { + return lnkEstabelecimentoSeg; + } + + public void setLnkEstabelecimentoSeg( Hyperlink h ) + { + this.lnkEstabelecimentoSeg = h; + } + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() + { + return tableColumn12; + } + + public void setTableColumn12( TableColumn tc ) + { + this.tableColumn12 = tc; + } + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() + { + return tableColumn14; + } + + public void setTableColumn14( TableColumn tc ) + { + this.tableColumn14 = tc; + } + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() + { + return tableColumn15; + } + + public void setTableColumn15( TableColumn tc ) + { + this.tableColumn15 = tc; + } + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() + { + return lnkPor; + } + + public void setLnkPor( Hyperlink h ) + { + this.lnkPor = h; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } + + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() + { + return staticText1; + } + + public void setStaticText1( StaticText st ) + { + this.staticText1 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() + { + return staticText10; + } + + public void setStaticText10( StaticText st ) + { + this.staticText10 = st; + } + private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel10() + { + return gridPanel10; + } + + public void setGridPanel10( HtmlPanelGrid hpg ) + { + this.gridPanel10 = hpg; + } + private StaticText txtMsg1 = new StaticText(); + + public StaticText getTxtMsg1() + { + return txtMsg1; + } + + public void setTxtMsg1( StaticText st ) + { + this.txtMsg1 = st; + } + private TableColumn tableColumn16 = new TableColumn(); + + public TableColumn getTableColumn16() + { + return tableColumn16; + } + + public void setTableColumn16( TableColumn tc ) + { + this.tableColumn16 = tc; + } + private Hyperlink lnkDataAbertura = new Hyperlink(); + + public Hyperlink getLnkDataAbertura() + { + return lnkDataAbertura; + } + + public void setLnkDataAbertura( Hyperlink h ) + { + this.lnkDataAbertura = h; + } + private TableColumn tableColumn17 = new TableColumn(); + + public TableColumn getTableColumn17() + { + return tableColumn17; + } + + public void setTableColumn17( TableColumn tc ) + { + this.tableColumn17 = tc; + } + private Hyperlink lnkDataAberturaSeg = new Hyperlink(); + + public Hyperlink getLnkDataAberturaSeg() + { + return lnkDataAberturaSeg; + } + + public void setLnkDataAberturaSeg( Hyperlink h ) + { + this.lnkDataAberturaSeg = h; + } + private TableColumn tableColumn18 = new TableColumn(); + + public TableColumn getTableColumn18() + { + return tableColumn18; + } + + public void setTableColumn18( TableColumn tc ) + { + this.tableColumn18 = tc; + } + private TableColumn tableColumn19 = new TableColumn(); + + public TableColumn getTableColumn19() + { + return tableColumn19; + } + + public void setTableColumn19( TableColumn tc ) + { + this.tableColumn19 = tc; + } + private TableColumn tableColumn20 = new TableColumn(); + + public TableColumn getTableColumn20() + { + return tableColumn20; + } + + public void setTableColumn20( TableColumn tc ) + { + this.tableColumn20 = tc; + } + private Hyperlink lnkDataAberturaConcluida = new Hyperlink(); + + public Hyperlink getLnkDataAberturaConcluida() + { + return lnkDataAberturaConcluida; + } + + public void setLnkDataAberturaConcluida( Hyperlink h ) + { + this.lnkDataAberturaConcluida = h; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + private HtmlPanelGrid gridPanelFilterActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterActual() + { + return this.gridPanelFilterActual; + } + + public void setGridPanelFilterActual( HtmlPanelGrid pg ) + { + this.gridPanelFilterActual = pg; + } + private PanelGroup groupPanelFilterActual = new PanelGroup(); + + public PanelGroup getGroupPanelFilterActual() + { + return this.groupPanelFilterActual; + } + + public void setGroupPanelFilterActual( PanelGroup pg ) + { + this.groupPanelFilterActual = pg; + } + private StaticText labelFilterNameActual = new StaticText(); + + public StaticText getLabelFilterNameActual() + { + return this.labelFilterNameActual; + } + + public void setLabelFilterNameActual( StaticText st ) + { + this.labelFilterNameActual = st; + } + private TextField textFilterNameActual = new TextField(); + + public TextField getTextFilterNameActual() + { + return this.textFilterNameActual; + } + + public void setTextFilterNameActual( TextField tf ) + { + this.textFilterNameActual = tf; + } + + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateActual = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateActual() +// { +// return this.calFilterDateActual; +// } +// public void setCalFilterDateActual( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateActual = c; +// } + + private Date calFilterDateActual = null; + public Date getCalFilterDateActual() + { + return calFilterDateActual; + } + public void setCalFilterDateActual( Date calFilterDateActual ) + { + this.calFilterDateActual = calFilterDateActual; + } + + + + private TextField textFilterPORActual = new TextField(); + + public TextField getTextFilterPORActual() + { + return textFilterPORActual; + } + + public void setTextFilterPORActual( TextField textFilterPORActual ) + { + this.textFilterPORActual = textFilterPORActual; + } + private Button buttonFilterActual = new Button(); + + public Button getButtonFilterActual() + { + return this.buttonFilterActual; + } + + public void setButtonFilterActual( Button b ) + { + this.buttonFilterActual = b; + } + private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormRH() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormRH Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + private void fillInitialForm() + { + Integer fromYear = getSelectedYear(); + String responsavel_loja = getSessionBean1().getCurrentUser().getResponsavel_loja(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + table1.setRendered( true ); + + ArrayList actuaisList = adp.getAnalisesActuaisRhList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), responsavel_loja, fromYear ); + getSessionBean1().getAnalisesActualDataProvider().setList( actuaisList ); + } + catch ( Exception ex ) + { + table1.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table2.setRendered( true ); + + ArrayList seguimentoList = adp.getAnalisesSeguimentoRhList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), responsavel_loja, fromYear ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table3.setRendered( true ); + + ArrayList concluidasList = adp.getAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), fromYear ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "=== FORM_RH ===" ); + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + String responsavel_loja = getSessionBean1().getCurrentUser().getResponsavel_loja(); + if ( responsavel_loja.matches( "n" ) ) + { + lnkPlanosActuacao.setDisabled( true ); + } + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + if ( !pageFrom.matches( "FormRH.jsp" ) + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + fillInitialForm(); + + fillAnoDropDown(); + } + + txtMsg1.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String butNovaAnalise_action() + { + return null; + } + + public String lnkDataAcidente_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "analise_acidente"; + } + + public String lnkDataAbertura_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "analise_acidente"; + } + + public String lnkNr_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "analise_acidente"; + } + + public String lnkNomeAcidentado_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "analise_acidente"; + } + + private AnaliseAcidente getTableActivosRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesActualDataProvider provider = ( AnalisesActualDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "view_analise"; + } + + public String lnkDataAberturaSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormRH" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup3.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + if ( ano == null ) + { + lblMes.setVisible( false ); + drpMes.setVisible( false ); + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblMes.setVisible( true ); + drpMes.setVisible( true ); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + if ( mes == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblDia.setVisible( true ); + drpDia.setVisible( true ); + //fillDiaDropDown(); + } + } + + public void drpDia_processValueChange( ValueChangeEvent event ) + { + } + + public String butPesquisar_action() + { + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if ( obAno != null ) + { + ano = ( Integer ) obAno; + } + + if ( obMes != null ) + { + mes = ( Integer ) obMes; + } + + if ( obDia != null ) + { + dia = ( Integer ) obDia; + } + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + ano, mes, dia, por, nome, null, getSelectedYear() ); + + table3.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + return null; + } + +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList anosList = adp.getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + int i = 1; + while ( iter.hasNext() ) + { + Integer ano = ( Integer ) iter.next(); + + anoOptions[i] = new Option( ano, ano.toString() ); + i++; + } + getSessionBean1().setAnoOptions( anoOptions ); + Calendar cal = new GregorianCalendar(); + int year = cal.get( Calendar.YEAR ); + //drpAno.setSelected( new Integer(year) ); + + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[0] = new Option( "", "" ); + mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + Calendar cal = new GregorianCalendar(); + int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + + private void fillDiaDropDown() + { +// int ano = ( (Integer)drpAno.getSelected() ).intValue(); +// int mes = ( (Integer)drpMes.getSelected() ).intValue(); +// int dias = 0; +// switch (mes) { +// case 1: dias=31; break; +// case 2: +// GregorianCalendar cal = new GregorianCalendar(); +// if(cal.isLeapYear(ano)) +// { +// dias = 29; +// } +// else +// { +// dias = 28; +// } +// break; +// case 3: dias=31; break; +// case 4: dias=30; break; +// case 5: dias=31; break; +// case 6: dias=30; break; +// case 7: dias=31; break; +// case 8: dias=31; break; +// case 9: dias=30; break; +// case 10: dias=31; break; +// case 11: dias=30; break; +// case 12: dias=31; break; +// default: System.out.println("Invalid month.");break; +// } +// +// ArrayList diasList = new ArrayList(); +// for(int dia=1; diaPage bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class FormSeguranca extends AbstractPageBean +{ + // + + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + } + private Page page1 = new Page(); + + public Page getPage1() + { + return page1; + } + + public void setPage1( Page p ) + { + this.page1 = p; + } + private Html html1 = new Html(); + + public Html getHtml1() + { + return html1; + } + + public void setHtml1( Html h ) + { + this.html1 = h; + } + private Head head1 = new Head(); + + public Head getHead1() + { + return head1; + } + + public void setHead1( Head h ) + { + this.head1 = h; + } + private Link link1 = new Link(); + + public Link getLink1() + { + return link1; + } + + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); + + public Body getBody1() + { + return body1; + } + + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); + + public Form getForm1() + { + return form1; + } + + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase() + { + return gridBase; + } + + public void setGridBase( HtmlPanelGrid hpg ) + { + this.gridBase = hpg; + } + private HtmlPanelGrid gridLayout = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout() + { + return gridLayout; + } + + public void setGridLayout( HtmlPanelGrid hpg ) + { + this.gridLayout = hpg; + } + private HtmlPanelGrid gridLayoutTop = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayoutTop() + { + return gridLayoutTop; + } + + public void setGridLayoutTop( HtmlPanelGrid hpg ) + { + this.gridLayoutTop = hpg; + } + private HtmlPanelGrid gridActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridActual() + { + return gridActual; + } + + public void setGridActual( HtmlPanelGrid hpg ) + { + this.gridActual = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } + + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() + { + return staticText1; + } + + public void setStaticText1( StaticText st ) + { + this.staticText1 = st; + } + private HtmlPanelGrid gridSeguimento = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSeguimento() + { + return gridSeguimento; + } + + public void setGridSeguimento( HtmlPanelGrid hpg ) + { + this.gridSeguimento = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } + + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() + { + return staticText2; + } + + public void setStaticText2( StaticText st ) + { + this.staticText2 = st; + } + private HtmlPanelGrid gridConcluidos = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos() + { + return gridConcluidos; + } + + public void setGridConcluidos( HtmlPanelGrid hpg ) + { + this.gridConcluidos = hpg; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } + + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() + { + return staticText3; + } + + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private Link link2 = new Link(); + + public Link getLink2() + { + return link2; + } + + public void setLink2( Link l ) + { + this.link2 = l; + } + private Button butNovaAnalise = new Button(); + + public Button getButNovaAnalise() + { + return butNovaAnalise; + } + + public void setButNovaAnalise( Button b ) + { + this.butNovaAnalise = b; + } + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() + { + return staticText4; + } + + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } + + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private Table table1 = new Table(); + + public Table getTable1() + { + return table1; + } + + public void setTable1( Table t ) + { + this.table1 = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } + + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() + { + return tableColumn1; + } + + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() + { + return tableColumn2; + } + + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() + { + return tableColumn3; + } + + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } + + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private Table table2 = new Table(); + + public Table getTable2() + { + return table2; + } + + public void setTable2( Table t ) + { + this.table2 = t; + } + private TableRowGroup tableRowGroup2 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup2() + { + return tableRowGroup2; + } + + public void setTableRowGroup2( TableRowGroup trg ) + { + this.tableRowGroup2 = trg; + } + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() + { + return tableColumn4; + } + + public void setTableColumn4( TableColumn tc ) + { + this.tableColumn4 = tc; + } + private TableColumn tableColumn5 = new TableColumn(); + + public TableColumn getTableColumn5() + { + return tableColumn5; + } + + public void setTableColumn5( TableColumn tc ) + { + this.tableColumn5 = tc; + } + private TableColumn tableColumn6 = new TableColumn(); + + public TableColumn getTableColumn6() + { + return tableColumn6; + } + + public void setTableColumn6( TableColumn tc ) + { + this.tableColumn6 = tc; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } + + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } + + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() + { + return staticText11; + } + + public void setStaticText11( StaticText st ) + { + this.staticText11 = st; + } + private DropDown drpAno = new DropDown(); + + public DropDown getDrpAno() + { + return drpAno; + } + + public void setDrpAno( DropDown dd ) + { + this.drpAno = dd; + } + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() + { + return groupPanel2; + } + + public void setGroupPanel2( PanelGroup pg ) + { + this.groupPanel2 = pg; + } + private StaticText lblMes = new StaticText(); + + public StaticText getLblMes() + { + return lblMes; + } + + public void setLblMes( StaticText st ) + { + this.lblMes = st; + } + private DropDown drpMes = new DropDown(); + + public DropDown getDrpMes() + { + return drpMes; + } + + public void setDrpMes( DropDown dd ) + { + this.drpMes = dd; + } + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } + + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText lblDia = new StaticText(); + + public StaticText getLblDia() + { + return lblDia; + } + + public void setLblDia( StaticText st ) + { + this.lblDia = st; + } + private DropDown drpDia = new DropDown(); + + public DropDown getDrpDia() + { + return drpDia; + } + + public void setDrpDia( DropDown dd ) + { + this.drpDia = dd; + } + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } + + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() + { + return staticText14; + } + + public void setStaticText14( StaticText st ) + { + this.staticText14 = st; + } + private TextField txtNome = new TextField(); + + public TextField getTxtNome() + { + return txtNome; + } + + public void setTxtNome( TextField tf ) + { + this.txtNome = tf; + } + private Button butPesquisar = new Button(); + + public Button getButPesquisar() + { + return butPesquisar; + } + + public void setButPesquisar( Button b ) + { + this.butPesquisar = b; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } + + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private Table table3 = new Table(); + + public Table getTable3() + { + return table3; + } + + public void setTable3( Table t ) + { + this.table3 = t; + } + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() + { + return tableRowGroup3; + } + + public void setTableRowGroup3( TableRowGroup trg ) + { + this.tableRowGroup3 = trg; + } + private TableColumn tableColumn7 = new TableColumn(); + + public TableColumn getTableColumn7() + { + return tableColumn7; + } + + public void setTableColumn7( TableColumn tc ) + { + this.tableColumn7 = tc; + } + private TableColumn tableColumn8 = new TableColumn(); + + public TableColumn getTableColumn8() + { + return tableColumn8; + } + + public void setTableColumn8( TableColumn tc ) + { + this.tableColumn8 = tc; + } + private TableColumn tableColumn9 = new TableColumn(); + + public TableColumn getTableColumn9() + { + return tableColumn9; + } + + public void setTableColumn9( TableColumn tc ) + { + this.tableColumn9 = tc; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } + + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } + + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() + { + return image1; + } + + public void setImage1( ImageComponent ic ) + { + this.image1 = ic; + } + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() + { + return image2; + } + + public void setImage2( ImageComponent ic ) + { + this.image2 = ic; + } + private Hyperlink lnkDataAcidente = new Hyperlink(); + + public Hyperlink getLnkDataAcidente() + { + return lnkDataAcidente; + } + + public void setLnkDataAcidente( Hyperlink h ) + { + this.lnkDataAcidente = h; + } + private Hyperlink lnkNr = new Hyperlink(); + + public Hyperlink getLnkNr() + { + return lnkNr; + } + + public void setLnkNr( Hyperlink h ) + { + this.lnkNr = h; + } + private Hyperlink lnkNomeAcidentado = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentado() + { + return lnkNomeAcidentado; + } + + public void setLnkNomeAcidentado( Hyperlink h ) + { + this.lnkNomeAcidentado = h; + } + private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); + + public Hyperlink getLnkDataAcidenteSeg() + { + return lnkDataAcidenteSeg; + } + + public void setLnkDataAcidenteSeg( Hyperlink h ) + { + this.lnkDataAcidenteSeg = h; + } + private Hyperlink lnkNrSeg = new Hyperlink(); + + public Hyperlink getLnkNrSeg() + { + return lnkNrSeg; + } + + public void setLnkNrSeg( Hyperlink h ) + { + this.lnkNrSeg = h; + } + private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); + + public Hyperlink getLnkNomeAcidentadoSeg() + { + return lnkNomeAcidentadoSeg; + } + + public void setLnkNomeAcidentadoSeg( Hyperlink h ) + { + this.lnkNomeAcidentadoSeg = h; + } + private Hyperlink lnkDataConcluida = new Hyperlink(); + + public Hyperlink getLnkDataConcluida() + { + return lnkDataConcluida; + } + + public void setLnkDataConcluida( Hyperlink h ) + { + this.lnkDataConcluida = h; + } + private Hyperlink lnkNrConcluida = new Hyperlink(); + + public Hyperlink getLnkNrConcluida() + { + return lnkNrConcluida; + } + + public void setLnkNrConcluida( Hyperlink h ) + { + this.lnkNrConcluida = h; + } + private Hyperlink lnkNomeConcluida = new Hyperlink(); + + public Hyperlink getLnkNomeConcluida() + { + return lnkNomeConcluida; + } + + public void setLnkNomeConcluida( Hyperlink h ) + { + this.lnkNomeConcluida = h; + } + private StaticText txtSearchMsg = new StaticText(); + + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } + + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private TableColumn tableColumn10 = new TableColumn(); + + public TableColumn getTableColumn10() + { + return tableColumn10; + } + + public void setTableColumn10( TableColumn tc ) + { + this.tableColumn10 = tc; + } + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() + { + return tableColumn11; + } + + public void setTableColumn11( TableColumn tc ) + { + this.tableColumn11 = tc; + } + private Hyperlink lnkFase = new Hyperlink(); + + public Hyperlink getLnkFase() + { + return lnkFase; + } + + public void setLnkFase( Hyperlink h ) + { + this.lnkFase = h; + } + private Hyperlink lnkEstabelecimento = new Hyperlink(); + + public Hyperlink getLnkEstabelecimento() + { + return lnkEstabelecimento; + } + + public void setLnkEstabelecimento( Hyperlink h ) + { + this.lnkEstabelecimento = h; + } + private Hyperlink lnkFaseSeg = new Hyperlink(); + + public Hyperlink getLnkFaseSeg() + { + return lnkFaseSeg; + } + + public void setLnkFaseSeg( Hyperlink h ) + { + this.lnkFaseSeg = h; + } + private Hyperlink lnkEstabelecimentoSeg = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoSeg() + { + return lnkEstabelecimentoSeg; + } + + public void setLnkEstabelecimentoSeg( Hyperlink h ) + { + this.lnkEstabelecimentoSeg = h; + } + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() + { + return tableColumn12; + } + + public void setTableColumn12( TableColumn tc ) + { + this.tableColumn12 = tc; + } + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() + { + return tableColumn13; + } + + public void setTableColumn13( TableColumn tc ) + { + this.tableColumn13 = tc; + } + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() + { + return tableColumn14; + } + + public void setTableColumn14( TableColumn tc ) + { + this.tableColumn14 = tc; + } + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() + { + return tableColumn15; + } + + public void setTableColumn15( TableColumn tc ) + { + this.tableColumn15 = tc; + } + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() + { + return lnkPor; + } + + public void setLnkPor( Hyperlink h ) + { + this.lnkPor = h; + } + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() + { + return lnkPorSeg; + } + + public void setLnkPorSeg( Hyperlink h ) + { + this.lnkPorSeg = h; + } + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() + { + return lnkPorConcluida; + } + + public void setLnkPorConcluida( Hyperlink h ) + { + this.lnkPorConcluida = h; + } + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() + { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida( Hyperlink h ) + { + this.lnkEstabConcluida = h; + } + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } + + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() + { + return staticText5; + } + + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private TextField txtPor = new TextField(); + + public TextField getTxtPor() + { + return txtPor; + } + + public void setTxtPor( TextField tf ) + { + this.txtPor = tf; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } + + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } + + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() + { + return staticText6; + } + + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() + { + return image3; + } + + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() + { + return staticText7; + } + + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() + { + return staticText8; + } + + public void setStaticText8( StaticText st ) + { + this.staticText8 = st; + } + private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel10() + { + return gridPanel10; + } + + public void setGridPanel10( HtmlPanelGrid hpg ) + { + this.gridPanel10 = hpg; + } + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() + { + return txtMsg; + } + + public void setTxtMsg( StaticText st ) + { + this.txtMsg = st; + } + private TableColumn tableColumn16 = new TableColumn(); + + public TableColumn getTableColumn16() + { + return tableColumn16; + } + + public void setTableColumn16( TableColumn tc ) + { + this.tableColumn16 = tc; + } + private Hyperlink lnkDataAbertura = new Hyperlink(); + + public Hyperlink getLnkDataAbertura() + { + return lnkDataAbertura; + } + + public void setLnkDataAbertura( Hyperlink h ) + { + this.lnkDataAbertura = h; + } + private TableColumn tableColumn17 = new TableColumn(); + + public TableColumn getTableColumn17() + { + return tableColumn17; + } + + public void setTableColumn17( TableColumn tc ) + { + this.tableColumn17 = tc; + } + private Hyperlink lnkDataAberturaSeg = new Hyperlink(); + + public Hyperlink getLnkDataAberturaSeg() + { + return lnkDataAberturaSeg; + } + + public void setLnkDataAberturaSeg( Hyperlink h ) + { + this.lnkDataAberturaSeg = h; + } + private TableColumn tableColumn18 = new TableColumn(); + + public TableColumn getTableColumn18() + { + return tableColumn18; + } + + public void setTableColumn18( TableColumn tc ) + { + this.tableColumn18 = tc; + } + private TableColumn tableColumn19 = new TableColumn(); + + public TableColumn getTableColumn19() + { + return tableColumn19; + } + + public void setTableColumn19( TableColumn tc ) + { + this.tableColumn19 = tc; + } + private TableColumn tableColumn20 = new TableColumn(); + + public TableColumn getTableColumn20() + { + return tableColumn20; + } + + public void setTableColumn20( TableColumn tc ) + { + this.tableColumn20 = tc; + } + private Hyperlink lnkDataAberturaConcluida = new Hyperlink(); + + public Hyperlink getLnkDataAberturaConcluida() + { + return lnkDataAberturaConcluida; + } + + public void setLnkDataAberturaConcluida( Hyperlink h ) + { + this.lnkDataAberturaConcluida = h; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() + { + return lblUser; + } + + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() + { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao( Hyperlink h ) + { + this.lnkPlanosActuacao = h; + } + private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterSeg() + { + return this.gridPanelFilterSeg; + } + + public void setGridPanelFilterSeg( HtmlPanelGrid pg ) + { + this.gridPanelFilterSeg = pg; + } + private PanelGroup groupPanelFilterSeg = new PanelGroup(); + + public PanelGroup getGroupPanelFilterSeg() + { + return this.groupPanelFilterSeg; + } + + public void setGroupPanelFilterSeg( PanelGroup pg ) + { + this.groupPanelFilterSeg = pg; + } + private StaticText labelFilterNameSeg = new StaticText(); + + public StaticText getLabelFilterNameSeg() + { + return this.labelFilterNameSeg; + } + + public void setLabelFilterNameSeg( StaticText st ) + { + this.labelFilterNameSeg = st; + } + private TextField textFilterNameSeg = new TextField(); + + public TextField getTextFilterNameSeg() + { + return this.textFilterNameSeg; + } + + public void setTextFilterNameSeg( TextField tf ) + { + this.textFilterNameSeg = tf; + } + + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateSeg = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateSeg() +// { +// return this.calFilterDateSeg; +// } +// public void setCalFilterDateSeg( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateSeg = c; +// } + + private Date calFilterDateSeguimento = null; + public Date getCalFilterDateSeguimento() + { + return calFilterDateSeguimento; + } + public void setCalFilterDateSeguimento( Date calFilterDateSeguimento ) + { + this.calFilterDateSeguimento = calFilterDateSeguimento; + } + + + + private TextField textFilterPORSeg = new TextField(); + + public TextField getTextFilterPORSeg() + { + return textFilterPORSeg; + } + + public void setTextFilterPORSeg( TextField textFilterPORSeg ) + { + this.textFilterPORSeg = textFilterPORSeg; + } + private Button buttonFilterSeg = new Button(); + + public Button getButtonFilterSeg() + { + return this.buttonFilterSeg; + } + + public void setButtonFilterSeg( Button b ) + { + this.buttonFilterSeg = b; + } + private HtmlPanelGrid gridPanelFilterActual = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanelFilterActual() + { + return this.gridPanelFilterActual; + } + + public void setGridPanelFilterActual( HtmlPanelGrid pg ) + { + this.gridPanelFilterActual = pg; + } + private PanelGroup groupPanelFilterActual = new PanelGroup(); + + public PanelGroup getGroupPanelFilterActual() + { + return this.groupPanelFilterActual; + } + + public void setGroupPanelFilterActual( PanelGroup pg ) + { + this.groupPanelFilterActual = pg; + } + private StaticText labelFilterNameActual = new StaticText(); + + public StaticText getLabelFilterNameActual() + { + return this.labelFilterNameActual; + } + + public void setLabelFilterNameActual( StaticText st ) + { + this.labelFilterNameActual = st; + } + private TextField textFilterNameActual = new TextField(); + + public TextField getTextFilterNameActual() + { + return this.textFilterNameActual; + } + + public void setTextFilterNameActual( TextField tf ) + { + this.textFilterNameActual = tf; + } + + +// private com.sun.rave.web.ui.component.Calendar calFilterDateActual = new com.sun.rave.web.ui.component.Calendar(); +// public com.sun.rave.web.ui.component.Calendar getCalFilterDateActual() +// { +// return this.calFilterDateActual; +// } +// public void setCalFilterDateActual( com.sun.rave.web.ui.component.Calendar c ) +// { +// this.calFilterDateActual = c; +// } + + private Date calFilterDateActual = null; + public Date getCalFilterDateActual() + { + return calFilterDateActual; + } + public void setCalFilterDateActual( Date calFilterDateActual ) + { + this.calFilterDateActual = calFilterDateActual; + } + + + + private TextField textFilterPORActual = new TextField(); + + public TextField getTextFilterPORActual() + { + return textFilterPORActual; + } + + public void setTextFilterPORActual( TextField textFilterPORActual ) + { + this.textFilterPORActual = textFilterPORActual; + } + private Button buttonFilterActual = new Button(); + + public Button getButtonFilterActual() + { + return this.buttonFilterActual; + } + + public void setButtonFilterActual( Button b ) + { + this.buttonFilterActual = b; + } + private DropDown dropCurrentYear = new DropDown(); + + public DropDown getDropCurrentYear() + { + return dropCurrentYear; + } + + public void setDropCurrentYear( DropDown dropCurrentYear ) + { + this.dropCurrentYear = dropCurrentYear; + } + private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public FormSeguranca() + { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "FormSeguranca Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + private void fillInitialForm() + { + Integer fromYear = getSelectedYear(); + String responsavel_loja = getSessionBean1().getCurrentUser().getResponsavel_loja(); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table1.setRendered( true ); + + ArrayList actuaisList = adp.getAnalisesActuaisSegList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), responsavel_loja, fromYear ); + getSessionBean1().getAnalisesActualDataProvider().setList( actuaisList ); + } + catch ( Exception ex ) + { + table1.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table2.setRendered( true ); + + ArrayList seguimentoList = adp.getAnalisesSeguimentoSegList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), responsavel_loja, fromYear ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception ex ) + { + table2.setRendered( false ); + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + table3.setRendered( true ); + + ArrayList concluidasList = adp.getAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), fromYear ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + ErrorLogger.logException( ex ); + } + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + System.out.println( "=== FORM_SEGURANCA ===" ); + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + String responsavel_loja = getSessionBean1().getCurrentUser().getResponsavel_loja(); + if ( responsavel_loja.matches( "n" ) ) + { + lnkPlanosActuacao.setDisabled( true ); + } + + HttpServletRequest request = ( HttpServletRequest ) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom( referer ); + if ( !pageFrom.matches( "FormSeguranca.jsp" ) + || dropCurrentYear.getItems() == null ) + { + fillCurrentYearDrop(); + fillInitialForm(); + fillAnoDropDown(); + } + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + +// private void fillDateDropDowns() +// { +// fillAnoDropDown(); +// //fillMesDropDown(); +// //fillDiaDropDown(); +// } + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList anosList = adp.getAnosListFromAnalises(); + com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[ anosList.size() + 1 ]; + anoOptions[0] = new Option( "", "" ); + ListIterator iter = anosList.listIterator(); + int i = 1; + while ( iter.hasNext() ) + { + Integer ano = ( Integer ) iter.next(); + + anoOptions[i] = new Option( ano, ano.toString() ); + i++; + } + getSessionBean1().setAnoOptions( anoOptions ); + Calendar cal = new GregorianCalendar(); + int year = cal.get( Calendar.YEAR ); + //drpAno.setSelected( new Integer(year) ); + + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + private void fillMesDropDown() + { + com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[ 13 ]; + mesOptions[0] = new Option( "", "" ); + mesOptions[1] = new Option( new Integer( 1 ), "Janeiro" ); + mesOptions[2] = new Option( new Integer( 2 ), "Fevereiro" ); + mesOptions[3] = new Option( new Integer( 3 ), "Março" ); + mesOptions[4] = new Option( new Integer( 4 ), "Abril" ); + mesOptions[5] = new Option( new Integer( 5 ), "Maio" ); + mesOptions[6] = new Option( new Integer( 6 ), "Junho" ); + mesOptions[7] = new Option( new Integer( 7 ), "Julho" ); + mesOptions[8] = new Option( new Integer( 8 ), "Agosto" ); + mesOptions[9] = new Option( new Integer( 9 ), "Setembro" ); + mesOptions[10] = new Option( new Integer( 10 ), "Outubro" ); + mesOptions[11] = new Option( new Integer( 11 ), "Novembro" ); + mesOptions[12] = new Option( new Integer( 12 ), "Dezembro" ); + getSessionBean1().setMesOptions( mesOptions ); + Calendar cal = new GregorianCalendar(); + int month = cal.get( Calendar.MONTH ); // 0=Jan, 1=Feb, ... + //drpMes.setSelected( new Integer(month+1) ); + } + + private void fillDiaDropDown() + { + int ano = ( ( Integer ) drpAno.getSelected() ).intValue(); + int mes = ( ( Integer ) drpMes.getSelected() ).intValue(); + int dias = 0; + switch ( mes ) + { + case 1: + dias = 31; + break; + case 2: + GregorianCalendar cal = new GregorianCalendar(); + if ( cal.isLeapYear( ano ) ) + { + dias = 29; + } + else + { + dias = 28; + } + break; + case 3: + dias = 31; + break; + case 4: + dias = 30; + break; + case 5: + dias = 31; + break; + case 6: + dias = 30; + break; + case 7: + dias = 31; + break; + case 8: + dias = 31; + break; + case 9: + dias = 30; + break; + case 10: + dias = 31; + break; + case 11: + dias = 30; + break; + case 12: + dias = 31; + break; + default: + System.out.println( "Invalid month." ); + break; + } + + ArrayList diasList = new ArrayList(); + for ( int dia = 1; dia < dias + 1; dia++ ) + { + diasList.add( new Integer( dia ) ); + } + com.sun.rave.web.ui.model.Option[] diaOptions = new com.sun.rave.web.ui.model.Option[ diasList.size() + 1 ]; + ListIterator iter = diasList.listIterator(); + diaOptions[0] = new Option( "", "" ); + int j = 1; + while ( iter.hasNext() ) + { + Integer dia = ( Integer ) iter.next(); + + diaOptions[j] = new Option( dia, dia.toString() ); + j++; + } + getSessionBean1().setDiaOptions( diaOptions ); + Calendar cal = new GregorianCalendar(); + int day = cal.get( Calendar.DAY_OF_MONTH ); + drpDia.setSelected( new Integer( 0 ) ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return ( RequestBean1 ) getBean( "RequestBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public void drpAno_processValueChange( ValueChangeEvent event ) + { + Object ano = event.getNewValue(); + if ( ano == null ) + { + lblMes.setVisible( false ); + drpMes.setVisible( false ); + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblMes.setVisible( true ); + drpMes.setVisible( true ); + fillMesDropDown(); + } + } + + public void drpMes_processValueChange( ValueChangeEvent event ) + { + Object mes = event.getNewValue(); + if ( mes == null ) + { + lblDia.setVisible( false ); + drpDia.setVisible( false ); + } + else + { + lblDia.setVisible( true ); + drpDia.setVisible( true ); + fillDiaDropDown(); + } + } + + public String buttonFilterActual_action() + { +// Date visitaDate = ( Date ) calFilterDateActual.getValue(); + Date visitaDate = calFilterDateActual; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORActual.getText() != null ) + { + POR = ( ( String ) textFilterPORActual.getText() ).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameActual.getText() != null ) + { + nome = ( ( String ) textFilterNameActual.getText() ).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList actualList = adp.searchAnalisesActualSeg( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + nome, visitaDateStr, POR, + getSessionBean1().getCurrentUser().getResponsavel_loja(), getSelectedYear() ); + + table1.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesActualDataProvider().setList( actualList ); + } + catch ( Exception e ) + { + table1.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public String buttonFilterSeg_action() + { +// Date visitaDate = ( Date ) calFilterDateSeg.getValue(); + Date visitaDate = calFilterDateSeguimento; + String visitaDateStr = null; + if ( visitaDate != null ) + { + visitaDateStr = D_F.format( visitaDate ); + } + + String POR = null; + if ( textFilterPORSeg.getText() != null ) + { + POR = ( ( String ) textFilterPORSeg.getText() ).trim(); + if ( POR.length() == 0 ) + { + POR = null; + } + } + + String nome = null; + if ( textFilterNameSeg.getText() != null ) + { + nome = ( ( String ) textFilterNameSeg.getText() ).trim(); + if ( nome.length() == 0 ) + { + nome = null; + } + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList seguimentoList = adp.searchAnalisesSeguimentoSeg( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + nome, visitaDateStr, POR, + getSessionBean1().getCurrentUser().getResponsavel_loja(), getSelectedYear() ); + + table2.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList ); + } + catch ( Exception e ) + { + table2.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( e ); + } + + return null; + } + + public String butPesquisar_action() + { + Object obAno = null; + Object obMes = null; + Object obDia = null; + try + { + obAno = drpAno.getSelected(); + obMes = drpMes.getSelected(); + obDia = drpDia.getSelected(); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + Integer ano = null; + Integer mes = null; + Integer dia = null; + + if ( obAno != null ) + { + ano = ( Integer ) obAno; + } + + if ( obMes != null ) + { + mes = ( Integer ) obMes; + } + + if ( obDia != null ) + { + dia = ( Integer ) obDia; + } + + String por = null; + if ( txtPor.getText() != null ) + { + por = ( String ) txtPor.getText(); + if ( por.trim().length() == 0 ) + { + por = null; + } + } + + + String nome = null; + if ( txtNome.getText() != null ) + { + nome = ( String ) txtNome.getText(); + if ( nome.trim().length() == 0 ) + { + nome = null; + } + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + ArrayList concluidasList = adp.searchAnalisesConcluidasList( + getSessionBean1().getCurrentUser().getEstabelecimento_id(), + ano, mes, dia, por, nome, null, getSelectedYear() ); + + table3.setRendered( true ); + txtSearchMsg.setRendered( false ); + getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList ); + } + catch ( Exception ex ) + { + table3.setRendered( false ); + txtSearchMsg.setRendered( true ); + txtSearchMsg.setText( "Não foram encontrados registos para a sua pesquisa !" ); + ErrorLogger.logException( ex ); + } + + return null; + } + + public void drpDia_processValueChange( ValueChangeEvent vce ) + { + } + +// private String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } + public String butNovaAnalise_action() + { + getSessionBean1().setNavFrom( "FormSeguranca" ); + getSessionBean1().setCurrentAnalise( null ); + return "analise_acidente"; + } + + public String lnkDataAcidente_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + public String lnkDataAbertura_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + public String lnkNr_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + public String lnkNomeAcidentado_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + private AnaliseAcidente getTableActivosRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesActualDataProvider provider = ( AnalisesActualDataProvider ) tableRowGroup1.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkDataAcidenteSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkDataAberturaSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkNrSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + private AnaliseAcidente getTableSeguimentoRowData() + { + RowKey rk = tableRowGroup2.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesSeguimentoDataProvider provider = ( AnalisesSeguimentoDataProvider ) tableRowGroup2.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + private AnaliseAcidente getTableConcluidasRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt( rk.getRowId() ); + AnalisesConcluidasDataProvider provider = ( AnalisesConcluidasDataProvider ) tableRowGroup3.getSourceData(); + ArrayList list = ( ArrayList ) provider.getList(); + AnaliseAcidente a = ( AnaliseAcidente ) list.get( k ); + return a; + } + + public String lnkEditUser_action() + { + System.out.println( "EDIT USER" ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + return "user"; + } + + public String lnkDataConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkDataAberturaConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkNrConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkNomeConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkFase_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + public String lnkEstabelecimento_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + public String lnkFaseSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkEstabelecimentoSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkPor_action() + { + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "analise_acidente"; + } + + public String lnkPorSeg_action() + { + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkPorConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkEstabConcluida_action() + { + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise( a ); + getSessionBean1().setNavFrom( "FormSeguranca" ); + return "view_analise"; + } + + public String lnkNewUser_action() + { + return null; + } + + public String lnkAjuda_action() + { + System.out.println( "AJUDA" ); +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// return null; +// } + return null; + } + + private void showPdf( String pdfFilePath ) throws Exception + { + File pdfFile = new File( pdfFilePath ); + FileInputStream fis = new FileInputStream( pdfFile ); + byte[] buf = new byte[ ( int ) pdfFile.length() ]; + while ( ( fis.read( buf ) ) > 0 ) + { + //fos.write(buf, 0, buf.length); + } + fis.close(); + FacesContext ctx = FacesContext.getCurrentInstance(); + if ( !ctx.getResponseComplete() ) + { + HttpServletResponse response = ( HttpServletResponse ) ctx.getExternalContext().getResponse(); + String contentType = "application/pdf"; + response.setContentType( contentType ); + response.setHeader( "Content-Disposition", "attachment;filename=\"" + "Ajuda.pdf" + "\"" ); + + ServletOutputStream out = response.getOutputStream(); + + //out.write(model.getInfo().getBytes()); + out.write( buf, 0, buf.length ); + out.flush(); + out.close(); + ctx.responseComplete(); + ctx.release(); + } + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos( fc, u ); +// Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); +// FacesContext fc = getFacesContext().getCurrentInstance(); +// try +// { +// JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser); +// } +// catch(Exception ex) +// { +// +// } + return null; + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public void dropCurrentYear_valueChangeListener( ValueChangeEvent event ) + { + Object oldValue = event.getOldValue(); + Object newValue = event.getNewValue(); + + if ( newValue != null && newValue instanceof Integer ) + { + Integer newYear = ( Integer ) newValue; + getSessionBean1().setAnoChoice( newYear); + Integer oldYear = oldValue != null && oldValue instanceof Integer ? ( Integer ) oldValue : null; + if ( oldYear == null || !newYear.equals( oldYear ) ) + { + fillInitialForm(); + } + } + } + + private Integer getSelectedYear() + { + Integer result = getSessionBean1().getAnoChoice(); + if ( result == null && dropCurrentYear != null ) + { + Object selected = dropCurrentYear.getSelected(); + if ( selected != null && selected instanceof Integer ) + { + result = ( Integer ) selected; + } + } + return result; + } + + private void fillCurrentYearDrop() + { + Integer selectedYear = getSelectedYear(); + + Option[] opts = Utils.getYearDropValues(); + dropCurrentYear.setItems( opts ); + + dropCurrentYear.setSelected( selectedYear != null ? selectedYear : Utils.getDefaultSelectedYear() ); + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/GestaoUtilizadores.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/GestaoUtilizadores.java new file mode 100644 index 00000000..5af0c4d9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/GestaoUtilizadores.java @@ -0,0 +1,1330 @@ +/* + * GestaoUtilizadores.java + * + * Created on November 30, 2007, 1:34 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; +import db.providers.AnalisesDataProvider; +import db.providers.UtilizadoresActivosListDataProvider; +import db.providers.UtilizadoresDataProvider; +import db.providers.UtilizadoresInactivosListDataProvider; +import global.Global; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.JSFUtils; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class GestaoUtilizadores extends AbstractPageBean +{ + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConcluidos1() { + return gridConcluidos1; + } + + public void setGridConcluidos1(HtmlPanelGrid hpg) { + this.gridConcluidos1 = hpg; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private TextField txtPor = new TextField(); + + public TextField getTxtPor() { + return txtPor; + } + + public void setTxtPor(TextField tf) { + this.txtPor = tf; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private PanelGroup groupPanelLogin = new PanelGroup(); + + public PanelGroup getGroupPanelLogin() { + return groupPanelLogin; + } + + public void setGroupPanelLogin(PanelGroup groupPanelLogin) { + this.groupPanelLogin = groupPanelLogin; + } + + private TextField txtLogin = new TextField(); + + public TextField getTxtLogin() { + return txtLogin; + } + + public void setTxtLogin(TextField txtLogin) { + this.txtLogin = txtLogin; + } + + private StaticText staticTextLogin = new StaticText(); + + public StaticText getStaticTextLogin() { + return staticTextLogin; + } + + public void setStaticTextLogin(StaticText staticTextLogin) { + this.staticTextLogin = staticTextLogin; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private TextField txtNome = new TextField(); + + public TextField getTxtNome() { + return txtNome; + } + + public void setTxtNome(TextField tf) { + this.txtNome = tf; + } + + private Button butPesquisar = new Button(); + + public Button getButPesquisar() { + return butPesquisar; + } + + public void setButPesquisar(Button b) { + this.butPesquisar = b; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private Table table3 = new Table(); + + public Table getTable3() { + return table3; + } + + public void setTable3(Table t) { + this.table3 = t; + } + + private TableRowGroup tableRowGroup3 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup3() { + return tableRowGroup3; + } + + public void setTableRowGroup3(TableRowGroup trg) { + this.tableRowGroup3 = trg; + } + + private TableColumn tableColumn11 = new TableColumn(); + + public TableColumn getTableColumn11() { + return tableColumn11; + } + + public void setTableColumn11(TableColumn tc) { + this.tableColumn11 = tc; + } + + private Hyperlink lnkCategoriaActivos = new Hyperlink(); + + public Hyperlink getLnkCategoriaActivos() { + return lnkCategoriaActivos; + } + + public void setLnkCategoriaActivos(Hyperlink h) { + this.lnkCategoriaActivos = h; + } + + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() { + return tableColumn13; + } + + public void setTableColumn13(TableColumn tc) { + this.tableColumn13 = tc; + } + + private Hyperlink lnkPorActivos = new Hyperlink(); + + public Hyperlink getLnkPorActivos() { + return lnkPorActivos; + } + + public void setLnkPorActivos(Hyperlink h) { + this.lnkPorActivos = h; + } + + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() { + return tableColumn14; + } + + public void setTableColumn14(TableColumn tc) { + this.tableColumn14 = tc; + } + + private TableColumn tableColumnLogin = new TableColumn(); + + public TableColumn getTableColumnLogin() { + return tableColumnLogin; + } + + public void setTableColumnLogin(TableColumn tableColumnLogin) { + this.tableColumnLogin = tableColumnLogin; + } + + private Hyperlink lnkLoginActivos = new Hyperlink(); + + public Hyperlink getLnkLoginActivos() { + return lnkLoginActivos; + } + + private TableColumn tableColumnLoginInactivos = new TableColumn(); + + public TableColumn getTableColumnLoginInactivos() { + return tableColumnLoginInactivos; + } + + public void setTableColumnLoginInactivos(TableColumn tableColumnLoginInactivos) { + this.tableColumnLoginInactivos = tableColumnLoginInactivos; + } + + private Hyperlink lnkLoginInactivos = new Hyperlink(); + + public Hyperlink getLnkLoginInactivos() { + return lnkLoginInactivos; + } + + public void setLnkLoginInactivos(Hyperlink lnkLoginInactivos) { + this.lnkLoginInactivos = lnkLoginInactivos; + } + + + + public void setLnkLoginActivos(Hyperlink lnkLoginActivos) { + this.lnkLoginActivos = lnkLoginActivos; + } + + + + private Hyperlink lnkNomeActivos = new Hyperlink(); + + public Hyperlink getLnkNomeActivos() { + return lnkNomeActivos; + } + + public void setLnkNomeActivos(Hyperlink h) { + this.lnkNomeActivos = h; + } + + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() { + return tableColumn15; + } + + public void setTableColumn15(TableColumn tc) { + this.tableColumn15 = tc; + } + + private Hyperlink lnkEstabelecimentoActivos = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoActivos() { + return lnkEstabelecimentoActivos; + } + + public void setLnkEstabelecimentoActivos(Hyperlink h) { + this.lnkEstabelecimentoActivos = h; + } + + private StaticText txtSearchMsg1 = new StaticText(); + + public StaticText getTxtSearchMsg1() { + return txtSearchMsg1; + } + + public void setTxtSearchMsg1(StaticText st) { + this.txtSearchMsg1 = st; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private Table table1 = new Table(); + + public Table getTable1() { + return table1; + } + + public void setTable1(Table t) { + this.table1 = t; + } + + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() { + return tableRowGroup1; + } + + public void setTableRowGroup1(TableRowGroup trg) { + this.tableRowGroup1 = trg; + } + + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() { + return tableColumn1; + } + + public void setTableColumn1(TableColumn tc) { + this.tableColumn1 = tc; + } + + private Hyperlink lnkPorInactivos = new Hyperlink(); + + public Hyperlink getLnkPorInactivos() { + return lnkPorInactivos; + } + + public void setLnkPorInactivos(Hyperlink h) { + this.lnkPorInactivos = h; + } + + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() { + return tableColumn2; + } + + public void setTableColumn2(TableColumn tc) { + this.tableColumn2 = tc; + } + + private Hyperlink lnkNomeInactivos = new Hyperlink(); + + public Hyperlink getLnkNomeInactivos() { + return lnkNomeInactivos; + } + + public void setLnkNomeInactivos(Hyperlink h) { + this.lnkNomeInactivos = h; + } + + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() { + return tableColumn3; + } + + public void setTableColumn3(TableColumn tc) { + this.tableColumn3 = tc; + } + + private Hyperlink lnkCategoriaInactivos = new Hyperlink(); + + public Hyperlink getLnkCategoriaInactivos() { + return lnkCategoriaInactivos; + } + + public void setLnkCategoriaInactivos(Hyperlink h) { + this.lnkCategoriaInactivos = h; + } + + private TableColumn tableColumn4 = new TableColumn(); + + public TableColumn getTableColumn4() { + return tableColumn4; + } + + public void setTableColumn4(TableColumn tc) { + this.tableColumn4 = tc; + } + + private Hyperlink lnkEstabelecimentoInactivos = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoInactivos() { + return lnkEstabelecimentoInactivos; + } + + public void setLnkEstabelecimentoInactivos(Hyperlink h) { + this.lnkEstabelecimentoInactivos = h; + } + + private StaticText txtSearchMsg2 = new StaticText(); + + public StaticText getTxtSearchMsg2() { + return txtSearchMsg2; + } + + public void setTxtSearchMsg2(StaticText st) { + this.txtSearchMsg2 = st; + } + + private DropDown drpEstabelecimentos = new DropDown(); + + public DropDown getDrpEstabelecimentos() { + return drpEstabelecimentos; + } + + public void setDrpEstabelecimentos(DropDown dd) { + this.drpEstabelecimentos = dd; + } + + private SingleSelectOptionsList drpEstabelecimentosDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpEstabelecimentosDefaultOptions() { + return drpEstabelecimentosDefaultOptions; + } + + public void setDrpEstabelecimentosDefaultOptions(SingleSelectOptionsList ssol) { + this.drpEstabelecimentosDefaultOptions = ssol; + } + + //
+ boolean isPostback = false; + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private Button butNovoUtilizador = new Button(); + + public Button getButNovoUtilizador() { + return butNovoUtilizador; + } + + public void setButNovoUtilizador(Button b) { + this.butNovoUtilizador = b; + } + + private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg1() { + return gridMsg1; + } + + public void setGridMsg1(HtmlPanelGrid hpg) { + this.gridMsg1 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao(Hyperlink h) { + this.lnkPlanosActuacao = h; + } + /** + *

Construct a new Page bean instance.

+ */ + public GestaoUtilizadores() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("GestaoUtilizadores Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if ( ! getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect("Login.jsp"); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + else + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + + boolean userDeleted = getSessionBean1().isUserDeleted(); + + if(userDeleted) + { + getSessionBean1().setUserDeleted(false); + } + + FacesContext fc = getFacesContext(); + Map parameters = fc.getCurrentInstance().getExternalContext().getRequestParameterMap(); + if(!pageFrom.matches("GestaoUtilizadores.jsp") || userDeleted || parameters.size() > 0) + { + isPostback = false; + } + else + { + isPostback = true; + } + + + } + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + Utilizador u = getSessionBean1().getCurrentUser(); + FacesContext fc = getFacesContext().getCurrentInstance(); + if(u.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP && u.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + try + { + JSFUtils.logout( fc, true ); + } + catch( Exception ex ) + { + throw new RuntimeException( ex ); + } + return; + } + if(u.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + lnkPlanosActuacao.setDisabled(true); + } + + System.out.println("POSTBACK : " + isPostback); + if ( ! isPostback ) + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + com.sun.rave.web.ui.model.Option[] listOptions = adp.getEstabelecimentosList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(false)); + listOptions[0].setLabel("-Todos-"); + getSessionBean1().setEstabelecimentosOptions( listOptions ); + drpEstabelecimentos.setSelected(new Integer(-1)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + if ( ! getSessionBean1().getIsSearchingUtilizadores() ) + { + String isDirRh = "n"; + if(getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) // Director geral rh + { + isDirRh = "y"; + } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + List< Utilizador > listUtilizadores = udp.getUtilizadoresList( null, null, null, null, "y", isDirRh ); +// List< Utilizador > listUtilizadores = udp.getUtilizadoresList( null, null, null, "y", isDirRh ); + getSessionBean1().getUtilizadoresActivosListDataProvider().setList( listUtilizadores ); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + List< Utilizador > listUtilizadores = udp.getUtilizadoresList( null, null, null, null, "n", isDirRh ); +// List< Utilizador > listUtilizadores = udp.getUtilizadoresList( null, null, null, "n", isDirRh ); + getSessionBean1().getUtilizadoresInactivosListDataProvider().setList( listUtilizadores ); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + getSessionBean1().getUtilizadoresInactivosListDataProvider().setList( new LinkedList() ); + table1.setRendered(false); + } + } + + } + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkEditUser_action() + { + getSessionBean1().setNavFrom("GestaoUtilizadores"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String butNovaAnalise_action() + { + return null; + } + + public String lnkDataAcidente_action() + { + return null; + } + + public String lnkNr_action() + { + return null; + } + + public String lnkPor_action() + { + return null; + } + + public String lnkNomeAcidentado_action() + { + return null; + } + + public String lnkFase_action() + { + return null; + } + + public String lnkDataAcidenteSeg_action() + { + return null; + } + + public String lnkNrSeg_action() + { + return null; + } + + public String lnkPorSeg_action() + { + return null; + } + + public String lnkNomeAcidentadoSeg_action() + { + return null; + } + + public String lnkFaseSeg_action() + { + return null; + } + + public void drpAno_processValueChange(ValueChangeEvent event) + { + + } + + public void drpMes_processValueChange(ValueChangeEvent event) + { + + } + + public void drpDia_processValueChange(ValueChangeEvent event) + { + + } + + public String butPesquisar_action() + { + String por = null; + String nome = null; + Integer estabelecimento_id = null; + String login = null; + + if(txtPor.getText() != null) + { + por = (String) txtPor.getText(); + if(por.trim().length() == 0) + { + por = null; + } + else + { + por = por.toLowerCase(); + } + } + + if(txtNome.getText() != null) + { + nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + nome = null; + } + else + { + nome = nome.toLowerCase(); + } + } + + if ( txtLogin.getText() != null ) + { + login = ( String ) txtLogin.getText(); + if ( login == null || "".equals( login.trim() ) ) + { + login = null; + } + else + { + login = login.toLowerCase(); + } + } + + estabelecimento_id = (Integer) drpEstabelecimentos.getSelected(); + if(estabelecimento_id.intValue() == -1) + { + estabelecimento_id = null; + } + + String isDirRh = "n"; + + if(getSessionBean1().getCurrentUser().getTipo().intValue() == 7) //director geral rh + { + isDirRh = "y"; + } + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + getSessionBean1().setIsSearchingUtilizadores( true ); + List< Utilizador > listUtilizadores = udp.getUtilizadoresList( por, nome, login, estabelecimento_id, "y", isDirRh ); +// List< Utilizador > listUtilizadores = udp.getUtilizadoresList( por, nome, estabelecimento_id, "y", isDirRh ); + getSessionBean1().getUtilizadoresActivosListDataProvider().setList( listUtilizadores ); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + getSessionBean1().getUtilizadoresActivosListDataProvider().setList( new LinkedList< Utilizador >() ); + } + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + getSessionBean1().setIsSearchingUtilizadores( true ); + List< Utilizador > listUtilizadores = udp.getUtilizadoresList( por, nome, login, estabelecimento_id, "n", isDirRh ); +// List< Utilizador > listUtilizadores = udp.getUtilizadoresList( por, nome, estabelecimento_id, "n", isDirRh ); + getSessionBean1().getUtilizadoresInactivosListDataProvider().setList( listUtilizadores ); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + getSessionBean1().getUtilizadoresInactivosListDataProvider().setList( new LinkedList< Utilizador >() ); + } + + return null; + } + + public String lnkPorActivos_action() + { + Utilizador u = getUtilizadorActivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkNomeActivos_action() + { + Utilizador u = getUtilizadorActivoRowData(); + System.out.println("UTILIZADOR ID : " + u.getId()); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkLoginActivos_action() + { + Utilizador u = getUtilizadorActivoRowData(); + getSessionBean1().setEditUser( u ); + getSessionBean1().setModoEdicaoUtilizador( "edit" ); + getSessionBean1().setNavFrom( "GestaoUtilizadores" ); + return "user_fields"; + } + + public String lnkCategoriaActivos_action() + { + Utilizador u = getUtilizadorActivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkEstabelecimentosActivos_action() + { + Utilizador u = getUtilizadorActivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + private Utilizador getUtilizadorActivoRowData() + { + RowKey rk = tableRowGroup3.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + UtilizadoresActivosListDataProvider provider = (UtilizadoresActivosListDataProvider) tableRowGroup3.getSourceData(); + List< Utilizador > list = ( List< Utilizador > ) provider.getList(); + Utilizador u = list.get( k ); + return u; + } + + + public String lnkPorInactivos_action() + { + Utilizador u = getUtilizadorInactivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkNomeInactivos_action() + { + Utilizador u = getUtilizadorInactivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkLoginInactivos_action() + { + Utilizador u = getUtilizadorInactivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkCategoriaInactivos_action() + { + Utilizador u = getUtilizadorInactivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + public String lnkEstabelecimentoInactivos_action() + { + Utilizador u = getUtilizadorInactivoRowData(); + getSessionBean1().setEditUser(u); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setNavFrom("GestaoUtilizadores"); + return "user_fields"; + } + + private Utilizador getUtilizadorInactivoRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + UtilizadoresInactivosListDataProvider provider = (UtilizadoresInactivosListDataProvider) tableRowGroup1.getSourceData(); + List< Utilizador > list = ( List< Utilizador > ) provider.getList(); + Utilizador u = list.get( k ); + return u; + } + + + public String lnkNewUser_action() + { + return null; + } + + public String butNovoUtilizador_action() + { + return "novo_utilizador"; + } + + public String lnkAnalisesAcidente_action() + { + String nav_from = getSessionBean1().getNavFrom(); + Integer tipo_utilizador = getSessionBean1().getCurrentUser().getTipo(); + if(tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + return "form_dir_siprp"; + } + else if( tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH ) + { + return "form_dir_ger_rh"; + } + return null; + } + + public String lnkAjuda_action() + { +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkPlanosActuacao_action() + { + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Header.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Header.java new file mode 100644 index 00000000..6c79782a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Header.java @@ -0,0 +1,136 @@ +/* + * Header.java + * + * Created on September 19, 2007, 10:14 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractFragmentBean; +import javax.faces.FacesException; +import utils.Utils; + +/** + *

Fragment bean that corresponds to a similarly named JSP page + * fragment. This class contains component definitions (and initialization + * code) for all components that you have defined on this fragment, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class Header extends AbstractFragmentBean +{ + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + //
+ + public Header() + { + + } + + /** + *

Callback method that is called whenever a page containing + * this page fragment is navigated to, either directly via a URL, + * or indirectly via page navigation. Override this method to acquire + * resources that will be needed for event handlers and lifecycle methods.

+ * + *

The default implementation does nothing.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called. Override this + * method to release resources acquired in the init() + * resources that will be needed for event handlers and lifecycle methods.

+ * + *

The default implementation does nothing.

+ */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkAnalisesAcidente_action() + { + return null; + } + + public String lnkPlanosActuacao_action() + { + return null; + } + + public String lnkNewUser_action() + { + return null; + } + + public String lnkEditUser_action() + { + return null; + } + + public String lnkAjuda_action() + { + return null; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), false ); + return null; + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/LoadImage.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/LoadImage.java new file mode 100644 index 00000000..bb7f1053 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/LoadImage.java @@ -0,0 +1,478 @@ +/* + * LoadImage.java + * + * Created on September 26, 2007, 5:36 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Upload; +import com.sun.rave.web.ui.model.UploadedFile; +import global.Global; +import java.io.File; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.servlet.ServletContext; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class LoadImage extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout() { + return gridLayout; + } + + public void setGridLayout(HtmlPanelGrid hpg) { + this.gridLayout = hpg; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private Upload fileUpload1 = new Upload(); + + public Upload getFileUpload1() { + return fileUpload1; + } + + public void setFileUpload1(Upload u) { + this.fileUpload1 = u; + } + + //
+ /** + *

Construct a new Page bean instance.

+ */ + + private String realImageFilePath; + //private static final String IMAGE_URL = "/resources/image-file"; + //private String IMAGE_URL = "/resources/images"; + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private Button butUpload = new Button(); + + public Button getButUpload() { + return butUpload; + } + + public void setButUpload(Button b) { + this.butUpload = b; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + public LoadImage() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("LoadImage Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if (!getSessionBean1().isLoggedIn()) + { + try + { + getExternalContext().redirect("Login.jsp"); + } + catch(Exception e) + { + // . . . handle exception . . . + } + } + else + { + + getSessionBean1().setImageName(null); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + //this.realImageFilePath = theApplicationsServletContext.getRealPath(IMAGE_URL); + //this.realImageFilePath = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER); + try + { + realImageFilePath = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File f = new File(realImageFilePath); + f.mkdir(); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + //String uploadedFileName = (String) this.txtFileName.getValue(); + //if ( uploadedFileName != null ) { +// IMAGE_URL += getSessionBean1().getImageName(); +// System.out.println("IMAGE URL : " + IMAGE_URL); + //image1.setUrl(IMAGE_URL); +// } + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), false ); + return null; + } + + public String lnkNome_action() + { + return null; + } + + public String lnkDataNascimento_action() + { + return null; + } + + public String butCancelar_action() + { + getSessionBean1().setImageName( null ); + return "analise_acidente"; + } + + public String butUpload_action() + { + //realImageFilePath += "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + System.out.println("REAL IMAGE FILE PATH : " + realImageFilePath); + File fdir = new File(realImageFilePath); + System.out.println("FDIR : " + fdir); + + UploadedFile uploadedFile = fileUpload1.getUploadedFile(); + if(uploadedFile != null) + { + String uploadedFileName = uploadedFile.getOriginalName(); + + // Some browsers return complete path name, some don't + // Make sure we only have the file name + // First, try forward slash + int index = uploadedFileName.lastIndexOf('/'); + String justFileName; + if ( index >= 0) { + justFileName = uploadedFileName.substring( index + 1 ); + } else { + // Try backslash + index = uploadedFileName.lastIndexOf('\\'); + if (index >= 0) { + justFileName = uploadedFileName.substring( index + 1 ); + } else { + // No forward or back slashes + justFileName = uploadedFileName; + } + } + //justFileName = justFileName.substring(0, justFileName.lastIndexOf('.')); + int firstImageNr = getFirstImageNr().intValue(); + File files[] = fdir.listFiles(); + // realImageFilePath += "/" + justFileName; + System.out.println("FILES : " + files); + + int imageName = firstImageNr + files.length + 1; + justFileName = new Integer(imageName).toString(); + + if(imageName < 10) + { + justFileName = "0" + justFileName; + } + //this.txtFileName.setValue(justFileName); + Long uploadedFileSize = new Long(uploadedFile.getSize()); + //this.txtFileSize.setValue(uploadedFileSize); + String uploadedFileType = uploadedFile.getContentType(); + //this.txtFileType.setValue(uploadedFileType); + if ( uploadedFileType.equals("image/jpeg") + || uploadedFileType.equals("image/pjpeg") + || uploadedFileType.equals("image/gif") + || uploadedFileType.equals("image/png") + || uploadedFileType.equals("image/x-png")) { + try { + + realImageFilePath += "/" + justFileName; + File file = new File(this.realImageFilePath); + uploadedFile.write(file); + getSessionBean1().setImageName(justFileName); + //getSessionBean1().setMsg("Ficheiro carregado !"); + } catch (Exception ex) { + ErrorLogger.logException( ex ); + getSessionBean1().setMsg("Não foi possivel carregar o ficheiro !"); + return null; + } + } else { + getSessionBean1().setMsg("Tem de seleccionar um ficheiro do tipo JPEG, PJPEG, GIF, PNG, ou X-PNG !"); + new File(this.realImageFilePath).delete(); + return null; + } + } + else + { + getSessionBean1().setImageName(null); + } + + return "analise_acidente"; + } + + private Integer getFirstImageNr() + { + if(getSessionBean1().getCurrentAnalise() == null) + { + return new Integer(0); + } + else + { + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(0,2) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(3); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + File fdir = new File(imageFileFolder); + int nr = 0; + if(fdir.exists()) + { + File files[] = fdir.listFiles(); + for(int i=0; i < files.length; i++) + { + String nr_str = files[i].getName(); + int i_nr = Integer.parseInt(nr_str); + if(i_nr > nr) + { + nr = i_nr; + } + } + return new Integer(nr); + } + + return new Integer(0); + } + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Login.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Login.java new file mode 100644 index 00000000..301857e9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Login.java @@ -0,0 +1,677 @@ +/* + * Page1.java + * + * Created on September 18, 2007, 3:14 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PasswordField; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesDataProvider; +import db.providers.UtilizadoresDataProvider; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class Login extends AbstractPageBean +{ + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private TextField txtUtilizador = new TextField(); + + public TextField getTxtUtilizador() { + return txtUtilizador; + } + + public void setTxtUtilizador(TextField tf) { + this.txtUtilizador = tf; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private PasswordField txtPassword = new PasswordField(); + + public PasswordField getTxtPassword() { + return txtPassword; + } + + public void setTxtPassword(PasswordField pf) { + this.txtPassword = pf; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private Hyperlink lnkPassRecovery = new Hyperlink(); + + public Hyperlink getLnkPassRecovery() { + return lnkPassRecovery; + } + + public void setLnkPassRecovery(Hyperlink h) { + this.lnkPassRecovery = h; + } + + private Button butLogin = new Button(); + + public Button getButLogin() { + return butLogin; + } + + public void setButLogin(Button b) { + this.butLogin = b; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + //
+ /** + *

Construct a new Page bean instance.

+ */ + public Login() + { +// connect(); + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String butLogin_action() + { + String sRet = null; + + if(txtUtilizador.getText() != null) + { + String utilizador = (String) txtUtilizador.getText(); + if(utilizador.trim().length() > 0) + { + if(txtPassword.getText() != null) + { + String password = (String) txtPassword.getText(); + if( password.trim().length() > 0 ) + { + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador u = udp.getUtilizador( utilizador ); + if( u != null && "y".equals( u.getActivo() ) ) + { + if ( ! password.equals( u.getPassword() ) ) + { + getSessionBean1().setMsg( "Palavra-chave inválida !" ); + } + else + { + //if(u.getOwner_id().intValue() == 0 ) + + Utils.doLogin( getExternalContext(), u ); + + //Login Ok ! +// if(u.getPrimeiro_login().matches("y") || mustChangePassword(u)) + if(u.getPrimeiro_login().matches("y") ) + { + getSessionBean1().setMudarPassword(true); + getSessionBean1().setCurrentUser( u ); + getSessionBean1().setNavFrom("Login"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setLoggedIn(true); + initializeClock(); + initializeDropDownOptions(); + return "user"; + } + try + { + Integer permissao = udp.getPermissionCode( u.getId() ); + sRet = "form_seguranca"; + if ( permissao != null ) + { + if(permissao.intValue() == 1) //seguranca + { + if(u.getResponsavel_loja().matches("y")) + { + sRet = "acesso"; + } + else + { + sRet = "form_seguranca"; + } + } + else if(permissao.intValue() == 2) // rh + { + if(u.getResponsavel_loja().matches("y")) + { + sRet = "acesso"; + } + else + { + sRet = "form_rh"; + } + //sRet = "form_rh"; + } + else if(permissao.intValue() == 3) // hs + { + //sRet = "form_hs"; + sRet = "acesso"; + } + else if(permissao.intValue() == 5) // medico + { + sRet = "form_medico"; + } + else if(permissao.intValue() == 6) // gestor + { + //sRet = "form_gestor"; + sRet = "acesso"; + } + else if(permissao.intValue() == 7) // director geral rh + { + //sRet = "form_rh"; + //sRet = "form_dir_ger_rh"; + sRet = "acesso"; + } + else if(permissao.intValue() == 8) // director siprp + { + //sRet = "form_dir_siprp"; + sRet = "acesso"; + } + else if(permissao.intValue() == 9) // director loja + { + sRet = "acesso"; + } + else if(permissao.intValue() == 10) // director nacional de seguranca + { + sRet = "acesso"; + } + } + + u.setCodigo_permissao( permissao ); + getSessionBean1().setCurrentUser( u ); + getSessionBean1().setLoggedIn( true ); + initializeClock(); + initializeDropDownOptions(); + + // só para testes. retirar depois : + ///getSessionBean1().setModoEdicaoUtilizador("new"); + ///sRet = "create_user"; + } + catch ( Exception e1 ) + { + ErrorLogger.logException( e1 ); + getSessionBean1().setMsg("Não tem permissão para entrar na aplicação !"); + } + } + + } + else + { + getSessionBean1().setMsg("Utilizador inválido ! "); + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + getSessionBean1().setMsg("Utilizador inválido ! "); + } + } + else + { + getSessionBean1().setMsg("Falta palavra-chave !"); + } + } + else + { + getSessionBean1().setMsg("Falta palavra-chave !"); + } + } + else + { + getSessionBean1().setMsg("Falta utilizador !"); + } + } + else + { + getSessionBean1().setMsg("Falta utilizador !"); + } + return sRet; + } + + public String lnkPassRecovery_action() + { + return "recuperar_password"; + } + +// private void connect() +// { +// db.Db db = new db.Db(); +// try +// { +// Connection connection = db.connect(); +// } +// catch(Exception ex) +// { +// getSessionBean1().setMsg("Erro na ligação à Base de Dados"); +// //***** terminate session +// try +// { +// getExternalContext().redirect("faces/Erro.jsp"); +// } +// catch ( Exception e ) +// { +// ErrorLogger.logException( e ); +// } +// ErrorLogger.logException( ex ); +// } +// } + + private void initializeClock() + { + com.sun.rave.web.ui.model.Option[] horasOptions = new com.sun.rave.web.ui.model.Option[25]; + horasOptions[0] = new Option(new Integer(-1), "-"); + int j = 0; + String str_j = ""; + for(int i=1; i < 25; i++) + { + if(j < 10) + { + str_j = "0" + new Integer(j).toString(); + } + else + { + str_j = new Integer(j).toString(); + } + horasOptions[i] = new Option(new Integer(j), str_j); + j++; + } + getSessionBean1().setHorasOptions(horasOptions); + + com.sun.rave.web.ui.model.Option[] minutosOptions = new com.sun.rave.web.ui.model.Option[13]; + minutosOptions[0] = new Option(new Integer(-1), "-"); + j = 0; + for(int i=1; i < 13; i++) + { + if(j < 10) + { + str_j = "0" + new Integer(j).toString(); + } + else + { + str_j = new Integer(j).toString(); + } + minutosOptions[i] = new Option(new Integer(j), str_j); + j += 5; + } + getSessionBean1().setMinutosOptions(minutosOptions); + } + + private void initializeDropDownOptions() + { +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); +// try +// { +// getSessionBean1().setTecnicosOptions(udp.getTecnicosSaudeList()); +// //drpTipo.setSelected(new Integer(0)); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + +// try +// { +// getSessionBean1().setMedicosOptions(udp.getMedicosList()); +// //drpTipo.setSelected(new Integer(0)); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + getSessionBean1().setCausasOptions( adp.getCausasAcidente( false ) ); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + getSessionBean1().setDepartamentoOptions(adp.getDepartamentosList()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + } + + private boolean mustChangePassword(Utilizador u) + { + java.util.Date now = new java.util.Date(); + Calendar cal = new GregorianCalendar(); + cal.setTime(now); + int ano = cal.get(Calendar.YEAR); + int mes = cal.get(Calendar.MONTH); + int dia = cal.get(Calendar.DAY_OF_MONTH); + + Calendar today = new GregorianCalendar(ano, mes, dia); + Calendar firstJan = new GregorianCalendar(ano, Calendar.JANUARY, 1); +// Calendar firstJan = new GregorianCalendar(ano, Calendar.DECEMBER, 27); + Calendar firstJul = new GregorianCalendar(ano, Calendar.JULY, 1); + + if(today.compareTo(firstJan) == 0 || today.compareTo(firstJul) == 0) + { + return true; + } + + if(u.getData_password() == null) + { + return true; + } + else + { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try + { + java.util.Date dt_password = sdf.parse(u.getData_password().toString()); + Calendar cal_dt_password = new GregorianCalendar(); + cal_dt_password.setTime(dt_password); + cal_dt_password.add(GregorianCalendar.MONTH, 6); + if(cal.compareTo(cal_dt_password) > 0) + { + return true; + } + else + { + return false; + } + + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + } + return false; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/NewUser.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/NewUser.java new file mode 100644 index 00000000..3b713ced --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/NewUser.java @@ -0,0 +1,176 @@ +/* + * NewUser.java + * + * Created on December 4, 2007, 11:29 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class NewUser { + private Integer tipo; + private String tipo_descricao; + private String nome; + private Integer estabelecimento; + private String estabelecimento_descricao; + private String login; + private String password; + private String email; + + private String numero_mecanografico; + private Integer empresa_id; + private String numero_cedula; + private String cap; + private Integer funcionario_hst_id; + private Integer medico_id; + private String responsavel_loja; + private String gestor_geral; + private String activo; + + /** Creates a new instance of NewUser */ + public NewUser() { + } + + public Integer getTipo() { + return tipo; + } + + public void setTipo(Integer tipo) { + this.tipo = tipo; + } + + public String getTipo_descricao() { + return tipo_descricao; + } + + public void setTipo_descricao(String tipo_descricao) { + this.tipo_descricao = tipo_descricao; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public Integer getEstabelecimento() { + return estabelecimento; + } + + public void setEstabelecimento(Integer estabelecimento) { + this.estabelecimento = estabelecimento; + } + + public String getEstabelecimento_descricao() { + return estabelecimento_descricao; + } + + public void setEstabelecimento_descricao(String estabelecimento_descricao) { + this.estabelecimento_descricao = estabelecimento_descricao; + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getNumero_mecanografico() { + return numero_mecanografico; + } + + public void setNumero_mecanografico(String numero_mecanografico) { + this.numero_mecanografico = numero_mecanografico; + } + + public Integer getEmpresa_id() { + return empresa_id; + } + + public void setEmpresa_id(Integer empresa_id) { + this.empresa_id = empresa_id; + } + + public String getNumero_cedula() { + return numero_cedula; + } + + public void setNumero_cedula(String numero_cedula) { + this.numero_cedula = numero_cedula; + } + + public String getCap() { + return cap; + } + + public void setCap(String cap) { + this.cap = cap; + } + + public Integer getFuncionario_hst_id() { + return funcionario_hst_id; + } + + public void setFuncionario_hst_id(Integer funcionario_hst_id) { + this.funcionario_hst_id = funcionario_hst_id; + } + + public Integer getMedico_id() { + return medico_id; + } + + public void setMedico_id(Integer medico_id) { + this.medico_id = medico_id; + } + + public String getResponsavel_loja() { + return responsavel_loja; + } + + public void setResponsavel_loja(String responsavel_loja) { + this.responsavel_loja = responsavel_loja; + } + + public String getActivo() { + return activo; + } + + public void setActivo(String activo) { + this.activo = activo; + } + + public String getGestor_geral() { + return gestor_geral; + } + + public void setGestor_geral(String gestor_geral) { + this.gestor_geral = gestor_geral; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/NovoUtilizador.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/NovoUtilizador.java new file mode 100644 index 00000000..d9c3c784 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/NovoUtilizador.java @@ -0,0 +1,2036 @@ +/* + * NovoUtilizador.java + * + * Created on December 3, 2007, 2:30 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Medico; +import beans.Trabalhador; +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.data.provider.RowKey; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Checkbox; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.RadioButton; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.Table; +import com.sun.rave.web.ui.component.TableColumn; +import com.sun.rave.web.ui.component.TableRowGroup; +import com.sun.rave.web.ui.component.TextField; +import db.providers.AnalisesDataProvider; +import db.providers.TrabalhadoresListDataProvider; +import global.Global; +import java.util.ArrayList; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.JSFUtils; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class NovoUtilizador extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg1() { + return gridMsg1; + } + + public void setGridMsg1(HtmlPanelGrid hpg) { + this.gridMsg1 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private Button butContinuar = new Button(); + + public Button getButContinuar() { + return butContinuar; + } + + public void setButContinuar(Button b) { + this.butContinuar = b; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private HtmlPanelGrid gridCategoria = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCategoria() { + return gridCategoria; + } + + public void setGridCategoria(HtmlPanelGrid hpg) { + this.gridCategoria = hpg; + } + + private HtmlPanelGrid gridUtilizador = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridUtilizador() { + return gridUtilizador; + } + + public void setGridUtilizador(HtmlPanelGrid hpg) { + this.gridUtilizador = hpg; + } + + private PanelGroup pgCatDirRh = new PanelGroup(); + + public PanelGroup getPgCatDirRh() { + return pgCatDirRh; + } + + public void setPgCatDirRh(PanelGroup pg) { + this.pgCatDirRh = pg; + } + + private RadioButton rbCatDirRh = new RadioButton(); + + public RadioButton getRbCatDirRh() { + return rbCatDirRh; + } + + public void setRbCatDirRh(RadioButton rbCatGestao) { + this.rbCatDirRh = rbCatGestao; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private PanelGroup pgCatGestao = new PanelGroup(); + + public PanelGroup getPgCatGestao() { + return pgCatGestao; + } + + public void setPgCatGestao(PanelGroup pg) { + this.pgCatGestao = pg; + } + + private RadioButton rbCatGestao = new RadioButton(); + + public RadioButton getRbCatGestao() { + return rbCatGestao; + } + + public void setRbCatGestao(RadioButton rbCatGestao) { + this.rbCatGestao = rbCatGestao; + } + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private PanelGroup pgCatGestaoAd = new PanelGroup(); + + public PanelGroup getPgCatGestaoAd() { + return pgCatGestaoAd; + } + + public void setPgCatGestaoAd(PanelGroup pg) { + this.pgCatGestaoAd = pg; + } + + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() { + return staticText13; + } + + public void setStaticText13(StaticText st) { + this.staticText13 = st; + } + + private Checkbox chkGestaoGeral = new Checkbox(); + + public Checkbox getChkGestaoGeral() { + return chkGestaoGeral; + } + + public void setChkGestaoGeral(Checkbox c) { + this.chkGestaoGeral = c; + } + + private PanelGroup pgCatHs = new PanelGroup(); + + public PanelGroup getPgCatHs() { + return pgCatHs; + } + + public void setPgCatHs(PanelGroup pg) { + this.pgCatHs = pg; + } + + private RadioButton rbCatHs = new RadioButton(); + + public RadioButton getRbCatHs() { + return rbCatHs; + } + + public void setRbCatHs(RadioButton rbCatGestao) { + this.rbCatHs = rbCatGestao; + } + + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() { + return staticText14; + } + + public void setStaticText14(StaticText st) { + this.staticText14 = st; + } + + private PanelGroup pgCatMed = new PanelGroup(); + + public PanelGroup getPgCatMed() { + return pgCatMed; + } + + public void setPgCatMed(PanelGroup pg) { + this.pgCatMed = pg; + } + + private RadioButton rbCatMed = new RadioButton(); + + public RadioButton getRbCatMed() { + return rbCatMed; + } + + public void setRbCatMed(RadioButton rbCatGestao) { + this.rbCatMed = rbCatGestao; + } + + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() { + return staticText15; + } + + public void setStaticText15(StaticText st) { + this.staticText15 = st; + } + + private PanelGroup pgCatRh = new PanelGroup(); + + public PanelGroup getPgCatRh() { + return pgCatRh; + } + + public void setPgCatRh(PanelGroup pg) { + this.pgCatRh = pg; + } + + private RadioButton rbCatRh = new RadioButton(); + + public RadioButton getRbCatRh() { + return rbCatRh; + } + + public void setRbCatRh(RadioButton rbCatGestao) { + this.rbCatRh = rbCatGestao; + } + + private StaticText staticText16 = new StaticText(); + + public StaticText getStaticText16() { + return staticText16; + } + + public void setStaticText16(StaticText st) { + this.staticText16 = st; + } + + private PanelGroup pgCatRhAd = new PanelGroup(); + + public PanelGroup getPgCatRhAd() { + return pgCatRhAd; + } + + public void setPgCatRhAd(PanelGroup pg) { + this.pgCatRhAd = pg; + } + + private StaticText staticText17 = new StaticText(); + + public StaticText getStaticText17() { + return staticText17; + } + + public void setStaticText17(StaticText st) { + this.staticText17 = st; + } + + private Checkbox chkRhResp = new Checkbox(); + + public Checkbox getChkRhResp() { + return chkRhResp; + } + + public void setChkRhResp(Checkbox c) { + this.chkRhResp = c; + } + + private PanelGroup pgCatSeg = new PanelGroup(); + + public PanelGroup getPgCatSeg() { + return pgCatSeg; + } + + public void setPgCatSeg(PanelGroup pg) { + this.pgCatSeg = pg; + } + + private RadioButton rbCatSeg = new RadioButton(); + + public RadioButton getRbCatSeg() { + return rbCatSeg; + } + + public void setRbCatSeg(RadioButton rbCatGestao) { + this.rbCatSeg = rbCatGestao; + } + + private StaticText staticText18 = new StaticText(); + + public StaticText getStaticText18() { + return staticText18; + } + + public void setStaticText18(StaticText st) { + this.staticText18 = st; + } + + private PanelGroup pgCatSegAd = new PanelGroup(); + + public PanelGroup getPgCatSegAd() { + return pgCatSegAd; + } + + public void setPgCatSegAd(PanelGroup pg) { + this.pgCatSegAd = pg; + } + + private StaticText staticText19 = new StaticText(); + + public StaticText getStaticText19() { + return staticText19; + } + + public void setStaticText19(StaticText st) { + this.staticText19 = st; + } + + private Checkbox chkSegResp = new Checkbox(); + + public Checkbox getChkSegResp() { + return chkSegResp; + } + + public void setChkSegResp(Checkbox c) { + this.chkSegResp = c; + } + + private HtmlPanelGrid gridTrabalhadores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTrabalhadores() { + return gridTrabalhadores; + } + + public void setGridTrabalhadores(HtmlPanelGrid hpg) { + this.gridTrabalhadores = hpg; + } + + private StaticText txtSearchMsg1 = new StaticText(); + + public StaticText getTxtSearchMsg1() { + return txtSearchMsg1; + } + + public void setTxtSearchMsg1(StaticText st) { + this.txtSearchMsg1 = st; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() { + return staticText4; + } + + public void setStaticText4(StaticText st) { + this.staticText4 = st; + } + + private TextField txtNrMecanografico = new TextField(); + + public TextField getTxtNrMecanografico() { + return txtNrMecanografico; + } + + public void setTxtNrMecanografico(TextField tf) { + this.txtNrMecanografico = tf; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private TextField txtNomeTrabalhador = new TextField(); + + public TextField getTxtNomeTrabalhador() { + return txtNomeTrabalhador; + } + + public void setTxtNomeTrabalhador(TextField tf) { + this.txtNomeTrabalhador = tf; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private Button butProcurarTrab = new Button(); + + public Button getButProcurarTrab() { + return butProcurarTrab; + } + + public void setButProcurarTrab(Button b) { + this.butProcurarTrab = b; + } + + private Table tblTrabalhadores = new Table(); + + public Table getTblTrabalhadores() { + return tblTrabalhadores; + } + + public void setTblTrabalhadores(Table t) { + this.tblTrabalhadores = t; + } + + private TableRowGroup tableRowGroup1 = new TableRowGroup(); + + public TableRowGroup getTableRowGroup1() { + return tableRowGroup1; + } + + public void setTableRowGroup1(TableRowGroup trg) { + this.tableRowGroup1 = trg; + } + + private TableColumn tableColumn1 = new TableColumn(); + + public TableColumn getTableColumn1() { + return tableColumn1; + } + + public void setTableColumn1(TableColumn tc) { + this.tableColumn1 = tc; + } + + private Hyperlink lnkPOR = new Hyperlink(); + + public Hyperlink getLnkPOR() { + return lnkPOR; + } + + public void setLnkPOR(Hyperlink h) { + this.lnkPOR = h; + } + + private TableColumn tableColumn2 = new TableColumn(); + + public TableColumn getTableColumn2() { + return tableColumn2; + } + + public void setTableColumn2(TableColumn tc) { + this.tableColumn2 = tc; + } + + private Hyperlink lnkNomeTrabalhador = new Hyperlink(); + + public Hyperlink getLnkNomeTrabalhador() { + return lnkNomeTrabalhador; + } + + public void setLnkNomeTrabalhador(Hyperlink h) { + this.lnkNomeTrabalhador = h; + } + + private TableColumn tableColumn3 = new TableColumn(); + + public TableColumn getTableColumn3() { + return tableColumn3; + } + + public void setTableColumn3(TableColumn tc) { + this.tableColumn3 = tc; + } + + private Hyperlink lnkEstabelecimentoTrabalhador = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoTrabalhador() { + return lnkEstabelecimentoTrabalhador; + } + + public void setLnkEstabelecimentoTrabalhador(Hyperlink h) { + this.lnkEstabelecimentoTrabalhador = h; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private StaticText stOutro = new StaticText(); + + public StaticText getStOutro() { + return stOutro; + } + + public void setStOutro(StaticText st) { + this.stOutro = st; + } + + private HtmlPanelGrid gridOutro = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridOutro() { + return gridOutro; + } + + public void setGridOutro(HtmlPanelGrid hpg) { + this.gridOutro = hpg; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private TextField txtNomeOutro = new TextField(); + + public TextField getTxtNomeOutro() { + return txtNomeOutro; + } + + public void setTxtNomeOutro(TextField tf) { + this.txtNomeOutro = tf; + } + + private StaticText staticText20 = new StaticText(); + + public StaticText getStaticText20() { + return staticText20; + } + + public void setStaticText20(StaticText st) { + this.staticText20 = st; + } + + private DropDown drpEstabelecimentoOutro = new DropDown(); + + public DropDown getDrpEstabelecimentoOutro() { + return drpEstabelecimentoOutro; + } + + public void setDrpEstabelecimentoOutro(DropDown dd) { + this.drpEstabelecimentoOutro = dd; + } + + private HtmlPanelGrid gridTecnicosHs = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTecnicosHs() { + return gridTecnicosHs; + } + + public void setGridTecnicosHs(HtmlPanelGrid hpg) { + this.gridTecnicosHs = hpg; + } + + private StaticText staticText21 = new StaticText(); + + public StaticText getStaticText21() { + return staticText21; + } + + public void setStaticText21(StaticText st) { + this.staticText21 = st; + } + + private DropDown drpNomeHs = new DropDown(); + + public DropDown getDrpNomeHs() { + return drpNomeHs; + } + + public void setDrpNomeHs(DropDown dd) { + this.drpNomeHs = dd; + } + + private StaticText staticText22 = new StaticText(); + + public StaticText getStaticText22() { + return staticText22; + } + + public void setStaticText22(StaticText st) { + this.staticText22 = st; + } + + private TextField txtCap = new TextField(); + + public TextField getTxtCap() { + return txtCap; + } + + public void setTxtCap(TextField tf) { + this.txtCap = tf; + } + + private HtmlPanelGrid gridMedicos = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedicos() { + return gridMedicos; + } + + public void setGridMedicos(HtmlPanelGrid hpg) { + this.gridMedicos = hpg; + } + + private StaticText staticText23 = new StaticText(); + + public StaticText getStaticText23() { + return staticText23; + } + + public void setStaticText23(StaticText st) { + this.staticText23 = st; + } + + private DropDown drpNomeMed = new DropDown(); + + public DropDown getDrpNomeMed() { + return drpNomeMed; + } + + public void setDrpNomeMed(DropDown dd) { + this.drpNomeMed = dd; + } + + private StaticText staticText24 = new StaticText(); + + public StaticText getStaticText24() { + return staticText24; + } + + public void setStaticText24(StaticText st) { + this.staticText24 = st; + } + + private DropDown drpEstabelecimentoMed = new DropDown(); + + public DropDown getDrpEstabelecimentoMed() { + return drpEstabelecimentoMed; + } + + public void setDrpEstabelecimentoMed(DropDown dd) { + this.drpEstabelecimentoMed = dd; + } + + //
+ boolean isPostback = false; + + private HiddenField hidHighlight = new HiddenField(); + + public HiddenField getHidHighlight() { + return hidHighlight; + } + + public void setHidHighlight(HiddenField hf) { + this.hidHighlight = hf; + } + + private HiddenField hidClear = new HiddenField(); + + public HiddenField getHidClear() { + return hidClear; + } + + public void setHidClear(HiddenField hf) { + this.hidClear = hf; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText staticText25 = new StaticText(); + + public StaticText getStaticText25() { + return staticText25; + } + + public void setStaticText25(StaticText st) { + this.staticText25 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText26 = new StaticText(); + + public StaticText getStaticText26() { + return staticText26; + } + + public void setStaticText26(StaticText st) { + this.staticText26 = st; + } + private RadioButton rbCatDirNacSeg = new RadioButton(); + + public RadioButton getRbCatDirNacSeg() { + return rbCatDirNacSeg; + } + + public void setRbCatDirNacSeg(RadioButton rb) { + this.rbCatDirNacSeg = rb; + } + private RadioButton rbCatDirLoja = new RadioButton(); + + public RadioButton getRbCatDirLoja() { + return rbCatDirLoja; + } + + public void setRbCatDirLoja(RadioButton rb) { + this.rbCatDirLoja = rb; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + /** + *

Construct a new Page bean instance.

+ */ + public NovoUtilizador() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("NovoUtilizador Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + else + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(!pageFrom.matches("NovoUtilizador.jsp")) + { + isPostback = false; + } + else + { + isPostback = true; + } + + } + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + Utilizador u = getSessionBean1().getCurrentUser(); + FacesContext fc = getFacesContext().getCurrentInstance(); + if(u.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP && u.getTipo().intValue() != Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + try + { + JSFUtils.logout( fc, true ); + } + catch( Exception ex ) + { + throw new RuntimeException( ex ); + } + return; + } + if(!isPostback) + { + getSessionBean1().setNewUser(null); + initializePage(); + } + else + { + showPagePostback(); + } + + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + + getSessionBean1().setNavFrom("NovoUtilizador"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + return "user"; + + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public void drpTipo_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public void drpNome_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String butCancelar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return "gestao_utilizadores"; + } + + public String butApagar_action() + { + return null; + } + + public String butContinuar_action() + { + if(rbCatHs.getSelected() != null) + { + if(rbCatHs.getSelected().equals(new Boolean(true))) + { + if(drpNomeHs.getSelected().equals(new Integer(0) )) + { + getSessionBean1().setMsg("Falta nome do técnico de higiena e segurança!"); + return null; + } + else if(txtCap.getText() == null) + { + getSessionBean1().setMsg("Falta cap!"); + return null; + } + else + { + String cap = (String) txtCap.getText(); + if(cap.trim().length() == 0) + { + getSessionBean1().setMsg("Falta cap!"); + return null; + } + else + { + NewUser u = new NewUser(); + u.setTipo(new Integer(3)); + u.setNumero_mecanografico(""); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + u.setTipo_descricao(adp.getTipoDescricao(u.getTipo())); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + u.setFuncionario_hst_id((Integer) drpNomeHs.getSelected()); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Integer tecnico_id = (Integer) drpNomeHs.getSelected(); + u.setNome(Utils.unicodeToHTML(adp.getTecnicoSaudeNome(tecnico_id))); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + u.setCap(cap); + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + u.setResponsavel_loja("n"); + u.setEstabelecimento(null); + getSessionBean1().setNewUser(u); + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + return "new_user_fields"; + } + } + } + } + else if(rbCatMed.getSelected() != null) + { + if(rbCatMed.getSelected().equals(new Boolean(true))) + { + if(drpNomeMed.getSelected().equals(new Integer(0))) + { + getSessionBean1().setMsg("Falta nome do médico!"); + return null; + } + else if(drpEstabelecimentoMed.getSelected().equals(new Integer(-1))) + { + getSessionBean1().setMsg("Falta estabelecimento!"); + return null; + } + else + { + NewUser u = new NewUser(); + u.setTipo(new Integer(5)); + u.setNumero_mecanografico(""); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + u.setTipo_descricao(adp.getTipoDescricao(u.getTipo())); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + u.setMedico_id((Integer) drpNomeMed.getSelected()); + //u.setNome(drpNomeMed.getLabel()); + Medico m = null; + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Integer medico_id = (Integer) drpNomeMed.getSelected(); + m = adp.getMedico(medico_id); + u.setNome(m.getNome()); + u.setNumero_cedula(m.getNumero_cedula()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + u.setEstabelecimento((Integer) drpEstabelecimentoMed.getSelected()); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + u.setEstabelecimento_descricao(adp.getEstabelecimentoNome(u.getEstabelecimento())); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + u.setResponsavel_loja("n"); + getSessionBean1().setNewUser(u); + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + return "new_user_fields"; + } + } + } + else // + { + if(getSessionBean1().getNewUser() == null) + { + boolean booOutro = false; + NewUser u = new NewUser(); + if(txtNomeOutro.getText() != null) + { + String nome_outro = (String) txtNomeOutro.getText(); + if(nome_outro.trim().length() > 0) + { + u.setNome(nome_outro); + booOutro = true; + } + else + { + getSessionBean1().setMsg("Falta designação!"); + return null; + } + } + else + { + getSessionBean1().setMsg("Falta designação!"); + return null; + } + Integer estabelecimento_outro = (Integer) drpEstabelecimentoOutro.getSelected(); + System.out.println("ESTABELECIMENTO OUTRO : " + estabelecimento_outro.intValue()); + if(estabelecimento_outro.intValue() == -1) + { + getSessionBean1().setMsg("Falta estabelecimento!"); + return null; + } + else + { + u.setEstabelecimento(estabelecimento_outro); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + u.setEstabelecimento_descricao(adp.getEstabelecimentoNome(estabelecimento_outro)); + booOutro = true; + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + u = setUserTipo(u); + u.setNumero_mecanografico(""); + u.setResponsavel_loja("n"); + u.setGestor_geral("n"); + switch(u.getTipo().intValue()) + { + case 1: //seg + if(chkSegResp.getSelected() != null) + { + if(chkSegResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + break; + case 2: //rh + if(chkRhResp.getSelected() != null) + { + if(chkRhResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + break; + case 6: //gestor + if(chkGestaoGeral.getSelected() != null) + { + if(chkGestaoGeral.getSelected().equals(new Boolean(true))) + { + u.setGestor_geral("y"); + } + } + + break; + } + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + if(booOutro) + { + getSessionBean1().setNewUser(u); + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + return "new_user_fields"; + } + getSessionBean1().setNewUser(u); + } + } + + if(getSessionBean1().getNewUser() == null) + { + getSessionBean1().setMsg("Tem de definir um novo utilizador !"); + return null; + } + else + { + + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + return "new_user_fields"; + } + } + + + + private void initializePage() + { + getSessionBean1().getTrabalhadoresListDataProvider().setList(new ArrayList()); + int tipo = getSessionBean1().getCurrentUser().getTipo().intValue(); + switch(tipo) + { + case 7: //Director RH + pgCatDirRh.setRendered(false); + pgCatHs.setRendered(false); + pgCatMed.setRendered(false); + break; + } + + //gridUtilizador.setRendered(false); + gridTrabalhadores.setStyleClass("hidden"); + tblTrabalhadores.setStyleClass("hidden"); + gridTecnicosHs.setStyleClass("hidden"); + gridMedicos.setStyleClass("hidden"); + + rbCatDirRh.setSelected(null); + rbCatGestao.setSelected(null); + rbCatHs.setSelected(null); + rbCatMed.setSelected(null); + rbCatRh.setSelected(null); + rbCatSeg.setSelected(null); + rbCatDirNacSeg.setSelected(null); + rbCatDirLoja.setSelected(null); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + com.sun.rave.web.ui.model.Option[] listMedOptions = adp.getEstabelecimentosList( new Integer(Global.AUCHAN), new Boolean(false)); + listMedOptions[0].setLabel("-Seleccionar-"); + com.sun.rave.web.ui.model.Option[] listOutroOptions = adp.getEstabelecimentosList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(false)); + listOutroOptions[0].setLabel("-Seleccionar-"); + + + getSessionBean1().setEstabelecimentosMedOptions(listMedOptions); + getSessionBean1().setEstabelecimentosOutroOptions( listOutroOptions ); + drpEstabelecimentoOutro.setSelected(new Integer(-1)); + drpEstabelecimentoMed.setSelected(new Integer(-1)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + getSessionBean1().setTecnicosOptions(adp.getTecnicosSaudeList()); + drpNomeHs.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + getSessionBean1().setMedicosOptions(adp.getMedicosList()); + drpNomeMed.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + public String butProcurarTrab_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + boolean booNrOk = false; + boolean booNomeOk = false; + String nr_mecano = null; + String nome = null; + if(txtNrMecanografico.getText() != null) + { + nr_mecano = (String) txtNrMecanografico.getText(); + if(nr_mecano.trim().length() > 0) + { + booNrOk = true; + } + else + { + nr_mecano = null; + } + } + + if(txtNomeTrabalhador.getText() != null) + { + nome = (String) txtNomeTrabalhador.getText(); + + if(nome.trim().length() > 0) + { + booNomeOk = true; + } + else + { + nome = null; + } + } + + if(! booNrOk && !booNomeOk) + { + getSessionBean1().setMsg("Tem de preencher Numero Mecanográfico ou Nome"); + return null; + } + + Trabalhador t = null; + if(nome != null) + { + nome = utils.Utils.textToUnicode( nome.toUpperCase()); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.searchTrabalhador(getSessionBean1().getCurrentUser().getEmpresa_id(), nr_mecano, nome ); +// if(list.size() == 1) +// { +// t = (Trabalhador) list.get(0); +// NewUser u = new NewUser(); +// +// u.setNome(t.getNome()); +// u.setNumero_mecanografico(t.getNumero_mecanografico()); +// u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); +// u.setEstabelecimento(t.getEstabelecimento_id()); +// u.setEstabelecimento_descricao(t.getEstabelecimento()); +// u = setUserTipo(u); +// u.setResponsavel_loja("n"); +// if(u.getTipo().intValue() == 1) //seg +// { +// if(chkSegResp.getSelected() != null) +// { +// if(chkSegResp.getSelected().equals(new Boolean(true))) +// { +// u.setResponsavel_loja("y"); +// } +// } +// } +// else if(u.getTipo().intValue() == 2) //rh +// { +// if(chkRhResp.getSelected() != null) +// { +// if(chkRhResp.getSelected().equals(new Boolean(true))) +// { +// u.setResponsavel_loja("y"); +// } +// } +// } +// getSessionBean1().setNewUser(u); +// } +// else +// { + //tblTrabalhadores.setRendered(true); + gridTrabalhadores.setStyleClass(""); + tblTrabalhadores.setStyleClass(""); + getSessionBean1().getTrabalhadoresListDataProvider().setList(list); +// } + } + catch(Exception ex) + { + getSessionBean1().setMsg("Trabalhador inexistente !"); + getSessionBean1().getTrabalhadoresListDataProvider().setList(new ArrayList()); + tblTrabalhadores.setStyleClass("hidden"); + ErrorLogger.logException( ex ); + } + return null; + } + + public String lnkPOR_action() { + // TODO: Replace with your code + Trabalhador t = getTrabalhadorRowData(); + NewUser u = new NewUser(); + u = setUserTipo(u); + u.setNome(t.getNome()); + u.setNumero_mecanografico(t.getNumero_mecanografico()); + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + u.setEstabelecimento(t.getEstabelecimento_id()); + u.setEstabelecimento_descricao(t.getEstabelecimento()); + u.setResponsavel_loja("n"); + u.setGestor_geral("n"); + if(u.getTipo().intValue() == 1) //seg + { + if(chkSegResp.getSelected() != null) + { + if(chkSegResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + } + else if(u.getTipo().intValue() == 2) //rh + { + if(chkRhResp.getSelected() != null) + { + if(chkRhResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + } + else if(u.getTipo().intValue() == 6) //gestor + { + if(chkGestaoGeral.getSelected() != null) + { + if(chkGestaoGeral.getSelected().equals(new Boolean(true))) + { + u.setGestor_geral("y"); + } + } + + } + + + getSessionBean1().setNewUser(u); + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + + return "new_user_fields"; + } + + public String lnkNomeTrabalhador_action() { + // TODO: Replace with your code + Trabalhador t = getTrabalhadorRowData(); + NewUser u = new NewUser(); + u = setUserTipo(u); + u.setNome(t.getNome()); + u.setNumero_mecanografico(t.getNumero_mecanografico()); + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + u.setEstabelecimento(t.getEstabelecimento_id()); + u.setEstabelecimento_descricao(t.getEstabelecimento()); + u.setResponsavel_loja("n"); + u.setGestor_geral("n"); + if(u.getTipo().intValue() == 1) //seg + { + if(chkSegResp.getSelected() != null) + { + if(chkSegResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + } + else if(u.getTipo().intValue() == 2) //rh + { + if(chkRhResp.getSelected() != null) + { + if(chkRhResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + } + else if(u.getTipo().intValue() == 6) //gestor + { + if(chkGestaoGeral.getSelected() != null) + { + if(chkGestaoGeral.getSelected().equals(new Boolean(true))) + { + u.setGestor_geral("y"); + } + } + + } + + getSessionBean1().setNewUser(u); + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + + return "new_user_fields"; + } + + public String lnkEstabelecimentoTrabalhador_action() { + // TODO: Replace with your code + Trabalhador t = getTrabalhadorRowData(); + NewUser u = new NewUser(); + u = setUserTipo(u); + u.setNome(t.getNome()); + u.setNumero_mecanografico(t.getNumero_mecanografico()); + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + u.setEstabelecimento(t.getEstabelecimento_id()); + u.setEstabelecimento_descricao(t.getEstabelecimento()); + u.setResponsavel_loja("n"); + u.setGestor_geral("n"); + if(u.getTipo().intValue() == 1) //seg + { + if(chkSegResp.getSelected() != null) + { + if(chkSegResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + } + else if(u.getTipo().intValue() == 2) //rh + { + if(chkRhResp.getSelected() != null) + { + if(chkRhResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + } + else if(u.getTipo().intValue() == 6) //gestor + { + if(chkGestaoGeral.getSelected() != null) + { + if(chkGestaoGeral.getSelected().equals(new Boolean(true))) + { + u.setGestor_geral("y"); + } + } + + } + + getSessionBean1().setNewUser(u); + getSessionBean1().setModoEdicaoUtilizador("new"); + getSessionBean1().setNavFrom("NovoUtilizador"); + + return "new_user_fields"; + } + + private Trabalhador getTrabalhadorRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + Trabalhador t = (Trabalhador)list.get(k); + hidHighlight.setValue(rk.getRowId()); + return t; + } + + private NewUser setUserTipo(NewUser u) + { + if(rbCatDirNacSeg.getSelected() != null) + { + if(rbCatDirNacSeg.getSelected().equals(new Boolean(true))) + { + u.setTipo(new Integer(10)); + } + } + if(rbCatDirLoja.getSelected() != null) + { + if(rbCatDirLoja.getSelected().equals(new Boolean(true))) + { + u.setTipo(new Integer(9)); + } + } + if(rbCatDirRh.getSelected() != null) + { + if(rbCatDirRh.getSelected().equals(new Boolean(true))) + { + u.setTipo(new Integer(7)); + } + } + if(rbCatGestao.getSelected() != null) + { + if(rbCatGestao.getSelected().equals(new Boolean(true))) + { + u.setTipo(new Integer(6)); + } + } + if(rbCatRh.getSelected() != null) + { + if(rbCatRh.getSelected().equals(new Boolean(true))) + { + u.setTipo(new Integer(2)); + } + } + if(rbCatSeg.getSelected() != null) + { + if(rbCatSeg.getSelected().equals(new Boolean(true))) + { + u.setTipo(new Integer(1)); + } + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + u.setTipo_descricao(adp.getTipoDescricao(u.getTipo())); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + return u; + } + + private void showPagePostback() + { + if(rbCatDirRh.getSelected() != null) + { + if(rbCatDirRh.getSelected().equals( new Boolean(true) )) + { + gridTrabalhadores.setStyleClass(""); + return; + } + } + + if(rbCatGestao.getSelected() != null) + { + if(rbCatGestao.getSelected().equals( new Boolean(true) )) + { + gridTrabalhadores.setStyleClass(""); + return; + } + } + + if(rbCatRh.getSelected() != null) + { + if(rbCatRh.getSelected().equals( new Boolean(true) )) + { + gridTrabalhadores.setStyleClass(""); + return; + } + } + if(rbCatSeg.getSelected() != null) + { + if(rbCatSeg.getSelected().equals( new Boolean(true) )) + { + gridTrabalhadores.setStyleClass(""); + return; + } + } + + if(rbCatHs.getSelected() != null) + { + if(rbCatHs.getSelected().equals( new Boolean(true) )) + { + gridTecnicosHs.setStyleClass(""); + return; + } + } + + if(rbCatMed.getSelected() != null) + { + if(rbCatMed.getSelected().equals( new Boolean(true) )) + { + gridMedicos.setStyleClass(""); + return; + } + } + + } + +// public String getColumnStyle(){ +// TableRowDataProvider trdp = (TableRowDataProvider) getBean("currentRow"); +// RowKey rowKey = trdp.getTableRow(); +// System.out.println(rowKey); +// if ((Integer.parseInt(rowKey.getRowId()) % 2) == 0){ +// return " "; +// } +// else { +// return "background-color: #eeeeee"; +// } +// } + + private void setNewUser() + { + + NewUser u = new NewUser(); + u = setUserTipo(u); + u.setNumero_mecanografico(""); + u.setResponsavel_loja("n"); + u.setGestor_geral("n"); + switch(u.getTipo().intValue()) + { + case 1: //seg + if(chkSegResp.getSelected() != null) + { + if(chkSegResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + break; + case 2: //rh + if(chkRhResp.getSelected() != null) + { + if(chkRhResp.getSelected().equals(new Boolean(true))) + { + u.setResponsavel_loja("y"); + } + } + break; + case 6: //gestor + if(chkGestaoGeral.getSelected() != null) + { + if(chkGestaoGeral.getSelected().equals(new Boolean(true))) + { + u.setGestor_geral("y"); + } + } + + break; + } + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + + + return "gestao_utilizadores"; + } + + public String lnkAnalisesAcidente_action() { + // TODO: Replace with your code + Integer tipo_utilizador = getSessionBean1().getCurrentUser().getTipo(); + if(tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + return "form_dir_siprp"; + } + else if(tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + return "form_dir_ger_rh"; + } + + return null; + } + + public void rbCatRh_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + } + + public void rbCatHs_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String lnkAjuda_action() { + // TODO: Replace with your code +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkPlanosActuacao_action() { + // TODO: Replace with your code + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/RecuperarPassword.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/RecuperarPassword.java new file mode 100644 index 00000000..8ff0e365 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/RecuperarPassword.java @@ -0,0 +1,551 @@ +/* + * RecuperarPassword.java + * + * Created on September 19, 2007, 9:57 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextField; +import db.providers.UtilizadoresDataProvider; +import global.Global; +import java.util.Date; +import java.util.Properties; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.mail.BodyPart; +import javax.mail.Message; +import javax.mail.Multipart; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class RecuperarPassword extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private TextField txtUtilizador = new TextField(); + + public TextField getTxtUtilizador() { + return txtUtilizador; + } + + public void setTxtUtilizador(TextField tf) { + this.txtUtilizador = tf; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private TextField txtEmail = new TextField(); + + public TextField getTxtEmail() { + return txtEmail; + } + + public void setTxtEmail(TextField tf) { + this.txtEmail = tf; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private Button butOk = new Button(); + + public Button getButOk() { + return butOk; + } + + public void setButOk(Button b) { + this.butOk = b; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public RecuperarPassword() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("RecuperarPassword Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here +// if (!getSessionBean1().isLoggedIn()) { +// try { +// getExternalContext().redirect("Login.jsp"); +// } catch(Exception e) { +// // . . . handle exception . . . +// } +// } + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String butLogin_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return null; + } + + public String butCancelar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return "login"; + } + + public String butOk_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + + if(fieldsValidationOk()) + { + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + String utilizador = (String) txtUtilizador.getText(); + Utilizador u = udp.getUtilizador(utilizador); + String email = (String) txtEmail.getText(); + if(u.getEmail().equals(email)) + { + //send mail : + try + { + sendEmail(u.getEmail(), u.getLogin(), u.getPassword(), Global.ENDERECO_ENVIO); + getSessionBean1().setMsg("A sua password foi enviada para o seu email"); + return "login"; + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro no envio da password !"); + ErrorLogger.logException( ex ); + } + + } + else + { + getSessionBean1().setMsg("Os dados não coincidem com os registos !"); + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("Utilizador inválido !"); + } + } + + + return null; + } + + + private final String SMTP_HOST = "mail2.evolute.pt"; + private final int SMTP_PORT = 587; + + private final String mail_username = "acidentes.auchan@siprp.pt"; + private final String mail_password = "EghRzS2l"; + + private void sendEmail(String emailTo, String login, String password, String admin_email) throws Exception + { + Properties props = new Properties(); + //props.put("mail.transport.protocol", "smtp"); + props.put("mail.smtp.host", SMTP_HOST ); + props.put("mail.from", admin_email ); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.user", mail_username ); + props.put("mail.smtp.password", mail_password ); + Session session1 = Session.getInstance(props); + Message msg = new MimeMessage(session1); + +// try +// { + //Address Email_TO = new InternetAddress("myemail@bol.com.br"); + msg.setFrom(new InternetAddress(admin_email)); + InternetAddress[] address = {new InternetAddress(emailTo)}; + msg.setRecipients(Message.RecipientType.TO, address); + msg.setSubject("Envio da password"); + msg.setSentDate(new Date()); + Multipart multipart = new MimeMultipart(); + BodyPart msgBodyPart = new MimeBodyPart(); + String html; + html=" "; + html+=""; + html+="

Envio da password de " + login + " :

"; + html+="

Password: " + password + "

"; + html+=""; + msgBodyPart.setContent(html, "text/html"); + multipart.addBodyPart(msgBodyPart); + msg.setContent(multipart); + +// Transport.send(msg); + Transport t; + t = session1.getTransport( "smtp" ); + + t.connect( SMTP_HOST, SMTP_PORT, mail_username, mail_password ); + t.sendMessage( msg, msg.getAllRecipients() ); + + t.close(); + System.out.println("Email Enviado !!!! " + emailTo + ", " + login); +// } +// catch (Exception ex) +// { +// System.out.println("MAIL ERROR : " + ex.getMessage()); +// ErrorLogger.logException( ex ); +// } + + } + + private boolean fieldsValidationOk() + { + if(txtUtilizador.getText() != null) + { + String utilizador = (String) txtUtilizador.getText(); + if(utilizador.trim().length() == 0) + { + getSessionBean1().setMsg("Falta utilizador !"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta utilizador !"); + return false; + } + + if(txtEmail.getText() != null) + { + String email = (String) txtEmail.getText(); + if(email.trim().length() == 0) + { + getSessionBean1().setMsg("Falta email !"); + return false; + } + else + { + if(! Utils.isValidEmail(email)) + { + getSessionBean1().setMsg("Email inválido !"); + return false; + } + } + } + else + { + getSessionBean1().setMsg("Falta email !"); + return false; + } + + return true; + } + +// private boolean isValidEmail(String email){ +// boolean res = true; +// +// int indexOfAtChar=email.indexOf("@"); +// +// if(indexOfAtChar > 0) +// { +// int indexOfDotChar = +// email.indexOf(".",indexOfAtChar); +// if(indexOfDotChar > 0) +// { +// res = true; +// } +// else +// { +// res = false; +// } +// } +// else{ +// res = false; +// } +// return res; +// } + + +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/RequestBean1.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/RequestBean1.java new file mode 100644 index 00000000..0db656c6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/RequestBean1.java @@ -0,0 +1,108 @@ +/* + * RequestBean1.java + * + * Created on September 18, 2007, 3:14 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractRequestBean; +import javax.faces.FacesException; + +/** + *

Request scope data bean for your application. Create properties + * here to represent data that should be made available across different + * pages in the same HTTP request, so that the page bean classes do not + * have to be directly linked to each other.

+ * + *

An instance of this class will be created for you automatically, + * the first time your application evaluates a value binding expression + * or method binding expression that references a managed bean using + * this class.

+ */ +public class RequestBean1 extends AbstractRequestBean +{ + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + //
+ + /** + *

Construct a new request data bean instance.

+ */ + public RequestBean1() + { + + } + + /** + *

This method is called when this bean is initially added to + * request scope. Typically, this occurs as a result of evaluating + * a value binding or method binding expression, which utilizes the + * managed bean facility to instantiate this bean and store it into + * request scope.

+ * + *

You may customize this method to allocate resources that are required + * for the lifetime of the current request.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("RequestBean1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + } + + /** + *

This method is called when this bean is removed from + * request scope. This occurs automatically when the corresponding + * HTTP response has been completed and sent to the client.

+ * + *

You may customize this method to clean up resources allocated + * during the execution of the init() method, or + * at any later time during the lifetime of the request.

+ */ + @Override + public void destroy() + { + + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return (ApplicationBean1)getBean("ApplicationBean1"); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/SessionBean1.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/SessionBean1.java new file mode 100644 index 00000000..eeee173f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/SessionBean1.java @@ -0,0 +1,917 @@ +/* + * SessionBean1.java + * + * Created on September 18, 2007, 3:14 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Medico; +import beans.Utilizador; +import beans.Acidentado; +import beans.AnaliseAcidente; +import com.sun.rave.web.ui.appbase.AbstractSessionBean; +import global.Global; +import javax.faces.FacesException; +import pagestate.AnaliseAcidenteTrabalhoState; + +/** + *

Session scope data bean for your application. Create properties + * here to represent cached data that should be made available across + * multiple HTTP requests for an individual user.

+ * + *

An instance of this class will be created for you automatically, + * the first time your application evaluates a value binding expression + * or method binding expression that references a managed bean using + * this class.

+ */ +public class SessionBean1 extends AbstractSessionBean +{ + // + private int __placeholder; + + private db.providers.AnalisesActualDataProvider analisesActualDataProvider; + private db.providers.AnalisesSeguimentoDataProvider analisesSeguimentoDataProvider; + private db.providers.AnalisesConcluidasDataProvider analisesConcluidasDataProvider; + private db.providers.TrabalhadoresListDataProvider trabalhadoresListDataProvider; + private db.providers.EstadosCorrecaoDataProvider estadosCorrecaoDataProvider; + private db.providers.UtilizadoresActivosListDataProvider utilizadoresActivosListDataProvider; + private db.providers.UtilizadoresInactivosListDataProvider utilizadoresInactivosListDataProvider; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception + { + + } + //
+ + private String logoEmpresaUrl = ""; + + private Boolean canAccessEstatisticas = false; + + public Boolean getCanAccessEstatisticas() + { + return Boolean.TRUE; +// if ( isLoggedIn() && getCurrentUser() != null && getCurrentUser().getTipo() != null ) +// { +// int tipo = getCurrentUser().getTipo().intValue(); +// +// canAccessEstatisticas = tipo == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP || tipo == Global.TIPO_UTILIZADOR_HS +// || tipo == Global.TIPO_UTILIZADOR_GESTOR || tipo == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH +// || tipo == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA; +// } +// return canAccessEstatisticas; + } + + public void setCanAccessEstatisticas( Boolean canAccessEstatisticas ) + { + this.canAccessEstatisticas = canAccessEstatisticas; + } + + private Boolean isSearchingUtilizadores = false; + + /** + *

Construct a new session data bean instance.

+ */ + public SessionBean1() + { + msg = new String( "" ); + currentUser = new Utilizador(); + analisesActualDataProvider = new db.providers.AnalisesActualDataProvider(); + analisesSeguimentoDataProvider = new db.providers.AnalisesSeguimentoDataProvider(); + analisesConcluidasDataProvider = new db.providers.AnalisesConcluidasDataProvider(); + trabalhadoresListDataProvider = new db.providers.TrabalhadoresListDataProvider(); + setEstadosCorrecaoDataProvider( new db.providers.EstadosCorrecaoDataProvider() ); + utilizadoresActivosListDataProvider = new db.providers.UtilizadoresActivosListDataProvider(); + utilizadoresInactivosListDataProvider = new db.providers.UtilizadoresInactivosListDataProvider(); + + setNavFrom( "" ); + setAcidentado( null ); + setCurrentAnalise( null ); + setLoggedIn( false ); + + modoEdicaoUtilizador = ""; + setIdSequence( 1 ); + setNewUser( null ); + setEditUser( null ); + setUserDeleted( false ); + setMudarPassword( false ); + setFromAjuda( false ); + setGravado( false ); + setSubmetido( false ); + setFromAnaliseDeletion( false ); + setIeBug( false ); + setCorrecao( null ); + setCanAccessEstatisticas( false ); + setIsSearchingUtilizadores( false ); + } + + /** + *

This method is called when this bean is initially added to + * session scope. Typically, this occurs as a result of evaluating + * a value binding or method binding expression, which utilizes the + * managed bean facility to instantiate this bean and store it into + * session scope.

+ * + *

You may customize this method to initialize and cache data values + * or resources that are required for the lifetime of a particular + * user session.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try + { + _init(); + } + catch ( Exception e ) + { + log( "SessionBean1 Initialization Failure", e ); + throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

This method is called when the session containing it is about to be + * passivated. Typically, this occurs in a distributed servlet container + * when the session is about to be transferred to a different + * container instance, after which the activate() method + * will be called to indicate that the transfer is complete.

+ * + *

You may customize this method to release references to session data + * or resources that can not be serialized with the session itself.

+ */ + @Override + public void passivate() + { + } + + /** + *

This method is called when the session containing it was + * reactivated.

+ * + *

You may customize this method to reacquire references to session + * data or resources that could not be serialized with the + * session itself.

+ */ + @Override + public void activate() + { + } + + /** + *

This method is called when this bean is removed from + * session scope. Typically, this occurs as a result of + * the session timing out or being terminated by the application.

+ * + *

You may customize this method to clean up resources allocated + * during the execution of the init() method, or + * at any later time during the lifetime of the application.

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } + + private String msg; + + public String getMsg() + { + return msg; + } + + public void setMsg( String msg ) + { + this.msg = msg; + } + + private Utilizador currentUser; + + public Utilizador getCurrentUser() + { + return currentUser; + } + + public void setCurrentUser(Utilizador currentUser) + { + this.currentUser = currentUser; + setCanAccessEstatisticas( getCanAccessEstatisticas() ); + } + + public db.providers.AnalisesActualDataProvider getAnalisesActualDataProvider() + { + return analisesActualDataProvider; + } + + public void setAnalisesActualDataProvider( db.providers.AnalisesActualDataProvider analisesActualDataProvider ) + { + this.analisesActualDataProvider = analisesActualDataProvider; + } + + public db.providers.AnalisesSeguimentoDataProvider getAnalisesSeguimentoDataProvider() + { + return analisesSeguimentoDataProvider; + } + + public void setAnalisesSeguimentoDataProvider( db.providers.AnalisesSeguimentoDataProvider analisesSeguimentoDataProvider ) + { + this.analisesSeguimentoDataProvider = analisesSeguimentoDataProvider; + } + + public db.providers.AnalisesConcluidasDataProvider getAnalisesConcluidasDataProvider() + { + return analisesConcluidasDataProvider; + } + + public void setAnalisesConcluidasDataProvider( db.providers.AnalisesConcluidasDataProvider analisesConcluidasDataProvider ) + { + this.analisesConcluidasDataProvider = analisesConcluidasDataProvider; + } + + public db.providers.TrabalhadoresListDataProvider getTrabalhadoresListDataProvider() + { + return trabalhadoresListDataProvider; + } + + public void setTrabalhadoresListDataProvider( db.providers.TrabalhadoresListDataProvider trabalhadoresListDataProvider ) + { + this.trabalhadoresListDataProvider = trabalhadoresListDataProvider; + } + + public db.providers.EstadosCorrecaoDataProvider getEstadosCorrecaoDataProvider() + { + return estadosCorrecaoDataProvider; + } + + public void setEstadosCorrecaoDataProvider( db.providers.EstadosCorrecaoDataProvider estadosCorrecaoDataProvider ) + { + this.estadosCorrecaoDataProvider = estadosCorrecaoDataProvider; + } + + public db.providers.UtilizadoresActivosListDataProvider getUtilizadoresActivosListDataProvider() + { + return utilizadoresActivosListDataProvider; + } + + public void setUtilizadoresActivosListDataProvider( db.providers.UtilizadoresActivosListDataProvider utilizadoresActivosListDataProvider ) + { + this.utilizadoresActivosListDataProvider = utilizadoresActivosListDataProvider; + } + + public db.providers.UtilizadoresInactivosListDataProvider getUtilizadoresInactivosListDataProvider() + { + return utilizadoresInactivosListDataProvider; + } + + public void setUtilizadoresInactivosListDataProvider( db.providers.UtilizadoresInactivosListDataProvider utilizadoresInactivosListDataProvider ) + { + this.utilizadoresInactivosListDataProvider = utilizadoresInactivosListDataProvider; + } + + private com.sun.rave.web.ui.model.Option[] anoOptions; + + private Integer anoChoice; + + public Integer getAnoChoice() + { + return anoChoice; + } + + public void setAnoChoice( Integer anoChoice ) + { + this.anoChoice = anoChoice; + } + + public com.sun.rave.web.ui.model.Option[] getAnoOptions() + { + return anoOptions; + } + + public void setAnoOptions( com.sun.rave.web.ui.model.Option[] anoOptions ) + { + this.anoOptions = anoOptions; + } + + private com.sun.rave.web.ui.model.Option[] mesOptions; + + private Integer mesChoice; + + public Integer getMesChoice() + { + return mesChoice; + } + + public void setMesChoice( Integer mesChoice ) + { + this.mesChoice = mesChoice; + } + + public com.sun.rave.web.ui.model.Option[] getMesOptions() + { + return mesOptions; + } + + public void setMesOptions( com.sun.rave.web.ui.model.Option[] mesOptions ) + { + this.mesOptions = mesOptions; + } + + private com.sun.rave.web.ui.model.Option[] diaOptions; + + private Integer diaChoice; + + public Integer getDiaChoice() + { + return diaChoice; + } + + public void setDiaChoice( Integer diaChoice ) + { + this.diaChoice = diaChoice; + } + + public com.sun.rave.web.ui.model.Option[] getDiaOptions() + { + return diaOptions; + } + + public void setDiaOptions( com.sun.rave.web.ui.model.Option[] diaOptions ) + { + this.diaOptions = diaOptions; + } + + private com.sun.rave.web.ui.model.Option[] departamentoOptions; + + private Integer departamentoChoice; + + public Integer getDepartamentoChoice() + { + return departamentoChoice; + } + + public void setDepartamentoChoice( Integer departamentoChoice ) + { + this.departamentoChoice = departamentoChoice; + } + + public com.sun.rave.web.ui.model.Option[] getDepartamentoOptions() + { + return departamentoOptions; + } + + public void setDepartamentoOptions( com.sun.rave.web.ui.model.Option[] departamentoOptions ) + { + this.departamentoOptions = departamentoOptions; + } + + private com.sun.rave.web.ui.model.Option[] seccaoOptions; + + private Integer seccaoChoice; + + public Integer getSeccaoChoice() + { + return seccaoChoice; + } + + public void setSeccaoChoice( Integer seccaoChoice ) + { + this.seccaoChoice = seccaoChoice; + } + + public com.sun.rave.web.ui.model.Option[] getSeccaoOptions() + { + return seccaoOptions; + } + + public void setSeccaoOptions( com.sun.rave.web.ui.model.Option[] seccaoOptions ) + { + this.seccaoOptions = seccaoOptions; + } + + private String imageName; + + public String getImageName() + { + return imageName; + } + + public void setImageName( String imageName ) + { + this.imageName = imageName; + } + + private String navFrom; + + public String getNavFrom() + { + return navFrom; + } + + public void setNavFrom( String navFrom ) + { + this.navFrom = navFrom; + } + + private Acidentado acidentado; + + public Acidentado getAcidentado() + { + return acidentado; + } + + public void setAcidentado( Acidentado acidentado ) + { + this.acidentado = acidentado; + } + + private AnaliseAcidenteTrabalhoState analise_acidente_trabalho_state; + + public AnaliseAcidenteTrabalhoState getAnalise_acidente_trabalho_state() + { + return analise_acidente_trabalho_state; + } + + public void setAnalise_acidente_trabalho_state( AnaliseAcidenteTrabalhoState analise_acidente_trabalho_state ) + { + this.analise_acidente_trabalho_state = analise_acidente_trabalho_state; + } + + private AnaliseAcidente currentAnalise; + + public AnaliseAcidente getCurrentAnalise() + { + return currentAnalise; + } + + public void setCurrentAnalise( AnaliseAcidente currentAnalise ) + { + this.currentAnalise = currentAnalise; + } + + private boolean loggedIn; + + public boolean isLoggedIn() + { + return loggedIn; + } + + public void setLoggedIn( boolean loggedIn ) + { + this.loggedIn = loggedIn; + } + + private String modoEdicaoUtilizador; + + public String getModoEdicaoUtilizador() + { + return modoEdicaoUtilizador; + } + + public void setModoEdicaoUtilizador( String modoEdicaoUtilizador ) + { + this.modoEdicaoUtilizador = modoEdicaoUtilizador; + } + + private Integer tipoChoice; + + public Integer getTipoChoice() + { + return tipoChoice; + } + + public void setTipoChoice( Integer tipoChoice ) + { + this.tipoChoice = tipoChoice; + } + + private com.sun.rave.web.ui.model.Option[] tiposOptions; + + public com.sun.rave.web.ui.model.Option[] getTiposOptions() + { + return tiposOptions; + } + + public void setTiposOptions( com.sun.rave.web.ui.model.Option[] tiposOptions ) + { + this.tiposOptions = tiposOptions; + } + + + private Integer estabelecimentoChoice; + + public Integer getEstabelecimentoChoice() + { + return estabelecimentoChoice; + } + + public void setEstabelecimentoChoice( Integer estabelecimentoChoice ) + { + this.estabelecimentoChoice = estabelecimentoChoice; + } + + private com.sun.rave.web.ui.model.Option[] estabelecimentosOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosOptions() + { + return estabelecimentosOptions; + } + + public void setEstabelecimentosOptions( com.sun.rave.web.ui.model.Option[] estabelecimentosOptions ) + { + this.estabelecimentosOptions = estabelecimentosOptions; + } + + private Integer estabelecimentoGestorChoice; + + public Integer getEstabelecimentoGestorChoice() + { + return estabelecimentoGestorChoice; + } + + public void setEstabelecimentoGestorChoice( Integer estabelecimentoGestorChoice ) + { + this.estabelecimentoGestorChoice = estabelecimentoGestorChoice; + } + + private com.sun.rave.web.ui.model.Option[] estabelecimentosGestorOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosGestorOptions() + { + return estabelecimentosGestorOptions; + } + + public void setEstabelecimentosGestorOptions( com.sun.rave.web.ui.model.Option[] estabelecimentosGestorOptions ) + { + this.estabelecimentosGestorOptions = estabelecimentosGestorOptions; + } + + + + // + private Integer estabelecimentoOutroChoice; + + public Integer getEstabelecimentoOutroChoice() + { + return estabelecimentoOutroChoice; + } + + public void setEstabelecimentoOutroChoice( Integer estabelecimentoOutroChoice ) + { + this.estabelecimentoOutroChoice = estabelecimentoOutroChoice; + } + + + + private com.sun.rave.web.ui.model.Option[] estabelecimentosOutroOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosOutroOptions() + { + return estabelecimentosOutroOptions; + } + + public void setEstabelecimentosOutroOptions( com.sun.rave.web.ui.model.Option[] estabelecimentosOutroOptions ) + { + this.estabelecimentosOutroOptions = estabelecimentosOutroOptions; + } + + + private Integer estabelecimentoMedChoice; + + public Integer getEstabelecimentoMedChoice() + { + return estabelecimentoMedChoice; + } + + public void setEstabelecimentoMedChoice( Integer estabelecimentoMedChoice ) + { + this.estabelecimentoMedChoice = estabelecimentoMedChoice; + } + + private com.sun.rave.web.ui.model.Option[] estabelecimentosMedOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosMedOptions() + { + return estabelecimentosMedOptions; + } + + public void setEstabelecimentosMedOptions( com.sun.rave.web.ui.model.Option[] estabelecimentosMedOptions ) + { + this.estabelecimentosMedOptions = estabelecimentosMedOptions; + } + + private Integer tecnicoChoice; + + public Integer getTecnicoChoice() + { + return tecnicoChoice; + } + + public void setTecnicoChoice( Integer tecnicoChoice ) + { + this.tecnicoChoice = tecnicoChoice; + } + + private com.sun.rave.web.ui.model.Option[] tecnicosOptions; + + public com.sun.rave.web.ui.model.Option[] getTecnicosOptions() + { + return tecnicosOptions; + } + + public void setTecnicosOptions( com.sun.rave.web.ui.model.Option[] tecnicosOptions ) + { + this.tecnicosOptions = tecnicosOptions; + } + + + private Integer medicoChoice; + + public Integer getMedicoChoice() + { + return medicoChoice; + } + + public void setMedicoChoice( Integer medicoChoice ) + { + this.medicoChoice = medicoChoice; + } + + private com.sun.rave.web.ui.model.Option[] medicosOptions; + + public com.sun.rave.web.ui.model.Option[] getMedicosOptions() + { + return medicosOptions; + } + + public void setMedicosOptions( com.sun.rave.web.ui.model.Option[] medicosOptions ) + { + this.medicosOptions = medicosOptions; + } + + + // Clock : + private Integer horaChoice; + + public Integer getHoraChoice() + { + return horaChoice; + } + + public void setHoraChoice( Integer horaChoice ) + { + this.horaChoice = horaChoice; + } + + private com.sun.rave.web.ui.model.Option[] horasOptions; + + public com.sun.rave.web.ui.model.Option[] getHorasOptions() + { + return horasOptions; + } + + public void setHorasOptions( com.sun.rave.web.ui.model.Option[] horasOptions ) + { + this.horasOptions = horasOptions; + } + + + private Integer minutoChoice; + + public Integer getMinutoChoice() + { + return minutoChoice; + } + + public void setMinutoChoice( Integer minutoChoice ) + { + this.minutoChoice = minutoChoice; + } + + private com.sun.rave.web.ui.model.Option[] minutosOptions; + + public com.sun.rave.web.ui.model.Option[] getMinutosOptions() + { + return minutosOptions; + } + + public void setMinutosOptions( com.sun.rave.web.ui.model.Option[] minutosOptions ) + { + this.minutosOptions = minutosOptions; + } + + + private Integer causaChoice; + + public Integer getCausaChoice() + { + return causaChoice; + } + + public void setCausaChoice( Integer causaChoice ) + { + this.causaChoice = causaChoice; + } + + private com.sun.rave.web.ui.model.Option[] causasOptions; + + public com.sun.rave.web.ui.model.Option[] getCausasOptions() + { + return causasOptions; + } + + public void setCausasOptions( com.sun.rave.web.ui.model.Option[] causasOptions ) + { + this.causasOptions = causasOptions; + } + + private int idSequence; + + public int getIdSequence() + { + return idSequence; + } + + public void setIdSequence( int idSequence ) + { + this.idSequence = idSequence; + } + + private NewUser newUser; + + public NewUser getNewUser() + { + return newUser; + } + + public void setNewUser( NewUser newUser ) + { + this.newUser = newUser; + } + + private Utilizador editUser; + + public Utilizador getEditUser() + { + return editUser; + } + + public void setEditUser( Utilizador editUser ) + { + this.editUser = editUser; + } + + private boolean userDeleted; + + public boolean isUserDeleted() + { + return userDeleted; + } + + public void setUserDeleted( boolean userDeleted ) + { + this.userDeleted = userDeleted; + } + + private boolean mudarPassword; + + public boolean isMudarPassword() + { + return mudarPassword; + } + + public void setMudarPassword( boolean mudarPassword ) + { + this.mudarPassword = mudarPassword; + } + + private Medico medico; + + public Medico getMedico() + { + return medico; + } + + public void setMedico( Medico medico ) + { + this.medico = medico; + } + + private boolean fromAjuda; + + public boolean isFromAjuda() + { + return fromAjuda; + } + + public void setFromAjuda( boolean fromAjuda ) + { + this.fromAjuda = fromAjuda; + } + + private boolean submetido; + + private boolean gravado; + + public boolean isSubmetido() + { + return submetido; + } + + public void setSubmetido( boolean submetido ) + { + this.submetido = submetido; + } + + public boolean isGravado() + { + return gravado; + } + + public void setGravado( boolean gravado ) + { + this.gravado = gravado; + } + + private boolean fromAnaliseDeletion; + + public boolean isFromAnaliseDeletion() + { + return fromAnaliseDeletion; + } + + public void setFromAnaliseDeletion( boolean fromAnaliseDeletion ) + { + this.fromAnaliseDeletion = fromAnaliseDeletion; + } + + private boolean ieBug; + + public boolean isIeBug() + { + return ieBug; + } + + public void setIeBug( boolean ieBug ) + { + this.ieBug = ieBug; + } + + private beans.Correcao correcao; + + public beans.Correcao getCorrecao() + { + return correcao; + } + + public void setCorrecao( beans.Correcao correcao ) + { + this.correcao = correcao; + } + + public String getLogoEmpresaUrl() + { + return logoEmpresaUrl; + } + + public void setLogoEmpresaUrl( String logoEmpresaUrl ) + { + this.logoEmpresaUrl = logoEmpresaUrl; + } + + public Boolean getIsSearchingUtilizadores() + { + return isSearchingUtilizadores; + } + + public void setIsSearchingUtilizadores( Boolean isSearchingUtilizadores ) + { + this.isSearchingUtilizadores = isSearchingUtilizadores; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Top.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Top.java new file mode 100644 index 00000000..d183ddf6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/Top.java @@ -0,0 +1,203 @@ +/* + * Top.java + * + * Created on September 20, 2007, 11:04 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractFragmentBean; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; + +/** + *

Fragment bean that corresponds to a similarly named JSP page + * fragment. This class contains component definitions (and initialization + * code) for all components that you have defined on this fragment, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class Top extends AbstractFragmentBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() { + return groupPanel2; + } + + public void setGroupPanel2(PanelGroup pg) { + this.groupPanel2 = pg; + } + + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + private StaticText staticText2 = new StaticText(); + + public StaticText getStaticText2() { + return staticText2; + } + + public void setStaticText2(StaticText st) { + this.staticText2 = st; + } + + private Hyperlink lnkChangePassword = new Hyperlink(); + + public Hyperlink getLnkChangePassword() { + return lnkChangePassword; + } + + public void setLnkChangePassword(Hyperlink h) { + this.lnkChangePassword = h; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private Hyperlink lnkLogout = new Hyperlink(); + + public Hyperlink getLnkLogout() { + return lnkLogout; + } + + public void setLnkLogout(Hyperlink h) { + this.lnkLogout = h; + } + //
+ + public Top() { + } + + /** + *

Callback method that is called whenever a page containing + * this page fragment is navigated to, either directly via a URL, + * or indirectly via page navigation. Override this method to acquire + * resources that will be needed for event handlers and lifecycle methods.

+ * + *

The default implementation does nothing.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called. Override this + * method to release resources acquired in the init() + * resources that will be needed for event handlers and lifecycle methods.

+ * + *

The default implementation does nothing.

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/UtilizadorFields.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/UtilizadorFields.java new file mode 100644 index 00000000..d1c29f59 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/UtilizadorFields.java @@ -0,0 +1,1649 @@ +/* + * UtilizadorFields.java + * + * Created on December 4, 2007, 3:27 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Permissao; +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Checkbox; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.Hyperlink; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.PasswordField; +import com.sun.rave.web.ui.component.StaticText; +import com.sun.rave.web.ui.component.TextField; +import db.providers.AnalisesDataProvider; +import db.providers.UtilizadoresDataProvider; +import global.Global; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.context.FacesContext; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletRequest; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class UtilizadorFields extends AbstractPageBean { + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + private ImageComponent image2 = new ImageComponent(); + + public ImageComponent getImage2() { + return image2; + } + + public void setImage2(ImageComponent ic) { + this.image2 = ic; + } + + private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg1() { + return gridMsg1; + } + + public void setGridMsg1(HtmlPanelGrid hpg) { + this.gridMsg1 = hpg; + } + + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText stCriarEditar = new StaticText(); + + public StaticText getStCriarEditar() { + return stCriarEditar; + } + + public void setStCriarEditar(StaticText st) { + this.stCriarEditar = st; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private Button butGravar = new Button(); + + public Button getButGravar() { + return butGravar; + } + + public void setButGravar(Button b) { + this.butGravar = b; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() { + return staticText4; + } + + public void setStaticText4(StaticText st) { + this.staticText4 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private DropDown drpEstabelecimentos = new DropDown(); + + public DropDown getDrpEstabelecimentos() { + return drpEstabelecimentos; + } + + public void setDrpEstabelecimentos(DropDown dd) { + this.drpEstabelecimentos = dd; + } + + private StaticText stEstabelecimento = new StaticText(); + + public StaticText getStEstabelecimento() { + return stEstabelecimento; + } + + public void setStEstabelecimento(StaticText st) { + this.stEstabelecimento = st; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private DropDown drpNome = new DropDown(); + + public DropDown getDrpNome() { + return drpNome; + } + + public void setDrpNome(DropDown dd) { + this.drpNome = dd; + } + + private TextField txtNome = new TextField(); + + public TextField getTxtNome() { + return txtNome; + } + + public void setTxtNome(TextField tf) { + this.txtNome = tf; + } + + private StaticText stNome = new StaticText(); + + public StaticText getStNome() { + return stNome; + } + + public void setStNome(StaticText st) { + this.stNome = st; + } + + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() { + return staticText13; + } + + public void setStaticText13(StaticText st) { + this.staticText13 = st; + } + + private TextField txtLogin = new TextField(); + + public TextField getTxtLogin() { + return txtLogin; + } + + public void setTxtLogin(TextField tf) { + this.txtLogin = tf; + } + + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() { + return staticText14; + } + + public void setStaticText14(StaticText st) { + this.staticText14 = st; + } + + private PasswordField txtPassword = new PasswordField(); + + public PasswordField getTxtPassword() { + return txtPassword; + } + + public void setTxtPassword(PasswordField pf) { + this.txtPassword = pf; + } + + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() { + return staticText15; + } + + public void setStaticText15(StaticText st) { + this.staticText15 = st; + } + + private TextField txtEmail = new TextField(); + + public TextField getTxtEmail() { + return txtEmail; + } + + public void setTxtEmail(TextField tf) { + this.txtEmail = tf; + } + + //
+ boolean isPostback = false; + + private HiddenField hidConfDelUser = new HiddenField(); + + public HiddenField getHidConfDelUser() { + return hidConfDelUser; + } + + public void setHidConfDelUser(HiddenField hf) { + this.hidConfDelUser = hf; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private PasswordField txtConfPassword = new PasswordField(); + + public PasswordField getTxtConfPassword() { + return txtConfPassword; + } + + public void setTxtConfPassword(PasswordField pf) { + this.txtConfPassword = pf; + } + + private StaticText stTipo = new StaticText(); + + public StaticText getStTipo() { + return stTipo; + } + + public void setStTipo(StaticText st) { + this.stTipo = st; + } + + private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel10() { + return gridPanel10; + } + + public void setGridPanel10(HtmlPanelGrid hpg) { + this.gridPanel10 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private Checkbox chkActivo = new Checkbox(); + + public Checkbox getChkActivo() { + return chkActivo; + } + + public void setChkActivo(Checkbox c) { + this.chkActivo = c; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private StaticText lblRespLoja = new StaticText(); + + public StaticText getLblRespLoja() { + return lblRespLoja; + } + + public void setLblRespLoja(StaticText st) { + this.lblRespLoja = st; + } + + private Checkbox chkRespLoja = new Checkbox(); + + public Checkbox getChkRespLoja() { + return chkRespLoja; + } + + public void setChkRespLoja(Checkbox c) { + this.chkRespLoja = c; + } + + private StaticText lblGeral = new StaticText(); + + public StaticText getLblGeral() { + return lblGeral; + } + + public void setLblGeral(StaticText st) { + this.lblGeral = st; + } + + private Checkbox chkGeral = new Checkbox(); + + public Checkbox getChkGeral() { + return chkGeral; + } + + public void setChkGeral(Checkbox c) { + this.chkGeral = c; + } + + private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel11() { + return gridPanel11; + } + + public void setGridPanel11(HtmlPanelGrid hpg) { + this.gridPanel11 = hpg; + } + + private PanelGroup groupPanel9 = new PanelGroup(); + + public PanelGroup getGroupPanel9() { + return groupPanel9; + } + + public void setGroupPanel9(PanelGroup pg) { + this.groupPanel9 = pg; + } + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText16 = new StaticText(); + + public StaticText getStaticText16() { + return staticText16; + } + + public void setStaticText16(StaticText st) { + this.staticText16 = st; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + private Hyperlink lnkPlanosActuacao = new Hyperlink(); + + public Hyperlink getLnkPlanosActuacao() { + return lnkPlanosActuacao; + } + + public void setLnkPlanosActuacao(Hyperlink h) { + this.lnkPlanosActuacao = h; + } + /** + *

Construct a new Page bean instance.

+ */ + public UtilizadorFields() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + public void init() { + // Perform initializations inherited from our superclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("UtilizadorFields Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + else + { + + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(!pageFrom.matches("UtilizadorFields.jsp")) + { + isPostback = false; + } + else + { + isPostback = true; + } + + } + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + public void prerender() { + if(!isPostback) + { + if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) + { + stCriarEditar.setText("CRIAR"); + initializeNew(); + } + else if( getSessionBean1().getModoEdicaoUtilizador().matches("edit")) + { + stCriarEditar.setText("EDITAR"); + fillPage(); + } + } + else //postback + { + String del_user = (String)getExternalContext().getRequestParameterMap().get("del_user"); + if(del_user != null) + { + if(del_user.matches("yes")) + { + hidConfDelUser.setValue(""); + try + { + deleteUser(); + getSessionBean1().setMsg("Utilizador eliminado!"); + //return "gestao_utilizadores"; + getSessionBean1().setUserDeleted(true); + try + { + getExternalContext().redirect("GestaoUtilizadores.jsp"); + } + catch(Exception e) + { + ErrorLogger.logException( e ); + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + getSessionBean1().setMsg("Erro na eliminação do utilizador!"); + } + } + else if(del_user.matches("no")) + { + hidConfDelUser.setValue(""); + fillPage(); + } + } + + } + + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + public void destroy() { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1)getBean("RequestBean1"); + } + + public String lnkEditUser_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + + return null; + + } + + public void drpTipo_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public void drpNome_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String butCancelar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + String nav_from = getSessionBean1().getNavFrom(); + if(nav_from.matches("GestaoUtilizadores")) + { + return "gestao_utilizadores"; + } + else if(nav_from.matches("NovoUtilizador")) + { + return "novo_utilizador"; + } + return null; + } + + public String butApagar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + hidConfDelUser.setValue("apagar"); + return null; + } + + public String butGravar_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + if(validationOk( getSessionBean1().getModoEdicaoUtilizador() )) + { + if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) + { + try + { + Utilizador u = addUser(); + addPermissao(u); + getSessionBean1().setMsg("Utilizador criado"); + getSessionBean1().setNewUser(null); + return "gestao_utilizadores"; + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na criação do utilizador!"); + ErrorLogger.logException( ex ); + } + } + else if( getSessionBean1().getModoEdicaoUtilizador().matches("edit") ) + { + try + { + updateUser(); + getSessionBean1().setMsg("Utilizador actualizado"); + return "gestao_utilizadores"; + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na actualização do utilizador"); + ErrorLogger.logException( ex ); + } + } + } + return null; + } + + private void initializeNew() + { + //drpTipo.setStyleClass("hidden"); + //drpEstabelecimentos.setStyleClass("hidden"); + NewUser u = getSessionBean1().getNewUser(); + getSessionBean1().setEstabelecimentosOptions(getSessionBean1().getEstabelecimentosOutroOptions()); + if(u.getEstabelecimento() == null) + { + drpEstabelecimentos.setDisabled(true); + } + else + { + drpEstabelecimentos.setSelected(u.getEstabelecimento()); + } + + drpNome.setStyleClass("hidden"); + txtNome.setStyleClass("hidden"); + + + stTipo.setText(u.getTipo_descricao()); + //stEstabelecimento.setText(u.getEstabelecimento_descricao()); + stEstabelecimento.setStyleClass("hidden"); + stNome.setText(Utils.unicodeToHTML(u.getNome())); + + txtLogin.setText(""); + txtPassword.setText(""); + txtConfPassword.setText(""); + txtEmail.setText(""); + + + chkActivo.setSelected(new Boolean(true)); + lblGeral.setRendered(false); + chkGeral.setRendered(false); + lblRespLoja.setRendered(false); + chkRespLoja.setRendered(false); + } + + private void fillPage() + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + //Integer permissao = udp.getPermissionCode( getSessionBean1().getCurrentUser().getId() ); + //getSessionBean1().setTiposOptions(adp.getTiposList(permissao)); + getSessionBean1().setTiposOptions(adp.getTiposList()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + Utilizador u = getSessionBean1().getEditUser(); + //stTipo.setStyleClass("hidden"); + stEstabelecimento.setStyleClass("hidden"); + stNome.setStyleClass("hidden"); + + System.out.println("ACTIVO = " + u.getActivo()); + if(u.getActivo().matches("y")) + { + chkActivo.setSelected(new Boolean(true)); + } + else + { + chkActivo.setSelected(new Boolean(false)); + } + //drpTipo.setSelected(u.getTipo()); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + stTipo.setText(adp.getTipoDescricao(u.getTipo())); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + drpEstabelecimentos.setSelected(u.getEstabelecimento_id()); + + if(u.getTipo().intValue() == 3) //hs + { + drpNome.setStyleClass("hidden"); + txtNome.setText(Utils.unicodeToHTML(u.getNome())); + } + else if(u.getTipo().intValue() == 5) //medico + { + drpNome.setStyleClass("hidden"); + System.out.println("MEDICA : " + Utils.unicodeToHTML(u.getNome())); + txtNome.setText(Utils.unicodeToHTML(u.getNome())); + } + else + { + drpNome.setStyleClass("hidden"); + txtNome.setText(Utils.unicodeToHTML(u.getNome())); + } + + if(u.getTipo().intValue() == 6) // gestor + { + chkGeral.setSelected(new Boolean(false)); + if(u.getGestor_geral().matches("y")) + { + chkGeral.setSelected(new Boolean(true)); + } + } + else + { + lblGeral.setRendered(false); + chkGeral.setRendered(false); + } + + + if(u.getTipo().intValue() == 1 || u.getTipo().intValue() == 2) + { + chkRespLoja.setSelected(new Boolean(false)); + if(u.getResponsavel_loja().matches("y")) + { + chkRespLoja.setSelected(new Boolean(true)); + } + } + else + { + lblRespLoja.setRendered(false); + chkRespLoja.setRendered(false); + } + + txtLogin.setText(u.getLogin()); + //txtPassword.setText(u.getPassword()); + txtEmail.setText(u.getEmail()); + + } + + private boolean validationOk(String modo) + { + if(modo.matches("new")) + { + if(txtLogin.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar o login!"); + return false; + } + else + { + String login = (String) txtLogin.getText(); + if(login.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar o login!"); + return false; + } + else + { + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Utilizador u = udp.getUtilizador( login ); + if ( u != null && login.equals( u.getLogin() ) ) + { + getSessionBean1().setMsg("O utilizador " + login + " já existe!"); + return false; + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + } + + if(txtPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar a password!"); + return false; + } + else + { + String password = (String) txtPassword.getText(); + if(password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar a password!"); + return false; + } + else + { + if(txtConfPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + String conf_password = (String) txtConfPassword.getText(); + if(conf_password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + if(!password.equals(conf_password)) + { + getSessionBean1().setMsg("A confirmação tem de ser igual à a password!"); + return false; + } + } + } + } // + } + + if(txtEmail.getText() != null) + { + String email = (String) txtEmail.getText(); + if(email.trim().length() > 0) + { + if(! Utils.isValidEmail(email)) + { + getSessionBean1().setMsg("Email inválido!"); + return false; + } + + } + else + { + getSessionBean1().setMsg("Tem de indicar o email!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Tem de indicar o email!"); + return false; + } + + } + else if(modo.matches("edit")) + { + Utilizador u = getSessionBean1().getEditUser(); + +// Integer iTipo = (Integer) drpTipo.getSelected(); +// if(iTipo.intValue() == 0) +// { +// getSessionBean1().setMsg("Falta tipo !"); +// return false; +// } + + int tipo = u.getTipo().intValue(); + + if(tipo != 3) + { + Integer estabelecimento = (Integer) drpEstabelecimentos.getSelected(); + if(estabelecimento.intValue() == -1) + { + getSessionBean1().setMsg("Falta estabelecimento!"); + return false; + } + } + +// if(tipo == 3 || tipo == 5) +// { +// Integer nome = (Integer) drpNome.getSelected(); +// if(nome.intValue() == 0) +// { +// getSessionBean1().setMsg("Falta nome !"); +// return false; +// } +// } +// else +// { + if(txtNome.getText() == null) + { + getSessionBean1().setMsg("Falta nome!"); + + return false; + } + else + { + String nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + getSessionBean1().setMsg("Falta nome!"); + return false; + } + } +// } + + + if(txtLogin.getText() == null) + { + getSessionBean1().setMsg("Tem de indicar o login!"); + return false; + } + else + { + String login = (String) txtLogin.getText(); + if(login.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de indicar o login!"); + return false; + } + else + { + if(!login.equals(u.getLogin())) + { + + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Utilizador ut = udp.getUtilizador(login); + if(ut.getLogin().equals(login)) + { + getSessionBean1().setMsg("O utilizador " + login + " já existe!"); + return false; + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + } + } +// if(txtPassword.getText() == null) +// { +// getSessionBean1().setMsg("Falta password!"); +// return false; +// } +// else + if(txtPassword.getText() != null) + { + String password = (String) txtPassword.getText(); + if(password.trim().length() > 0) + { + if(! password.equals(u.getPassword())) + { + if(txtConfPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + String conf_password = (String) txtConfPassword.getText(); + if(conf_password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + if(!password.equals(conf_password)) + { + getSessionBean1().setMsg("A confirmação tem de ser igual à password!"); + return false; + } + } + } + } + } + else + { + if(txtConfPassword.getText() != null) + { + String conf = (String) txtConfPassword.getText(); + if(conf.trim().length() > 0) + { + getSessionBean1().setMsg("Falta password!"); + return false; + } + } + } + } + else + { + if(txtConfPassword.getText() != null) + { + String conf = (String) txtConfPassword.getText(); + if(conf.trim().length() > 0) + { + getSessionBean1().setMsg("Falta password!"); + return false; + } + } + } + + if(txtEmail.getText() != null) + { + String email = (String) txtEmail.getText(); + if(email.trim().length() > 0) + { + if(! Utils.isValidEmail(email)) + { + getSessionBean1().setMsg("Email inválido!"); + return false; + } + + } + } + else + { + getSessionBean1().setMsg("Tem de indicar o email!"); + return false; + } + + } + return true; + } + + private Utilizador addUser() throws Exception + { + Utilizador u = fillUser(); + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Integer id = udp.createNewUtilizador(u); + u.setId(id); + return u; + } + + private void addPermissao(Utilizador u) throws Exception + { + Permissao p = new Permissao(); + p.setUser_id(u.getId()); + p.setCodigo_permissao(u.getTipo()); + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + udp.createPermissao(p); + } + + private void updateUser() throws Exception + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + //Utilizador u = fillUser(); + Utilizador u = getSessionBean1().getEditUser(); + + + //u.setTipo((Integer) drpTipo.getSelected()); + u.setEstabelecimento_id( (Integer) drpEstabelecimentos.getSelected() ); + + int tipo = u.getTipo().intValue(); +// if(tipo == 3) +// { +// u.setFuncionario_hst_id((Integer) drpNome.getSelected()); +// u.setNome( adp.getTecnicoSaudeNome( u.getFuncionario_hst_id() ) ); +// } +// else if(tipo == 5) +// { +// u.setMedico_id( (Integer) drpNome.getSelected() ); +// u.setNome( adp.getMedicoNome(u.getMedico_id()) ); +// } + u.setActivo("n"); + if(chkActivo.getSelected() != null) + { + if(chkActivo.getSelected().equals(new Boolean(true))) + { + u.setActivo("y"); + } + } + u.setNome((String) txtNome.getText()); + u.setLogin((String) txtLogin.getText()); + if(txtPassword.getText() != null) + { + String password = (String) txtPassword.getText(); + if(password.trim().length() > 0) + { + u.setPassword(password); + } + } + + u.setEmail((String) txtEmail.getText()); + + u.setGestor_geral("n"); + try + { + if(chkGeral.getSelected() != null) + { + if(chkGeral.getSelected().equals(new Boolean(true)) ) + { + u.setGestor_geral("y"); + } + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + u.setResponsavel_loja("n"); + try + { + if(chkRespLoja.getSelected() != null) + { + if(chkRespLoja.getSelected().equals(new Boolean(true)) ) + { + u.setResponsavel_loja("y"); + } + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + u.setPrimeiro_login("n"); +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + udp.updateUtilizador( u ); + } + + + private Utilizador fillUser() + { + NewUser nu = getSessionBean1().getNewUser(); + Utilizador u = new Utilizador(); + u.setActivo("n"); + if(chkActivo.getSelected() != null) + { + if(chkActivo.getSelected().equals(new Boolean(true))) + { + u.setActivo("y"); + } + } + u.setAdministrador("n"); + u.setTipo(nu.getTipo()); + u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + //u.setEstabelecimento_id( nu.getEstabelecimento() ); + if(nu.getEstabelecimento() != null) + { + u.setEstabelecimento_id((Integer) drpEstabelecimentos.getSelected()); + } + u.setNome(Utils.unicodeToHTML(nu.getNome())); + u.setLogin( (String) txtLogin.getText() ); + u.setPassword( (String) txtPassword.getText() ); + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + u.setData_password(sqlToday); + u.setEmail(""); + u.setNumero_mecanografico(nu.getNumero_mecanografico()); + if(txtEmail.getText() != null) + { + u.setEmail( (String) txtEmail.getText() ); + } + + Integer tipo = (Integer) nu.getTipo(); + + u.setNumero_cedula(""); + u.setCap(""); + if(tipo.intValue() == 3 || tipo.intValue() == 5) + { + if(tipo.intValue() == 3) + { + try + { + //Integer tecnico_id = (Integer) drpNome.getSelected(); + //u.setFuncionario_hst_id(tecnico_id); + //u.setNome( adp.getTecnicoSaudeNome(tecnico_id) ); + u.setFuncionario_hst_id(nu.getFuncionario_hst_id()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + u.setCap( nu.getCap()); + } + else // medico + { + try + { + //Integer medico_id = (Integer) drpNome.getSelected(); + //u.setMedico_id(medico_id); + //u.setNome( adp.getMedicoNome(medico_id) ); + u.setMedico_id(nu.getMedico_id()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + //u.setNumero_cedula( (String) stCedula.getText()); + u.setNumero_cedula(nu.getNumero_cedula()); + } + } +// else +// { +// u.setNome( (String) txtNome.getText() ); +// } + + u.setResponsavel_loja(nu.getResponsavel_loja()); + if(nu.getGestor_geral() == null) + { + u.setGestor_geral("n"); + } + else + { + u.setGestor_geral(nu.getGestor_geral()); + } + + +// u.setResponsavel_loja("n"); +// if(chkResponsavelLoja.getSelected() != null) +// { +// if(chkResponsavelLoja.getSelected().equals(new Boolean(true))) +// { +// u.setResponsavel_loja("y"); +// } +// } + return u; + } + + private void deleteUser() throws Exception + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + udp.deleteUser(getSessionBean1().getEditUser().getId()); + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkAnalisesAcidente_action() { + // TODO: Replace with your code + Integer tipo_utilizador = getSessionBean1().getCurrentUser().getTipo(); + if(tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + return "form_dir_siprp"; + } + else if(tipo_utilizador.intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + return "form_dir_ger_rh"; + } + + return null; + } + + public void drpEstabelecimentos_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String lnkAjuda_action() { + // TODO: Replace with your code +// ServletContext theApplicationsServletContext = +// (ServletContext) this.getExternalContext().getContext(); +// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); +// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf"; +// +// Global global = new Global(); +// try +// { +// global.showPdf(pdfFilePath); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + return null; + } + + public String lnkPlanosActuacao_action() { + // TODO: Replace with your code + Utilizador u = getSessionBean1().getCurrentUser(); +// String curUser = "?user=" + u.getId().toString(); + FacesContext fc = getFacesContext().getCurrentInstance(); + Global.redirectToPlanos(fc, u); + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java new file mode 100644 index 00000000..c3621814 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java @@ -0,0 +1,4688 @@ +/* + * ViewAnaliseAcidenteTrabalho.java + * + * Created on October 1, 2007, 10:48 AM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import beans.Recomendacao; +import beans.Seccao; +import beans.Causa; +import beans.Medida; +import beans.Utilizador; +import beans.Acidentado; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.appbase.AbstractPageBean; +import com.sun.rave.web.ui.component.Body; +import com.sun.rave.web.ui.component.Button; +import com.sun.rave.web.ui.component.Form; +import com.sun.rave.web.ui.component.Head; +import com.sun.rave.web.ui.component.HiddenField; +import com.sun.rave.web.ui.component.Html; +import com.sun.rave.web.ui.component.ImageComponent; +import com.sun.rave.web.ui.component.Link; +import com.sun.rave.web.ui.component.Page; +import com.sun.rave.web.ui.component.PanelGroup; +import com.sun.rave.web.ui.component.StaticText; +import db.providers.AnalisesDataProvider; +import db.providers.UtilizadoresDataProvider; +import global.Global; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.ListIterator; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.servlet.ServletContext; +import utils.Utils; + +/** + *

Page bean that corresponds to a similarly named JSP page. This + * class contains component definitions (and initialization code) for + * all components that you have defined on this page, as well as + * lifecycle methods and event handlers where you may add behavior + * to respond to incoming events.

+ */ +public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean +{ + // + private int __placeholder; + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + private Page page1 = new Page(); + + public Page getPage1() { + return page1; + } + + public void setPage1(Page p) { + this.page1 = p; + } + + private Html html1 = new Html(); + + public Html getHtml1() { + return html1; + } + + public void setHtml1(Html h) { + this.html1 = h; + } + + private Head head1 = new Head(); + + public Head getHead1() { + return head1; + } + + public void setHead1(Head h) { + this.head1 = h; + } + + private Link link1 = new Link(); + + public Link getLink1() { + return link1; + } + + public void setLink1(Link l) { + this.link1 = l; + } + + private Body body1 = new Body(); + + public Body getBody1() { + return body1; + } + + public void setBody1(Body b) { + this.body1 = b; + } + + private Form form1 = new Form(); + + public Form getForm1() { + return form1; + } + + public void setForm1(Form f) { + this.form1 = f; + } + + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridBase1() { + return gridBase1; + } + + public void setGridBase1(HtmlPanelGrid hpg) { + this.gridBase1 = hpg; + } + + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLayout1() { + return gridLayout1; + } + + public void setGridLayout1(HtmlPanelGrid hpg) { + this.gridLayout1 = hpg; + } + + private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMsg1() { + return gridMsg1; + } + + public void setGridMsg1(HtmlPanelGrid hpg) { + this.gridMsg1 = hpg; + } + + private StaticText txtMsg1 = new StaticText(); + + public StaticText getTxtMsg1() { + return txtMsg1; + } + + public void setTxtMsg1(StaticText st) { + this.txtMsg1 = st; + } + + private StaticText txtComentarioConclusaoTitle = new StaticText(); + + public StaticText getTxtComentarioConclusaoTitle() { + return txtComentarioConclusaoTitle; + } + + public void setTxtComentarioConclusaoTitle(StaticText txtComentarioConclusaoTitle) { + this.txtComentarioConclusaoTitle = txtComentarioConclusaoTitle; + } + + private StaticText txtComentarioConclusao = new StaticText(); + + public StaticText getTxtComentarioConclusao() { + return txtComentarioConclusao; + } + + public void setTxtComentarioConclusao(StaticText txtComentarioConclusao) { + this.txtComentarioConclusao = txtComentarioConclusao; + } + + + + private HtmlPanelGrid gridCabecalho1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCabecalho1() { + return gridCabecalho1; + } + + public void setGridCabecalho1(HtmlPanelGrid hpg) { + this.gridCabecalho1 = hpg; + } + + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel2() { + return gridPanel2; + } + + public void setGridPanel2(HtmlPanelGrid hpg) { + this.gridPanel2 = hpg; + } + + private StaticText lblEmpresa1 = new StaticText(); + + public StaticText getLblEmpresa1() { + return lblEmpresa1; + } + + public void setLblEmpresa1(StaticText st) { + this.lblEmpresa1 = st; + } + + private StaticText txtEmpresa = new StaticText(); + + public StaticText getTxtEmpresa() { + return txtEmpresa; + } + + public void setTxtEmpresa(StaticText st) { + this.txtEmpresa = st; + } + + private StaticText staticText4 = new StaticText(); + + public StaticText getStaticText4() { + return staticText4; + } + + public void setStaticText4(StaticText st) { + this.staticText4 = st; + } + + private StaticText txtEstabelecimento = new StaticText(); + + public StaticText getTxtEstabelecimento() { + return txtEstabelecimento; + } + + public void setTxtEstabelecimento(StaticText st) { + this.txtEstabelecimento = st; + } + + private StaticText lblTrabalhador1 = new StaticText(); + + public StaticText getLblTrabalhador1() { + return lblTrabalhador1; + } + + public void setLblTrabalhador1(StaticText st) { + this.lblTrabalhador1 = st; + } + + private StaticText txtTrabalhador = new StaticText(); + + public StaticText getTxtTrabalhador() { + return txtTrabalhador; + } + + public void setTxtTrabalhador(StaticText st) { + this.txtTrabalhador = st; + } + + private HtmlPanelGrid gridDadosAcidenteSegView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteSegView() { + return gridDadosAcidenteSegView; + } + + public void setGridDadosAcidenteSegView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteSegView = hpg; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() { + return staticText13; + } + + public void setStaticText13(StaticText st) { + this.staticText13 = st; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private HtmlPanelGrid gridTurnoSeccaoLocal = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTurnoSeccaoLocal() { + return gridTurnoSeccaoLocal; + } + + public void setGridTurnoSeccaoLocal(HtmlPanelGrid hpg) { + this.gridTurnoSeccaoLocal = hpg; + } + + private HtmlPanelGrid gridTarefa = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTarefa() { + return gridTarefa; + } + + public void setGridTarefa(HtmlPanelGrid hpg) { + this.gridTarefa = hpg; + } + + private StaticText lblTarefa = new StaticText(); + + public StaticText getLblTarefa() { + return lblTarefa; + } + + public void setLblTarefa(StaticText st) { + this.lblTarefa = st; + } + + private HtmlPanelGrid gridSubstancias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSubstancias() { + return gridSubstancias; + } + + public void setGridSubstancias(HtmlPanelGrid hpg) { + this.gridSubstancias = hpg; + } + + private StaticText lblSubstancias = new StaticText(); + + public StaticText getLblSubstancias() { + return lblSubstancias; + } + + public void setLblSubstancias(StaticText st) { + this.lblSubstancias = st; + } + + private HtmlPanelGrid gridCondicoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCondicoes() { + return gridCondicoes; + } + + public void setGridCondicoes(HtmlPanelGrid hpg) { + this.gridCondicoes = hpg; + } + + private StaticText lblCondicoes = new StaticText(); + + public StaticText getLblCondicoes() { + return lblCondicoes; + } + + public void setLblCondicoes(StaticText st) { + this.lblCondicoes = st; + } + + private HtmlPanelGrid gridTestemunhas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTestemunhas() { + return gridTestemunhas; + } + + public void setGridTestemunhas(HtmlPanelGrid hpg) { + this.gridTestemunhas = hpg; + } + + private StaticText lblTestemunhas = new StaticText(); + + public StaticText getLblTestemunhas() { + return lblTestemunhas; + } + + public void setLblTestemunhas(StaticText st) { + this.lblTestemunhas = st; + } + + private HtmlPanelGrid gridCausas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCausas() { + return gridCausas; + } + + public void setGridCausas(HtmlPanelGrid hpg) { + this.gridCausas = hpg; + } + + private StaticText lblCausas = new StaticText(); + + public StaticText getLblCausas() { + return lblCausas; + } + + public void setLblCausas(StaticText st) { + this.lblCausas = st; + } + + private HtmlPanelGrid gridDescricao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDescricao() { + return gridDescricao; + } + + public void setGridDescricao(HtmlPanelGrid hpg) { + this.gridDescricao = hpg; + } + + private StaticText lblDescricao = new StaticText(); + + public StaticText getLblDescricao() { + return lblDescricao; + } + + public void setLblDescricao(StaticText st) { + this.lblDescricao = st; + } + + private HtmlPanelGrid gridFotografias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridFotografias() { + return gridFotografias; + } + + public void setGridFotografias(HtmlPanelGrid hpg) { + this.gridFotografias = hpg; + } + + private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel19() { + return gridPanel19; + } + + public void setGridPanel19(HtmlPanelGrid hpg) { + this.gridPanel19 = hpg; + } + + private StaticText lblFotografias = new StaticText(); + + public StaticText getLblFotografias() { + return lblFotografias; + } + + public void setLblFotografias(StaticText st) { + this.lblFotografias = st; + } + + private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages() { + return gridImages; + } + + public void setGridImages(HtmlPanelGrid hpg) { + this.gridImages = hpg; + } + + private HtmlPanelGrid gridConclusoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConclusoes() { + return gridConclusoes; + } + + public void setGridConclusoes(HtmlPanelGrid hpg) { + this.gridConclusoes = hpg; + } + + private StaticText lblConclusoes = new StaticText(); + + public StaticText getLblConclusoes() { + return lblConclusoes; + } + + public void setLblConclusoes(StaticText st) { + this.lblConclusoes = st; + } + + private HtmlPanelGrid gridAccoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAccoes() { + return gridAccoes; + } + + public void setGridAccoes(HtmlPanelGrid hpg) { + this.gridAccoes = hpg; + } + + private StaticText lblAccoes = new StaticText(); + + public StaticText getLblAccoes() { + return lblAccoes; + } + + public void setLblAccoes(StaticText st) { + this.lblAccoes = st; + } + + private StaticText txtAccoes = new StaticText(); + + public StaticText getTxtAccoes() { + return txtAccoes; + } + + public void setTxtAccoes(StaticText st) { + this.txtAccoes = st; + } + + private StaticText txtConclusoes = new StaticText(); + + public StaticText getTxtConclusoes() { + return txtConclusoes; + } + + public void setTxtConclusoes(StaticText st) { + this.txtConclusoes = st; + } + + private StaticText txtDescricao = new StaticText(); + + public StaticText getTxtDescricao() { + return txtDescricao; + } + + public void setTxtDescricao(StaticText st) { + this.txtDescricao = st; + } + + private StaticText txtCausas = new StaticText(); + + public StaticText getTxtCausas() { + return txtCausas; + } + + public void setTxtCausas(StaticText st) { + this.txtCausas = st; + } + + private StaticText txtTestemunhas = new StaticText(); + + public StaticText getTxtTestemunhas() { + return txtTestemunhas; + } + + public void setTxtTestemunhas(StaticText st) { + this.txtTestemunhas = st; + } + + private StaticText txtCondicoes = new StaticText(); + + public StaticText getTxtCondicoes() { + return txtCondicoes; + } + + public void setTxtCondicoes(StaticText st) { + this.txtCondicoes = st; + } + + private StaticText txtSubstancias = new StaticText(); + + public StaticText getTxtSubstancias() { + return txtSubstancias; + } + + public void setTxtSubstancias(StaticText st) { + this.txtSubstancias = st; + } + + private StaticText txtTarefa = new StaticText(); + + public StaticText getTxtTarefa() { + return txtTarefa; + } + + public void setTxtTarefa(StaticText st) { + this.txtTarefa = st; + } + + //
+ //private String IMAGE_URL = "/resources/images"; + + private final static int IMAGE_WIDTH = 48; + private final static int IMAGE_HEIGHT = 48; + + + private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRhView() { + return gridDadosAcidenteRhView; + } + + public void setGridDadosAcidenteRhView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRhView = hpg; + } + + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel3() { + return gridPanel3; + } + + public void setGridPanel3(HtmlPanelGrid hpg) { + this.gridPanel3 = hpg; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel4() { + return gridPanel4; + } + + public void setGridPanel4(HtmlPanelGrid hpg) { + this.gridPanel4 = hpg; + } + + private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSHST() { + return gridSHST; + } + + public void setGridSHST(HtmlPanelGrid hpg) { + this.gridSHST = hpg; + } + + private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaborador() { + return gridColaborador; + } + + public void setGridColaborador(HtmlPanelGrid hpg) { + this.gridColaborador = hpg; + } + + private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaboradores() { + return gridColaboradores; + } + + public void setGridColaboradores(HtmlPanelGrid hpg) { + this.gridColaboradores = hpg; + } + + private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesViewHS() { + return gridRecomendacoesViewHS; + } + + public void setGridRecomendacoesViewHS(HtmlPanelGrid hpg) { + this.gridRecomendacoesViewHS = hpg; + } + + private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel23() { + return gridPanel23; + } + + public void setGridPanel23(HtmlPanelGrid hpg) { + this.gridPanel23 = hpg; + } + + private StaticText staticText29 = new StaticText(); + + public StaticText getStaticText29() { + return staticText29; + } + + public void setStaticText29(StaticText st) { + this.staticText29 = st; + } + + private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesView() { + return gridRecomendacoesView; + } + + public void setGridRecomendacoesView(HtmlPanelGrid hpg) { + this.gridRecomendacoesView = hpg; + } + + private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasViewRH() { + return gridMedidasViewRH; + } + + public void setGridMedidasViewRH(HtmlPanelGrid hpg) { + this.gridMedidasViewRH = hpg; + } + + private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel24() { + return gridPanel24; + } + + public void setGridPanel24(HtmlPanelGrid hpg) { + this.gridPanel24 = hpg; + } + + private StaticText staticText30 = new StaticText(); + + public StaticText getStaticText30() { + return staticText30; + } + + public void setStaticText30(StaticText st) { + this.staticText30 = st; + } + + private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasView() { + return gridMedidasView; + } + + public void setGridMedidasView(HtmlPanelGrid hpg) { + this.gridMedidasView = hpg; + } + + private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedicoView() { + return gridMedicoView; + } + + public void setGridMedicoView(HtmlPanelGrid hpg) { + this.gridMedicoView = hpg; + } + + private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel25() { + return gridPanel25; + } + + public void setGridPanel25(HtmlPanelGrid hpg) { + this.gridPanel25 = hpg; + } + + private StaticText staticText31 = new StaticText(); + + public StaticText getStaticText31() { + return staticText31; + } + + public void setStaticText31(StaticText st) { + this.staticText31 = st; + } + + private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao() { + return gridLesao; + } + + public void setGridLesao(HtmlPanelGrid hpg) { + this.gridLesao = hpg; + } + + private StaticText lblAreasCorporais = new StaticText(); + + public StaticText getLblAreasCorporais() { + return lblAreasCorporais; + } + + public void setLblAreasCorporais(StaticText st) { + this.lblAreasCorporais = st; + } + + private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel26() { + return gridPanel26; + } + + public void setGridPanel26(HtmlPanelGrid hpg) { + this.gridPanel26 = hpg; + } + + private StaticText staticText33 = new StaticText(); + + public StaticText getStaticText33() { + return staticText33; + } + + public void setStaticText33(StaticText st) { + this.staticText33 = st; + } + + private HtmlPanelGrid gridIncapacidade = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade() { + return gridIncapacidade; + } + + public void setGridIncapacidade(HtmlPanelGrid hpg) { + this.gridIncapacidade = hpg; + } + + private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel27() { + return gridPanel27; + } + + public void setGridPanel27(HtmlPanelGrid hpg) { + this.gridPanel27 = hpg; + } + + private StaticText staticText34 = new StaticText(); + + public StaticText getStaticText34() { + return staticText34; + } + + public void setStaticText34(StaticText st) { + this.staticText34 = st; + } + + private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes() { + return gridRestricoes; + } + + public void setGridRestricoes(HtmlPanelGrid hpg) { + this.gridRestricoes = hpg; + } + + private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel28() { + return gridPanel28; + } + + public void setGridPanel28(HtmlPanelGrid hpg) { + this.gridPanel28 = hpg; + } + + private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImagesRestricoes() { + return gridImagesRestricoes; + } + + public void setGridImagesRestricoes(HtmlPanelGrid hpg) { + this.gridImagesRestricoes = hpg; + } + + private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridOutrasRestricoes() { + return gridOutrasRestricoes; + } + + public void setGridOutrasRestricoes(HtmlPanelGrid hpg) { + this.gridOutrasRestricoes = hpg; + } + + private StaticText staticText35 = new StaticText(); + + public StaticText getStaticText35() { + return staticText35; + } + + public void setStaticText35(StaticText st) { + this.staticText35 = st; + } + + private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel29() { + return gridPanel29; + } + + public void setGridPanel29(HtmlPanelGrid hpg) { + this.gridPanel29 = hpg; + } + + private StaticText staticText36 = new StaticText(); + + public StaticText getStaticText36() { + return staticText36; + } + + public void setStaticText36(StaticText st) { + this.staticText36 = st; + } + + private StaticText stObservacoes = new StaticText(); + + public StaticText getStObservacoes() { + return stObservacoes; + } + + public void setStObservacoes(StaticText st) { + this.stObservacoes = st; + } + + private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentadoView() { + return gridAcidentadoView; + } + + public void setGridAcidentadoView(HtmlPanelGrid hpg) { + this.gridAcidentadoView = hpg; + } + + private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel30() { + return gridPanel30; + } + + public void setGridPanel30(HtmlPanelGrid hpg) { + this.gridPanel30 = hpg; + } + + private StaticText staticText37 = new StaticText(); + + public StaticText getStaticText37() { + return staticText37; + } + + public void setStaticText37(StaticText st) { + this.staticText37 = st; + } + + private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel31() { + return gridPanel31; + } + + public void setGridPanel31(HtmlPanelGrid hpg) { + this.gridPanel31 = hpg; + } + + private HtmlPanelGrid gridDataHora = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDataHora() { + return gridDataHora; + } + + public void setGridDataHora(HtmlPanelGrid hpg) { + this.gridDataHora = hpg; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText lblDataAcidente = new StaticText(); + + public StaticText getLblDataAcidente() { + return lblDataAcidente; + } + + public void setLblDataAcidente(StaticText st) { + this.lblDataAcidente = st; + } + + private StaticText stDataAcidente1 = new StaticText(); + + public StaticText getStDataAcidente1() { + return stDataAcidente1; + } + + public void setStDataAcidente1(StaticText st) { + this.stDataAcidente1 = st; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText lblHoraAcidente = new StaticText(); + + public StaticText getLblHoraAcidente() { + return lblHoraAcidente; + } + + public void setLblHoraAcidente(StaticText st) { + this.lblHoraAcidente = st; + } + + private StaticText stHoraAcidente1 = new StaticText(); + + public StaticText getStHoraAcidente1() { + return stHoraAcidente1; + } + + public void setStHoraAcidente1(StaticText st) { + this.stHoraAcidente1 = st; + } + + private HtmlPanelGrid gridVerificacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridVerificacaoView() { + return gridVerificacaoView; + } + + public void setGridVerificacaoView(HtmlPanelGrid hpg) { + this.gridVerificacaoView = hpg; + } + + private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel34() { + return gridPanel34; + } + + public void setGridPanel34(HtmlPanelGrid hpg) { + this.gridPanel34 = hpg; + } + + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() { + return staticText15; + } + + public void setStaticText15(StaticText st) { + this.staticText15 = st; + } + + private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel35() { + return gridPanel35; + } + + public void setGridPanel35(HtmlPanelGrid hpg) { + this.gridPanel35 = hpg; + } + + private HtmlPanelGrid gridAssinaturasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssinaturasView() { + return gridAssinaturasView; + } + + public void setGridAssinaturasView(HtmlPanelGrid hpg) { + this.gridAssinaturasView = hpg; + } + + private HtmlPanelGrid gridParticipacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridParticipacaoView() + { + return gridParticipacaoView; + } + + public void setGridParticipacaoView(HtmlPanelGrid hpg) + { + this.gridParticipacaoView = hpg; + } + + private HtmlPanelGrid gridEstadoParticipacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridEstadoParticipacaoView() + { + return gridEstadoParticipacaoView; + } + + public void setGridEstadoParticipacaoView(HtmlPanelGrid hpg) + { + this.gridEstadoParticipacaoView = hpg; + } + + private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImpressaoView() { + return gridImpressaoView; + } + + public void setGridImpressaoView(HtmlPanelGrid hpg) { + this.gridImpressaoView = hpg; + } + + private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel10() { + return gridPanel10; + } + + public void setGridPanel10(HtmlPanelGrid hpg) { + this.gridPanel10 = hpg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel11() { + return gridPanel11; + } + + public void setGridPanel11(HtmlPanelGrid hpg) { + this.gridPanel11 = hpg; + } + + private HtmlPanelGrid gridAssSupView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssSupView() { + return gridAssSupView; + } + + public void setGridAssSupView(HtmlPanelGrid hpg) { + this.gridAssSupView = hpg; + } + + private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel12() { + return gridPanel12; + } + + public void setGridPanel12(HtmlPanelGrid hpg) { + this.gridPanel12 = hpg; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel13() { + return gridPanel13; + } + + public void setGridPanel13(HtmlPanelGrid hpg) { + this.gridPanel13 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() { + return staticText14; + } + + public void setStaticText14(StaticText st) { + this.staticText14 = st; + } + + private StaticText stAveriguador = new StaticText(); + + public StaticText getStAveriguador() { + return stAveriguador; + } + + public void setStAveriguador(StaticText st) { + this.stAveriguador = st; + } + + private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel14() { + return gridPanel14; + } + + public void setGridPanel14(HtmlPanelGrid hpg) { + this.gridPanel14 = hpg; + } + + private PanelGroup groupPanel9 = new PanelGroup(); + + public PanelGroup getGroupPanel9() { + return groupPanel9; + } + + public void setGroupPanel9(PanelGroup pg) { + this.groupPanel9 = pg; + } + + private StaticText staticText16 = new StaticText(); + + public StaticText getStaticText16() { + return staticText16; + } + + public void setStaticText16(StaticText st) { + this.staticText16 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText17 = new StaticText(); + + public StaticText getStaticText17() { + return staticText17; + } + + public void setStaticText17(StaticText st) { + this.staticText17 = st; + } + + private HtmlPanelGrid gridAveriguacaoPosterior = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAveriguacaoPosterior() { + return gridAveriguacaoPosterior; + } + + public void setGridAveriguacaoPosterior(HtmlPanelGrid hpg) { + this.gridAveriguacaoPosterior = hpg; + } + + private StaticText lblAveriguacaoPosterior1 = new StaticText(); + + public StaticText getLblAveriguacaoPosterior1() { + return lblAveriguacaoPosterior1; + } + + public void setLblAveriguacaoPosterior1(StaticText st) { + this.lblAveriguacaoPosterior1 = st; + } + + private StaticText txtAveriguacaoPosterior = new StaticText(); + + public StaticText getTxtAveriguacaoPosterior() { + return txtAveriguacaoPosterior; + } + + public void setTxtAveriguacaoPosterior(StaticText st) { + this.txtAveriguacaoPosterior = st; + } + + private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel15() { + return gridPanel15; + } + + public void setGridPanel15(HtmlPanelGrid hpg) { + this.gridPanel15 = hpg; + } + + private StaticText staticText18 = new StaticText(); + + public StaticText getStaticText18() { + return staticText18; + } + + public void setStaticText18(StaticText st) { + this.staticText18 = st; + } + + private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel16() { + return gridPanel16; + } + + public void setGridPanel16(HtmlPanelGrid hpg) { + this.gridPanel16 = hpg; + } + + private PanelGroup groupPanel10 = new PanelGroup(); + + public PanelGroup getGroupPanel10() { + return groupPanel10; + } + + public void setGroupPanel10(PanelGroup pg) { + this.groupPanel10 = pg; + } + + private StaticText staticText19 = new StaticText(); + + public StaticText getStaticText19() { + return staticText19; + } + + public void setStaticText19(StaticText st) { + this.staticText19 = st; + } + + private StaticText stNomeSuperior = new StaticText(); + + public StaticText getStNomeSuperior() { + return stNomeSuperior; + } + + public void setStNomeSuperior(StaticText st) { + this.stNomeSuperior = st; + } + + private PanelGroup groupPanel11 = new PanelGroup(); + + public PanelGroup getGroupPanel11() { + return groupPanel11; + } + + public void setGroupPanel11(PanelGroup pg) { + this.groupPanel11 = pg; + } + + private StaticText staticText20 = new StaticText(); + + public StaticText getStaticText20() { + return staticText20; + } + + public void setStaticText20(StaticText st) { + this.staticText20 = st; + } + + private StaticText stEmailSuperior = new StaticText(); + + public StaticText getStEmailSuperior() { + return stEmailSuperior; + } + + public void setStEmailSuperior(StaticText st) { + this.stEmailSuperior = st; + } + + private HtmlPanelGrid gridSiprp = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSiprp() { + return gridSiprp; + } + + public void setGridSiprp(HtmlPanelGrid hpg) { + this.gridSiprp = hpg; + } + + private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel17() { + return gridPanel17; + } + + public void setGridPanel17(HtmlPanelGrid hpg) { + this.gridPanel17 = hpg; + } + + private StaticText staticText24 = new StaticText(); + + public StaticText getStaticText24() { + return staticText24; + } + + public void setStaticText24(StaticText st) { + this.staticText24 = st; + } + + private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel18() { + return gridPanel18; + } + + public void setGridPanel18(HtmlPanelGrid hpg) { + this.gridPanel18 = hpg; + } + + private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel20() { + return gridPanel20; + } + + public void setGridPanel20(HtmlPanelGrid hpg) { + this.gridPanel20 = hpg; + } + + private PanelGroup groupPanel12 = new PanelGroup(); + + public PanelGroup getGroupPanel12() { + return groupPanel12; + } + + public void setGroupPanel12(PanelGroup pg) { + this.groupPanel12 = pg; + } + + private StaticText staticText25 = new StaticText(); + + public StaticText getStaticText25() { + return staticText25; + } + + public void setStaticText25(StaticText st) { + this.staticText25 = st; + } + + private StaticText staticText26 = new StaticText(); + + public StaticText getStaticText26() { + return staticText26; + } + + public void setStaticText26(StaticText st) { + this.staticText26 = st; + } + + private PanelGroup groupPanel13 = new PanelGroup(); + + public PanelGroup getGroupPanel13() { + return groupPanel13; + } + + public void setGroupPanel13(PanelGroup pg) { + this.groupPanel13 = pg; + } + + private StaticText staticText27 = new StaticText(); + + public StaticText getStaticText27() { + return staticText27; + } + + public void setStaticText27(StaticText st) { + this.staticText27 = st; + } + + private StaticText txtTecnicoSuperior = new StaticText(); + + public StaticText getTxtTecnicoSuperior() { + return txtTecnicoSuperior; + } + + public void setTxtTecnicoSuperior(StaticText st) { + this.txtTecnicoSuperior = st; + } + + private StaticText staticText28 = new StaticText(); + + public StaticText getStaticText28() { + return staticText28; + } + + public void setStaticText28(StaticText st) { + this.staticText28 = st; + } + + private StaticText staticText47 = new StaticText(); + + public StaticText getStaticText47() { + return staticText47; + } + + public void setStaticText47(StaticText st) { + this.staticText47 = st; + } + + private StaticText txtCap1 = new StaticText(); + + public StaticText getTxtCap1() { + return txtCap1; + } + + public void setTxtCap1(StaticText st) { + this.txtCap1 = st; + } + + private PanelGroup groupPanel14 = new PanelGroup(); + + public PanelGroup getGroupPanel14() { + return groupPanel14; + } + + public void setGroupPanel14(PanelGroup pg) { + this.groupPanel14 = pg; + } + + private StaticText staticText48 = new StaticText(); + + public StaticText getStaticText48() { + return staticText48; + } + + public void setStaticText48(StaticText st) { + this.staticText48 = st; + } + + private StaticText txtMedicoTrabalho = new StaticText(); + + public StaticText getTxtMedicoTrabalho() { + return txtMedicoTrabalho; + } + + public void setTxtMedicoTrabalho(StaticText st) { + this.txtMedicoTrabalho = st; + } + + private StaticText staticText49 = new StaticText(); + + public StaticText getStaticText49() { + return staticText49; + } + + public void setStaticText49(StaticText st) { + this.staticText49 = st; + } + + private StaticText staticText50 = new StaticText(); + + public StaticText getStaticText50() { + return staticText50; + } + + public void setStaticText50(StaticText st) { + this.staticText50 = st; + } + + private StaticText txtCedula1 = new StaticText(); + + public StaticText getTxtCedula1() { + return txtCedula1; + } + + public void setTxtCedula1(StaticText st) { + this.txtCedula1 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private StaticText stNomeAcidentado = new StaticText(); + + public StaticText getStNomeAcidentado() { + return stNomeAcidentado; + } + + public void setStNomeAcidentado(StaticText st) { + this.stNomeAcidentado = st; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private StaticText stEstabelecimentoOrigem = new StaticText(); + + public StaticText getStEstabelecimentoOrigem() { + return stEstabelecimentoOrigem; + } + + public void setStEstabelecimentoOrigem(StaticText st) { + this.stEstabelecimentoOrigem = st; + } + + private PanelGroup groupPanel15 = new PanelGroup(); + + public PanelGroup getGroupPanel15() { + return groupPanel15; + } + + public void setGroupPanel15(PanelGroup pg) { + this.groupPanel15 = pg; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private StaticText stDataNascimento = new StaticText(); + + public StaticText getStDataNascimento() { + return stDataNascimento; + } + + public void setStDataNascimento(StaticText st) { + this.stDataNascimento = st; + } + + private PanelGroup groupPanel16 = new PanelGroup(); + + public PanelGroup getGroupPanel16() { + return groupPanel16; + } + + public void setGroupPanel16(PanelGroup pg) { + this.groupPanel16 = pg; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private StaticText stBI = new StaticText(); + + public StaticText getStBI() { + return stBI; + } + + public void setStBI(StaticText st) { + this.stBI = st; + } + + private PanelGroup groupPanel17 = new PanelGroup(); + + public PanelGroup getGroupPanel17() { + return groupPanel17; + } + + public void setGroupPanel17(PanelGroup pg) { + this.groupPanel17 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private StaticText stMorada = new StaticText(); + + public StaticText getStMorada() { + return stMorada; + } + + public void setStMorada(StaticText st) { + this.stMorada = st; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private StaticText stCodPostal = new StaticText(); + + public StaticText getStCodPostal() { + return stCodPostal; + } + + public void setStCodPostal(StaticText st) { + this.stCodPostal = st; + } + + private PanelGroup groupPanel18 = new PanelGroup(); + + public PanelGroup getGroupPanel18() { + return groupPanel18; + } + + public void setGroupPanel18(PanelGroup pg) { + this.groupPanel18 = pg; + } + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private StaticText stContactoTelefonico = new StaticText(); + + public StaticText getStContactoTelefonico() { + return stContactoTelefonico; + } + + public void setStContactoTelefonico(StaticText st) { + this.stContactoTelefonico = st; + } + + private PanelGroup groupPanel19 = new PanelGroup(); + + public PanelGroup getGroupPanel19() { + return groupPanel19; + } + + public void setGroupPanel19(PanelGroup pg) { + this.groupPanel19 = pg; + } + + private StaticText staticText51 = new StaticText(); + + public StaticText getStaticText51() { + return staticText51; + } + + public void setStaticText51(StaticText st) { + this.staticText51 = st; + } + + private StaticText stDataAdmissao = new StaticText(); + + public StaticText getStDataAdmissao() { + return stDataAdmissao; + } + + public void setStDataAdmissao(StaticText st) { + this.stDataAdmissao = st; + } + + private PanelGroup groupPanel20 = new PanelGroup(); + + public PanelGroup getGroupPanel20() { + return groupPanel20; + } + + public void setGroupPanel20(PanelGroup pg) { + this.groupPanel20 = pg; + } + + private StaticText staticText52 = new StaticText(); + + public StaticText getStaticText52() { + return staticText52; + } + + public void setStaticText52(StaticText st) { + this.staticText52 = st; + } + + private StaticText stFuncao = new StaticText(); + + public StaticText getStFuncao() { + return stFuncao; + } + + public void setStFuncao(StaticText st) { + this.stFuncao = st; + } + + private PanelGroup groupPanel21 = new PanelGroup(); + + public PanelGroup getGroupPanel21() { + return groupPanel21; + } + + public void setGroupPanel21(PanelGroup pg) { + this.groupPanel21 = pg; + } + + private StaticText staticText53 = new StaticText(); + + public StaticText getStaticText53() { + return staticText53; + } + + public void setStaticText53(StaticText st) { + this.staticText53 = st; + } + + private StaticText stTurno = new StaticText(); + + public StaticText getStTurno() { + return stTurno; + } + + public void setStTurno(StaticText st) { + this.stTurno = st; + } + + private PanelGroup groupPanel22 = new PanelGroup(); + + public PanelGroup getGroupPanel22() { + return groupPanel22; + } + + public void setGroupPanel22(PanelGroup pg) { + this.groupPanel22 = pg; + } + + private StaticText lblHorasTurno = new StaticText(); + + public StaticText getLblHorasTurno() { + return lblHorasTurno; + } + + public void setLblHorasTurno(StaticText st) { + this.lblHorasTurno = st; + } + + private StaticText txtHorasTurno = new StaticText(); + + public StaticText getTxtHorasTurno() { + return txtHorasTurno; + } + + public void setTxtHorasTurno(StaticText st) { + this.txtHorasTurno = st; + } + + private PanelGroup groupPanel23 = new PanelGroup(); + + public PanelGroup getGroupPanel23() { + return groupPanel23; + } + + public void setGroupPanel23(PanelGroup pg) { + this.groupPanel23 = pg; + } + + private StaticText lblSeccao = new StaticText(); + + public StaticText getLblSeccao() { + return lblSeccao; + } + + public void setLblSeccao(StaticText st) { + this.lblSeccao = st; + } + + private StaticText txtSeccao = new StaticText(); + + public StaticText getTxtSeccao() { + return txtSeccao; + } + + public void setTxtSeccao(StaticText st) { + this.txtSeccao = st; + } + + private PanelGroup groupPanel24 = new PanelGroup(); + + public PanelGroup getGroupPanel24() { + return groupPanel24; + } + + public void setGroupPanel24(PanelGroup pg) { + this.groupPanel24 = pg; + } + + private StaticText lblLocal = new StaticText(); + + public StaticText getLblLocal() { + return lblLocal; + } + + public void setLblLocal(StaticText st) { + this.lblLocal = st; + } + + private StaticText txtLocal = new StaticText(); + + public StaticText getTxtLocal() { + return txtLocal; + } + + public void setTxtLocal(StaticText st) { + this.txtLocal = st; + } + + private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridHeader1() { + return gridHeader1; + } + + public void setGridHeader1(HtmlPanelGrid hpg) { + this.gridHeader1 = hpg; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private PanelGroup groupPanel26 = new PanelGroup(); + + public PanelGroup getGroupPanel26() { + return groupPanel26; + } + + public void setGroupPanel26(PanelGroup pg) { + this.groupPanel26 = pg; + } + + private ImageComponent image4 = new ImageComponent(); + + public ImageComponent getImage4() { + return image4; + } + + public void setImage4(ImageComponent ic) { + this.image4 = ic; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private StaticText staticText41 = new StaticText(); + + public StaticText getStaticText41() { + return staticText41; + } + + public void setStaticText41(StaticText st) { + this.staticText41 = st; + } + + private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel21() { + return gridPanel21; + } + + public void setGridPanel21(HtmlPanelGrid hpg) { + this.gridPanel21 = hpg; + } + + private PanelGroup groupPanel27 = new PanelGroup(); + + public PanelGroup getGroupPanel27() { + return groupPanel27; + } + + public void setGroupPanel27(PanelGroup pg) { + this.groupPanel27 = pg; + } + + private StaticText staticText42 = new StaticText(); + + public StaticText getStaticText42() { + return staticText42; + } + + public void setStaticText42(StaticText st) { + this.staticText42 = st; + } + + private StaticText stHeaderNr = new StaticText(); + + public StaticText getStHeaderNr() { + return stHeaderNr; + } + + public void setStHeaderNr(StaticText st) { + this.stHeaderNr = st; + } + + private PanelGroup groupPanel28 = new PanelGroup(); + + public PanelGroup getGroupPanel28() { + return groupPanel28; + } + + public void setGroupPanel28(PanelGroup pg) { + this.groupPanel28 = pg; + } + + private StaticText staticText43 = new StaticText(); + + public StaticText getStaticText43() { + return staticText43; + } + + public void setStaticText43(StaticText st) { + this.staticText43 = st; + } + + private StaticText stHeaderDate = new StaticText(); + + public StaticText getStHeaderDate() { + return stHeaderDate; + } + + public void setStHeaderDate(StaticText st) { + this.stHeaderDate = st; + } + + private ImageComponent image5 = new ImageComponent(); + + public ImageComponent getImage5() { + return image5; + } + + public void setImage5(ImageComponent ic) { + this.image5 = ic; + } + + private HiddenField hidConfDelete = new HiddenField(); + + public HiddenField getHidConfDelete() { + return hidConfDelete; + } + + public void setHidConfDelete(HiddenField hf) { + this.hidConfDelete = hf; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private Button butVoltar = new Button(); + + public Button getButVoltar() { + return butVoltar; + } + + public void setButVoltar(Button b) { + this.butVoltar = b; + } + + private Button butEliminar = new Button(); + + public Button getButEliminar() { + return butEliminar; + } + + public void setButEliminar(Button b) { + this.butEliminar = b; + } + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + /** + *

Construct a new Page bean instance.

+ */ + public ViewAnaliseAcidenteTrabalho() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @Override + public void init() + { + // Perform initializations inherited from our superclasssuperclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("ViewAnaliseAcidenteTrabalho Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + + if (!getSessionBean1().isLoggedIn()) + { + try + { + getExternalContext().redirect("Login.jsp"); + } + catch(Exception e) + { + // . . . handle exception . . . + System.out.println("LOGGED IN = " + e.getMessage()); + } + } + else + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + initializePage(); + } + + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() + { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() + { + getSessionBean1().setFromAnaliseDeletion(false); + String confirmacao_analise = (String)getExternalContext().getRequestParameterMap().get("confirmacao_analise"); + if(confirmacao_analise != null) + { + if(confirmacao_analise.matches("yes")) + { + hidConfDelete.setValue(""); + try + { + deleteAnalise(); + //booMsgQuizDeleted = true; + getSessionBean1().setFromAnaliseDeletion(true); + getSessionBean1().setMsg("Análise eliminada !"); + Utilizador u = getSessionBean1().getCurrentUser(); + if(u.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + + try + { + getExternalContext().redirect("FormDirSiprp.jsp"); + } + catch(Exception ex1) + { + ErrorLogger.logException( ex1 ); + } + } + else if(u.getTipo().intValue() == Global.TIPO_UTILIZADOR_HS) + { + + try + { + getExternalContext().redirect("FormHS.jsp"); + } + catch(Exception ex1) + { + ErrorLogger.logException( ex1 ); + } + } + + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na eliminação da análise"); + ErrorLogger.logException( ex ); +// try +// { +// getExternalContext().redirect("EditarQuestionario.jsp"); +// } +// catch(Exception ex1) +// { +// ErrorLogger.logException( ex1 ); +// } + } + } + else if(confirmacao_analise.matches("no")) + { + hidConfDelete.setValue(""); + } + } + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

+ */ + @Override + public void destroy() + { + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return (SessionBean1)getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected RequestBean1 getRequestBean1() + { + return (RequestBean1)getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return (ApplicationBean1)getBean("ApplicationBean1"); + } + + public String lnkLogout_action() + { + Utils.doLogout( getExternalContext(), true ); + return null; + } + + public String lnkNome_action() + { + return null; + } + + public String lnkDataNascimento_action() + { + return null; + } + + private void initializePage() + { + Utilizador u = getSessionBean1().getCurrentUser(); + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + + if(! (u.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP || u.getTipo().intValue() == Global.TIPO_UTILIZADOR_HS)) + { + butEliminar.setRendered(false); + } + else + { + if(a.getEstado().intValue() == Global.ESTADO_CONCLUIDO) + { + butEliminar.setRendered(false); + } + } + + if ( a != null ) + { + if ( a.getConcluido_por_desactivacao() ) + { + txtComentarioConclusaoTitle.setRendered( true ); + txtComentarioConclusaoTitle.setText( "Processo desactivado." ); + + if ( a.getComentario_desactivacao() != null && ! "".equals( a.getComentario_desactivacao().trim() ) ) + { + txtComentarioConclusao.setRendered( true ); + txtComentarioConclusao.setText( "" + a.getComentario_desactivacao() ); + } + else + { + txtComentarioConclusao.setRendered( false ); + txtComentarioConclusao.setText( "" ); + } + } + else + { + txtComentarioConclusao.setRendered( false ); + txtComentarioConclusao.setText( "" ); + txtComentarioConclusao.setRendered( false ); + txtComentarioConclusao.setText( "" ); + } + } + + fillPage(); + //fillImages(); + } + + private void fillPage() + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + fillHeader(a); + fillSIPRP(a); + + Acidentado ac = null; + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + ac = adp.getAcidentado(a.getAcidentado_id()); + //txtTrabalhador.setText(ac.getNome()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + + int estado = a.getEstado().intValue(); + switch(estado) + { + case Global.ESTADO_SEG: + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + break; + case Global.ESTADO_RH1: + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + break; + case Global.ESTADO_HS: + gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + break; + case Global.ESTADO_RH2: //medidas + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + + break; +// case Global.ESTADO_MEDICINA: +// gridMedicoView.setRendered(false); +// gridVerificacaoView.setRendered(false); +// gridImpressaoView.setRendered(false); +// +// fillAcidentado(ac); +// fillDadosAcidenteSeg(a); +// fillDadosAcidenteRh(a); +// fillRecomendacoesHs(a); +// fillMedidasRh(a); +// break; + case Global.ESTADO_CONSOLIDACAO: + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + break; + case Global.ESTADO_ASSINATURA_SEG: + //gridMedidasViewRH.setRendered(false); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + break; + + case Global.ESTADO_ASSINATURA_RH: + //gridMedidasViewRH.setRendered(false); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + break; + + +// case Global.ESTADO_IMPRESSAO: +// gridImpressaoView.setRendered(false); +// +// fillAcidentado(ac); +// fillDadosAcidenteSeg(a); +// fillDadosAcidenteRh(a); +// fillRecomendacoesHs(a); +// fillMedidasRh(a); +// fillMedico(a); +// fillVerificacao(a); +// break; + + case Global.ESTADO_FECHAR: + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + //fillImpressao(a); + break; + case Global.ESTADO_CONCLUIDO: + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + + break; + } + + fillParticipacaoSeguro( a ); + } + + private void fillHeader(AnaliseAcidente a) + { + stHeaderNr.setText(a.getAnalise_nr()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); + stHeaderDate.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + } + + private void fillSIPRP(AnaliseAcidente a) + { + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); + txtTecnicoSuperior.setText(Utils.unicodeToHTML(u.getNome())); + txtCap1.setText(u.getCap()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador u = udp.getUtilizador(a.getMedico_id()); + txtMedicoTrabalho.setText(Utils.unicodeToHTML(u.getNome())); + txtCedula1.setText(u.getNumero_cedula()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + private void fillAcidentado(Acidentado a) + { + stNomeAcidentado.setText(a.getNome()); + //stDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); + stDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + stBI.setText(a.getBilhete_identidade()); + stMorada.setText(a.getMorada()); + String cod_postal1 = ""; + String cod_postal2 = ""; + try + { + cod_postal1 = a.getCod_postal().substring(0, 4); + } + catch(Exception ex) + { + + } + try + { + cod_postal2 = a.getCod_postal().substring(5, 8); + } + catch(Exception ex) + { + + } + + //String cod_postal1 = a.getCod_postal().substring(0, 4); + //String cod_postal2 = a.getCod_postal().substring(5, 8); + String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); + stCodPostal.setText(cod_postal); + stContactoTelefonico.setText(a.getContacto_telefonico()); + //stDataAdmissao1.setText(a.getData_admissao()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_admissao().getTime()); + stDataAdmissao.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + stFuncao.setText(a.getFuncao()); + String turno_str = ""; + if(a.getTurno().matches("m")) + { + turno_str = "manhã"; + } + else if(a.getTurno().matches("t")) + { + turno_str += "tarde "; + } + if(a.getTurno().matches("n")) + { + turno_str += "noite"; + } + if(a.getTurno().matches("o")) + { + turno_str += "outro"; + } + stTurno.setText(turno_str); + stNomeSuperior.setText(a.getNome_superior_hierarquico()); + stEmailSuperior.setText(a.getEmail_superior_hierarquico()); + stEstabelecimentoOrigem.setText(a.getEstabelecimento_origem()); + } + + private void fillDadosAcidenteSeg(AnaliseAcidente a) + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); + txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + +// try +// { +// //Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); +// Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); +// //txtDataNascimento.setText(ac.getData_nascimento()); +// try +// { +// java.util.Date ddate = new java.util.Date(ac.getData_nascimento().getTime()); +// txtDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); +// } +// catch(Exception ex){}; +// getSessionBean1().setAcidentado(ac); +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + + txtTrabalhador.setText(a.getNome_acidentado()); +// txtNomeAcidentado.setText(a.getNome_acidentado()); + + stAveriguador.setText(a.getAveriguador()); + + if(a.getData_acidente() == null) + { + lblDataAcidente.setRendered(false); + stDataAcidente1.setRendered(false); + } + else + { + try + { + java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); + stDataAcidente1.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + if(a.getHora_acidente() == null) + { + lblHoraAcidente.setRendered(false); + stHoraAcidente1.setRendered(false); + } + else + { + Calendar cal = Calendar.getInstance(); + + // set the calendar to have your time + cal.setTimeInMillis(a.getHora_acidente().getTime()); + + int hour = cal.get(Calendar.HOUR_OF_DAY); + int minutes = cal.get(Calendar.MINUTE); + try + { + stHoraAcidente1.setText(utils.Utils.timeToHHMM(hour + ":" + minutes)); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + boolean booTurnoSeccaoLocal = false; + if(a.getHoras_turno() == null) + { + lblHorasTurno.setRendered(false); + txtHorasTurno.setRendered(false); + } + else if(a.getHoras_turno().intValue() == 0) + { + lblHorasTurno.setRendered(false); + txtHorasTurno.setRendered(false); + } + else + { + txtHorasTurno.setText(a.getHoras_turno().toString()); + booTurnoSeccaoLocal = true; + } + +// if(a.getSeccao() == null) +// { +// lblSeccao.setRendered(false); +// txtSeccao.setRendered(false); +// } +// else if(a.getSeccao().trim().length() == 0) +// { +// lblSeccao.setRendered(false); +// txtSeccao.setRendered(false); +// } +// else +// { +// txtSeccao.setText(a.getSeccao()); +// booTurnoSeccaoLocal = true; +// } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Seccao s = adp.getSeccao(a.getSeccao_id()); + txtSeccao.setText(s.getDescricao()); + booTurnoSeccaoLocal = true; + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + lblSeccao.setRendered(false); + txtSeccao.setRendered(false); + } + + + if(a.getLocal_trabalho() == null) + { + lblLocal.setRendered(false); + txtLocal.setRendered(false); + } + else if(a.getLocal_trabalho().trim().length() == 0) + { + lblLocal.setRendered(false); + txtLocal.setRendered(false); + } + else + { + txtLocal.setText(a.getLocal_trabalho()); + booTurnoSeccaoLocal = true; + } + + if(!booTurnoSeccaoLocal) + { + gridTurnoSeccaoLocal.setRendered(false); + } + + if(a.getTarefa() == null) + { + gridTarefa.setRendered(false); + lblTarefa.setRendered(false); + txtTarefa.setRendered(false); + } + else if(a.getTarefa().trim().length() == 0) + { + gridTarefa.setRendered(false); + lblTarefa.setRendered(false); + txtTarefa.setRendered(false); + } + else + { + txtTarefa.setText(a.getTarefa()); + } + + if(a.getSubstancias() == null) + { + gridSubstancias.setRendered(false); + lblSubstancias.setRendered(false); + txtSubstancias.setRendered(false); + } + else if(a.getSubstancias().trim().length() == 0) + { + gridSubstancias.setRendered(false); + lblSubstancias.setRendered(false); + txtSubstancias.setRendered(false); + } + else + { + txtSubstancias.setText(a.getSubstancias()); + } + +// if(a.getSuperior_hierarquico() == null) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior.setRendered(false); +// } +// else if(a.getSuperior_hierarquico().trim().length() == 0) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior.setRendered(false); +// } +// else +// { +// txtSuperior.setText(a.getSuperior_hierarquico()); +// } + + if(a.getCondicoes() == null) + { + gridCondicoes.setRendered(false); + lblCondicoes.setRendered(false); + txtCondicoes.setRendered(false); + } + else if(a.getCondicoes().trim().length() == 0) + { + gridCondicoes.setRendered(false); + lblCondicoes.setRendered(false); + txtCondicoes.setRendered(false); + } + else + { + txtCondicoes.setText(a.getCondicoes()); + } + + + if(a.getTestemunhas() == null) + { + gridTestemunhas.setRendered(false); + lblTestemunhas.setRendered(false); + txtTestemunhas.setRendered(false); + } + else if(a.getTestemunhas().trim().length() == 0) + { + gridTestemunhas.setRendered(false); + lblTestemunhas.setRendered(false); + txtTestemunhas.setRendered(false); + + } + else + { + txtTestemunhas.setText(a.getTestemunhas()); + } + +// txtCausas.setText(a.getCausas()); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Causa c = adp.getCausa(a.getCausas()); + txtCausas.setText(c.getCausa()); + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + gridCausas.setRendered(false); + } + + if(a.getDescricao() == null) + { + gridDescricao.setRendered(false); + lblDescricao.setRendered(false); + txtDescricao.setRendered(false); + } + else if(a.getTestemunhas().trim().length() == 0) + { + gridDescricao.setRendered(false); + lblDescricao.setRendered(false); + txtDescricao.setRendered(false); + } + else + { + txtDescricao.setText(a.getDescricao()); + } + + if(a.getConclusoes() == null) + { + gridConclusoes.setRendered(false); + lblConclusoes.setRendered(false); + txtConclusoes.setRendered(false); + } + else if(a.getConclusoes().trim().length() == 0) + { + gridConclusoes.setRendered(false); + lblConclusoes.setRendered(false); + txtConclusoes.setRendered(false); + } + else + { + txtConclusoes.setText(a.getConclusoes()); + } + + if(a.getAccoes() == null) + { + gridAccoes.setRendered(false); + lblAccoes.setRendered(false); + txtAccoes.setRendered(false); + } + else if(a.getAccoes().trim().length() == 0) + { + gridAccoes.setRendered(false); + lblAccoes.setRendered(false); + txtAccoes.setRendered(false); + } + else + { + txtAccoes.setText(a.getAccoes()); + } + + if(a.getAveriguacao_posterior().matches("n")) + { + gridAveriguacaoPosterior.setRendered(false); + } + else + { + if(a.getAveriguacao_obs().trim().length() > 0) + { + txtAveriguacaoPosterior.setText("Averiguação posterior: " + a.getAveriguacao_obs()); + } + } + + + + //fill images + String folderName = a.getAnalise_nr().substring(0,2) + a.getAnalise_nr().substring(3); + System.out.println("FOLDER NAME : " + folderName); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + + + File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); + if(apacheAnaliseFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(apacheAnaliseFolder); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File images[] = f.listFiles(); + Arrays.sort(images); + for(int i=0;i 0) + { + s = new StaticText(); + s.setId("s103"); + s.setEscape(false); + s.setText(a.getNr_relatorio_acidente_colaborador1()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_colaborador2() != null) + { + if(a.getNr_relatorio_acidente_colaborador2().intValue() > 0) + { + s = new StaticText(); + s.setId("s104"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador2()); + pg.getChildren().add(s); + } + + } + if(a.getNr_relatorio_acidente_colaborador3() != null) + { + if(a.getNr_relatorio_acidente_colaborador3().intValue() > 0) + { + s = new StaticText(); + s.setId("s105"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador3()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_colaborador4() != null) + { + if(a.getNr_relatorio_acidente_colaborador4().intValue() > 0) + { + s = new StaticText(); + s.setId("s106"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_colaborador4()); + pg.getChildren().add(s); + } + } + grd.getChildren().add(pg); + } + gridColaborador.getChildren().add(grd); + } + + } + else if( a.getOutros_acidentes_com_colaborador().matches("n") ) + { + st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); + gridColaborador.getChildren().add(st1); + } + else //t + { + gridColaborador.setRendered(false); + } + + if(a.getAcidentes_outros_colaboradores().matches("y")) + { + st2.setText("Verificaram-se ocorrências/incidentes semelhantes com outros colaboradores."); + gridColaboradores.getChildren().add(st2); + boolean booShow = false; + boolean booShow1 = false; + boolean booShow2 = false; + if(a.getNr_acidentes_outros_colaboradores() != null) + { + booShow = true; + booShow1 = true; + } + if(a.getNr_relatorio_acidente_outros_colaboradores1() != null || a.getNr_relatorio_acidente_outros_colaboradores2() != null || a.getNr_relatorio_acidente_outros_colaboradores3() != null || a.getNr_relatorio_acidente_outros_colaboradores4() != null) + { + booShow = true; + booShow2 = true; + } + + if(booShow) + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdColaboradoresS"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft15, gridColLeft85"); + if(booShow1) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s200"); + s.setEscape(false); + s.setText("Total:  "); + pg.getChildren().add(s); + s = new StaticText(); + s.setId("s201"); + s.setEscape(false); + s.setText(a.getNr_acidentes_outros_colaboradores()); + pg.getChildren().add(s); + grd.getChildren().add(pg); + } + if(booShow2) + { + PanelGroup pg = new PanelGroup(); + StaticText s = new StaticText(); + s.setId("s202"); + s.setEscape(false); + s.setText("   Relatórios de acidente nº:  "); + pg.getChildren().add(s); + if(a.getNr_relatorio_acidente_outros_colaboradores1() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores1().intValue() > 0) + { + s = new StaticText(); + s.setId("s203"); + s.setEscape(false); + s.setText(a.getNr_relatorio_acidente_outros_colaboradores1()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores2() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores2().intValue() > 0) + { + s = new StaticText(); + s.setId("s204"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores2()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores3() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores3().intValue() > 0) + { + s = new StaticText(); + s.setId("s205"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores3()); + pg.getChildren().add(s); + } + } + if(a.getNr_relatorio_acidente_outros_colaboradores4() != null) + { + if(a.getNr_relatorio_acidente_outros_colaboradores4().intValue() > 0) + { + s = new StaticText(); + s.setId("s206"); + s.setEscape(false); + s.setText("  " + a.getNr_relatorio_acidente_outros_colaboradores4()); + pg.getChildren().add(s); + } + } + grd.getChildren().add(pg); + } + gridColaboradores.getChildren().add(grd); + } + } + else if( a.getAcidentes_outros_colaboradores().matches("n") ) + { + st2.setText("Não se verificaram ocorrências/incidentes com outros colaboradores."); + gridColaboradores.getChildren().add(st2); + } + else //t + { + gridColaboradores.setRendered(false); + } + } + + private void fillRecomendacoesHs(AnaliseAcidente a) + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + ArrayList list = adp.getRecomendacoesByAnalise(a.getId()); + ListIterator iter = list.listIterator(); + int seq = 1; + while(iter.hasNext()) + { + Recomendacao r = (Recomendacao) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdRecomendacaoView" + seq); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft5, gridColLeft95"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrRecomendacaoView" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + st = new StaticText(); + st.setId("stRecomendacaoView" + seq); + st.setText(r.getRecomendacao()); + //st.setStyle("width: 24px"); + grd.getChildren().add(st); + + gridRecomendacoesView.getChildren().add(grd); + seq++; + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMedidasRh( AnaliseAcidente a ) + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.getMedidasByAnalise( a.getId() ); + ListIterator iter = list.listIterator(); + int seq = 1; + while ( iter.hasNext() ) + { + Medida m = ( Medida ) iter.next(); + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId( "grdMedidaView" + seq ); + grd.setColumns( 2 ); + grd.setColumnClasses( "gridColLeft5, gridColLeft95" ); + grd.setStyle( "width: 100%" ); + + StaticText st = new StaticText(); + st.setId( "stNrMedidaView" + seq ); + st.setText( seq + " ." ); + st.setStyle( "width: 24px" ); + grd.getChildren().add( st ); + + st = new StaticText(); + st.setId( "stMedidaView" + seq ); + st.setText( m.getMedida() ); + //st.setStyle("width: 24px"); + grd.getChildren().add( st ); + + gridMedidasView.getChildren().add( grd ); + seq++; + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + + private void fillMedico( AnaliseAcidente a ) + { + PanelGroup pg = null; + StaticText st = null; + HtmlPanelGrid grd = null; + ImageComponent img = null; + //LESAO : + +// if ( a.getLesao_cabeca().matches( "y" ) ) + if ( "y".equals( a.getLesao_cabeca() ) ) + { + st = new StaticText(); + st.setId( "stLesaoCabeca" ); + st.setEscape( false ); + st.setText( "Cabeça" ); + gridLesao.getChildren().add( st ); + } + +// if(a.getLesao_pescoco().matches("y")) + if ( "y".equals( a.getLesao_pescoco() ) ) + { + st = new StaticText(); + st.setId( "stLesaoPescoco" ); + st.setEscape( false ); + st.setText( "Pescoço" ); + gridLesao.getChildren().add( st ); + } + +// if ( a.getLesao_tronco().matches( "y" ) ) + if ( "y".equals( a.getLesao_tronco() ) ) + { + st = new StaticText(); + st.setId( "stLesaoTronco" ); + st.setEscape( false ); + st.setText( "Tronco" ); + gridLesao.getChildren().add( st ); + } + + grd = new HtmlPanelGrid(); + grd.setId("gridLesaoMembros"); + grd.setColumns(2); + grd.setColumnClasses("gridColLeft"); +// if(a.getLesao_membro_sup_dir().matches("y")) + if ( "y".equals( a.getLesao_membro_sup_dir() ) ) + { + st = new StaticText(); + st.setId("stLesaoMembroSupDir"); + st.setEscape(false); + st.setText("Membro Superior Direito"); + grd.getChildren().add(st); + if(a.getEspecif1() != null) + { + if(a.getEspecif1().trim().length() > 0) + { + st = new StaticText(); + st.setId("stEspecif1"); + st.setEscape(false); + st.setText(a.getEspecif1()); + grd.getChildren().add(st); + } + } + } + +// if(a.getLesao_membro_sup_esq().matches("y")) + if ( "y".equals( a.getLesao_membro_sup_esq() ) ) + { + st = new StaticText(); + st.setId("stLesaoMembroSupEsq"); + st.setEscape(false); + st.setText("Membro Superior Esquerdo"); + grd.getChildren().add(st); + if(a.getEspecif2() != null) + { + if(a.getEspecif2().trim().length() > 0) + { + st = new StaticText(); + st.setId("stEspecif2"); + st.setEscape(false); + st.setText(a.getEspecif2()); + grd.getChildren().add(st); + } + } + } + +// if ( a.getLesao_membro_inf_dir().matches( "y" ) ) + if ( "y".equals( a.getLesao_membro_inf_dir() ) ) + { + st = new StaticText(); + st.setId( "stLesaoMembroInfDir" ); + st.setEscape( false ); + st.setText( "Membro Inferior Direito" ); + grd.getChildren().add( st ); + if ( a.getEspecif3() != null && a.getEspecif3().trim().length() > 0 ) + { + st = new StaticText(); + st.setId("stEspecif3"); + st.setEscape(false); + st.setText(a.getEspecif3()); + grd.getChildren().add(st); + } + } + +// if ( a.getLesao_membro_inf_esq().matches( "y" ) ) + if ( "y".equals( a.getLesao_membro_inf_esq() ) ) + { + st = new StaticText(); + st.setId( "stLesaoMembroInfEsq" ); + st.setEscape( false ); + st.setText( "Membro Inferior Esquerdo" ); + grd.getChildren().add( st ); + if ( a.getEspecif4() != null ) + { + if ( a.getEspecif4().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif4" ); + st.setEscape( false ); + st.setText( a.getEspecif4() ); + grd.getChildren().add( st ); + } + } + } + if ( grd.getChildren().size() > 0 ) + { + gridLesao.getChildren().add( grd ); + } + + if ( a.getTipo_lesao() != null && a.getTipo_lesao().trim().length() > 0 ) + { + pg = new PanelGroup(); + pg.setId( "pgTipoLesao" ); + st = new StaticText(); + st.setId( "stTipoLesaoLbl" ); + st.setEscape( false ); + st.setText( "Tipo de lesão:   " ); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId( "stTipoLesao" ); + st.setEscape( false ); + st.setText( a.getTipo_lesao() ); + pg.getChildren().add( st ); + gridLesao.getChildren().add( pg ); + } + + System.out.println( "GRID LESAO : " + gridLesao.getChildren().size() ); + if ( gridLesao.getChildren().size() == 0 ) + { + lblAreasCorporais.setRendered( false ); + } + + //INCAPACIDADE : + pg = new PanelGroup(); + pg.setId("pgTipoIncapacidade"); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl1"); + st.setEscape(false); + st.setStyle("font-weight: bold"); + st.setText("Tipo de incapacidade:  "); + +// if ( a.getTipo_incapacidade().matches( "t" ) ) + if ( "t".equals( a.getTipo_incapacidade() ) ) + { + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidade"); + st.setEscape(false); + st.setText("Temporária  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl2"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("   Coeficiente de incapacidade:  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stCoefIncapacidade"); + st.setEscape(false); + st.setText( a.getCoef_incapacidade() == null ? "" : a.getCoef_incapacidade().toString() + "%" ); + pg.getChildren().add(st); + } +// else if(a.getTipo_incapacidade().matches("p")) + else if ( "p".equals( a.getTipo_incapacidade() ) ) + { + pg.getChildren().add( st ); + st = new StaticText(); + st.setId("stTipoIncapacidade"); + st.setEscape( false ); + st.setText("Permanente  "); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId("stTipoIncapacidadeLbl2"); + st.setStyle("font-weight: bold"); + st.setEscape( false ); + st.setText("   Coeficiente de incapacidade:  "); + pg.getChildren().add( st ); + st = new StaticText(); + st.setId("stCoefIncapacidade"); + st.setEscape( false ); + st.setText( a.getCoef_incapacidade() == null ? "" : a.getCoef_incapacidade().toString() + "%" ); + pg.getChildren().add( st ); + } + + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade.getChildren().add( pg ); + } + + pg = new PanelGroup(); + pg.setId("pgAvaliacaoIncapacidade"); + if ( a.getData_aval_incapacidade() != null ) + { + st = new StaticText(); + st.setId("stDataAvalIncapacidadeLbl1"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("Avaliação de incapacidade realizada em  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataAvalIncapacidade"); + st.setEscape(false); + try + { + java.util.Date ddate = new java.util.Date(a.getData_aval_incapacidade().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + } + + + if ( a.getData_rev_incapacidade() != null ) + { + st = new StaticText(); + st.setId("stDataRevIncapacidadeLbl1"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("Revisão de incapacidade em  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stDataRevIncapacidade"); + st.setEscape(false); + try + { + java.util.Date ddate = new java.util.Date(a.getData_rev_incapacidade().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + } + + if(pg.getChildren().size() > 0) + { + gridIncapacidade.getChildren().add(pg); + } + + if(a.getPeriodo_incapacidade_a() != null || a.getPeriodo_incapacidade_de() != null) + { + pg = new PanelGroup(); + pg.setId("pgPeriodoIncapacidade"); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl1"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("Período de incapacidade temporária de  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeDe"); + st.setEscape(false); + //st.setText(a.getPeriodo_incapacidade_de()); + try + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_de().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl2"); + st.setStyle("font-weight: bold"); + st.setEscape(false); + st.setText("  a  "); + pg.getChildren().add(st); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeA"); + st.setEscape(false); + //st.setText(a.getPeriodo_incapacidade_a()); + try + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_a().getTime()); + st.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add(st); + gridIncapacidade.getChildren().add(pg); + } + + + +// //RESTRICOES +// +// if(a.getImg_flexao().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgFlexao"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// pg = new PanelGroup(); +// pg.setId("pgImgFlexao"); +// img = new ImageComponent(); +// img.setId("imgRestricoes1000"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle1.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1001"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle2.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1002"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle3.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1003"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/fle4.gif"); +// pg.getChildren().add(img); +// grd.getChildren().add(pg); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl1"); +// st.setEscape(false); +// st.setText("Flexão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_rot1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgRot1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes1005"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/rot1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl2"); +// st.setEscape(false); +// st.setText("Flexão Lateral"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_rot2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgRot2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes1006"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/rot2.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl3"); +// st.setEscape(false); +// st.setText("Rotação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ext1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgExt1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes1007"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl4"); +// st.setEscape(false); +// st.setText("Extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ext2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgExt2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// pg = new PanelGroup(); +// pg.setId("pgImgExt2"); +// img = new ImageComponent(); +// img.setId("imgRestricoes1008"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext2.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1009"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext3.gif"); +// pg.getChildren().add(img); +// img = new ImageComponent(); +// img.setId("imgRestricoes1010"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ext4.gif"); +// pg.getChildren().add(img); +// grd.getChildren().add(pg); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl5"); +// st.setEscape(false); +// st.setText("Flexão/Extensão Lateral + Rotação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10011"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl6"); +// st.setEscape(false); +// st.setText("Flexão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10012"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca2.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl7"); +// st.setEscape(false); +// st.setText("Extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab3().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab3"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10013"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca3.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl8"); +// st.setEscape(false); +// st.setText("Flexão Lateral"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_cab4().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgCab4"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10014"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ca4.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl9"); +// st.setEscape(false); +// st.setText("Rotação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma1().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa1"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10015"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma1.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl10"); +// st.setEscape(false); +// st.setText("Poronação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma2().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa2"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10016"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma2.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl11"); +// st.setEscape(false); +// st.setText("Supinação"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma3().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa3"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10017"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma3.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl12"); +// st.setEscape(false); +// st.setText("Flexão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma4().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa4"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10018"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma4.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl13"); +// st.setEscape(false); +// st.setText("Extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma5().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa5"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10019"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma5.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl14"); +// st.setEscape(false); +// st.setText("Desvio Ulnar"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma6().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa6"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10020"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma6.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl15"); +// st.setEscape(false); +// st.setText("Desvio Radial"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma7().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa7"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10021"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma7.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl16"); +// st.setEscape(false); +// st.setText("Pinça Digital"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma8().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa8"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10022"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma8.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl17"); +// st.setEscape(false); +// st.setText("Segurar objectos entre os dedos"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma9().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa9"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10023"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma9.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl18"); +// st.setEscape(false); +// st.setText("Dedos em extensão"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getImg_ma10().matches("y")) +// { +// grd = new HtmlPanelGrid(); +// grd.setId("grdImgMa10"); +// grd.setColumns(1); +// grd.setColumnClasses("gridColCenter"); +// grd.setStyleClass("centerBlock"); +// +// img = new ImageComponent(); +// img.setId("imgRestricoes10024"); +// img.setWidth(IMAGE_WIDTH); +// img.setHeight(IMAGE_HEIGHT); +// img.setUrl("/resources/images/medico/ma10.gif"); +// grd.getChildren().add(img); +// st = new StaticText(); +// st.setId("stImgRestricaoLbl19"); +// st.setEscape(false); +// st.setText("Pega palmar"); +// grd.getChildren().add(st); +// gridImagesRestricoes.getChildren().add(grd); +// } +// +// if(a.getRestricao_carga() != null) +// { +// if(a.getRestricao_carga().intValue() > 0) +// { +// pg = new PanelGroup(); +// st = new StaticText(); +// st.setId("stRestricaoCargaLbl"); +// st.setEscape(false); +// st.setText("Movimentação e manipulação de cargas com mais de  "); +// pg.getChildren().add(st); +// st = new StaticText(); +// st.setId("stRestricaoCargaKgs"); +// st.setEscape(false); +// st.setText(a.getRestricao_carga().toString()); +// pg.getChildren().add(st); +// st = new StaticText(); +// st.setId("stRestricaoCargaLbl1"); +// st.setEscape(false); +// st.setText("Kg"); +// pg.getChildren().add(st); +// gridOutrasRestricoes.getChildren().add(pg); +// } +// +// if(a.getRestricao_motricidade().matches("y")) +// { +// st = new StaticText(); +// st.setId("stRestricaoMotricidadeLbl"); +// st.setEscape(false); +// st.setText("Operações que requeiram motricidade fina."); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getRestricao_conducao().matches("y")) +// { +// st = new StaticText(); +// st.setId("stRestricaoConducaoLbl"); +// st.setEscape(false); +// st.setText("Condução/interacção com veículos ou outros equipamentos."); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getRestricao_vibracoes().matches("y")) +// { +// st = new StaticText(); +// st.setId("stRestricaoVibracoesLbl"); +// st.setEscape(false); +// st.setText("Utilizaçõo de equipamentos/ferramentas que impliquem exposição a vibrações ou impactos."); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getRestricao_outras().trim().length() > 0) +// { +// st = new StaticText(); +// st.setId("stRestricaoOutras"); +// st.setEscape(false); +// st.setText(a.getRestricao_outras()); +// gridOutrasRestricoes.getChildren().add(st); +// } +// +// if(a.getMed_observ().trim().length() > 0) +// { +// stObservacoes.setText(a.getMed_observ()); +// } +// } + + } + + private void fillVerificacao(AnaliseAcidente a) + { + StaticText st = null; + String txtVer = null; + if(a.getAveriguador() != null) + { + if(a.getAveriguador().trim().length() > 0) + { + st = new StaticText(); + st.setId("stVerificacao1"); + st.setEscape(false); + txtVer = "Averiguado por " + a.getAveriguador() + " (Departamento de Segurança) a "; + //txtVer += a.getData_assinatura_seg(); + + try + { + java.util.Date ddate = new java.util.Date(a.getData_inicio_processo().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + } + + if(a.getAss_consolidacao().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao2"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_consolidacao() + " (Técnico de SHST) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_consolidacao().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + if(a.getAss_resp_seg().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao3"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_seg() + " (Responsável de Segurança) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + if(a.getAss_resp_rh().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao4"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_rh() + " (Responsável de RH) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); + if(ac.getNome_superior_hierarquico() != null) + { + if(ac.getNome_superior_hierarquico().trim().length() > 0) + { + st = new StaticText(); + st.setId("stVerificacao5"); + st.setEscape(false); + txtVer = "Com conhecimento de " + ac.getNome_superior_hierarquico() + " (Responsável hierárquico)"; + + if(ac.getEmail_superior_hierarquico() != null) + { + if(ac.getEmail_superior_hierarquico().trim().length() > 0) + { + try + { + java.util.Date ddate = new java.util.Date(ac.getData_email_superior_hierarquico().getTime()); + txtVer += " a " + utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + } + } + txtVer += "."; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + } + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + HtmlPanelGrid grid = new HtmlPanelGrid(); + grid.setId("rodape1"); + grid.setColumns(1); + grid.setStyle("width: 100%"); + grid.setColumnClasses("gridColCenter"); + st = new StaticText(); + st.setId("stRodape1"); + st.setEscape(false); + st.setText("- processamento informático - acesso autenticado -"); + grid.getChildren().add(st); + gridAssinaturasView.getChildren().add(grid); + } + + private void fillParticipacaoSeguro(AnaliseAcidente a) + { + if( a.getParticipado() != null && a.getParticipado() ) + { + StaticText st = new StaticText(); + st.setId("stParticipacao"); + st.setEscape(false); + st.setText( "Participado ao Seguro" ); + gridEstadoParticipacaoView.getChildren().add(st); + } + else + { + StaticText st = new StaticText(); + st.setId("stParticipacao"); + st.setEscape(false); + st.setText( "Não Participado ao Seguro" ); + gridEstadoParticipacaoView.getChildren().add(st); + } + + Integer tipo = getSessionBean1().getCurrentUser().getTipo(); + + switch(tipo.intValue()) + { + case Global.TIPO_UTILIZADOR_HS: + case Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP: + gridParticipacaoView.setRendered( true ); + break; + + default: + gridParticipacaoView.setRendered( false ); + break; + } + } + + private void fillImpressao(AnaliseAcidente a) + { + StaticText st = new StaticText(); + st.setId("stImpressaoView1"); + st.setEscape(false); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_superior().getTime()); + stData += utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex) + { +// ErrorLogger.logException( ex ); + } + + String txt = "Assinado na Ficha de Análise de Acidente em papel por " + a.getNome_superior() + ", superior hierárquico / superior de "; + txt += getSessionBean1().getAcidentado().getNome() + ", a " + stData; + gridAssSupView.getChildren().add(st); + } + + private void fillImages() + { + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + try + { +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + getSessionBean1().getCurrentAnalise().getId()); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + getSessionBean1().getCurrentAnalise().getId(); + File f = new File(imageFileFolder); + if( f.exists() ) + { + File files[] = f.listFiles(); + + for(int i=0;i (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Acidentados extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Acidentados.ID, Acidentados.ID_INDEX ); + FIELD_INDEXES.put( Acidentados.ID_FULL, Acidentados.ID_INDEX ); + FIELD_INDEXES.put( Acidentados.NOME, Acidentados.NOME_INDEX ); + FIELD_INDEXES.put( Acidentados.NOME_FULL, Acidentados.NOME_INDEX ); + FIELD_INDEXES.put( Acidentados.DATA_NASCIMENTO, Acidentados.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( Acidentados.DATA_NASCIMENTO_FULL, Acidentados.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( Acidentados.BILHETE_IDENTIDADE, Acidentados.BILHETE_IDENTIDADE_INDEX ); + FIELD_INDEXES.put( Acidentados.BILHETE_IDENTIDADE_FULL, Acidentados.BILHETE_IDENTIDADE_INDEX ); + FIELD_INDEXES.put( Acidentados.MORADA, Acidentados.MORADA_INDEX ); + FIELD_INDEXES.put( Acidentados.MORADA_FULL, Acidentados.MORADA_INDEX ); + FIELD_INDEXES.put( Acidentados.COD_POSTAL, Acidentados.COD_POSTAL_INDEX ); + FIELD_INDEXES.put( Acidentados.COD_POSTAL_FULL, Acidentados.COD_POSTAL_INDEX ); + FIELD_INDEXES.put( Acidentados.LOCALIDADE, Acidentados.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Acidentados.LOCALIDADE_FULL, Acidentados.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Acidentados.CONTACTO_TELEFONICO, Acidentados.CONTACTO_TELEFONICO_INDEX ); + FIELD_INDEXES.put( Acidentados.CONTACTO_TELEFONICO_FULL, Acidentados.CONTACTO_TELEFONICO_INDEX ); + FIELD_INDEXES.put( Acidentados.DATA_ADMISSAO, Acidentados.DATA_ADMISSAO_INDEX ); + FIELD_INDEXES.put( Acidentados.DATA_ADMISSAO_FULL, Acidentados.DATA_ADMISSAO_INDEX ); + FIELD_INDEXES.put( Acidentados.FUNCAO, Acidentados.FUNCAO_INDEX ); + FIELD_INDEXES.put( Acidentados.FUNCAO_FULL, Acidentados.FUNCAO_INDEX ); + FIELD_INDEXES.put( Acidentados.TRABALHADOR_ID, Acidentados.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Acidentados.TRABALHADOR_ID_FULL, Acidentados.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Acidentados.TURNO, Acidentados.TURNO_INDEX ); + FIELD_INDEXES.put( Acidentados.TURNO_FULL, Acidentados.TURNO_INDEX ); + FIELD_INDEXES.put( Acidentados.NUMERO_MECANOGRAFICO, Acidentados.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Acidentados.NUMERO_MECANOGRAFICO_FULL, Acidentados.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Acidentados.NOME_SUPERIOR_HIERARQUICO, Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( Acidentados.NOME_SUPERIOR_HIERARQUICO_FULL, Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( Acidentados.EMAIL_SUPERIOR_HIERARQUICO, Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( Acidentados.EMAIL_SUPERIOR_HIERARQUICO_FULL, Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( Acidentados.ESTABELECIMENTO_ORIGEM, Acidentados.ESTABELECIMENTO_ORIGEM_INDEX ); + FIELD_INDEXES.put( Acidentados.ESTABELECIMENTO_ORIGEM_FULL, Acidentados.ESTABELECIMENTO_ORIGEM_INDEX ); + FIELD_INDEXES.put( Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO, Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_FULL, Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "acidentados"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.acidentados"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "acidentados.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "acidentados.nome"; + public static final int NOME_INDEX = 1; + public static final String DATA_NASCIMENTO = "data_nascimento"; + public static final String DATA_NASCIMENTO_FULL = "acidentados.data_nascimento"; + public static final int DATA_NASCIMENTO_INDEX = 2; + public static final String BILHETE_IDENTIDADE = "bilhete_identidade"; + public static final String BILHETE_IDENTIDADE_FULL = "acidentados.bilhete_identidade"; + public static final int BILHETE_IDENTIDADE_INDEX = 3; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "acidentados.morada"; + public static final int MORADA_INDEX = 4; + public static final String COD_POSTAL = "cod_postal"; + public static final String COD_POSTAL_FULL = "acidentados.cod_postal"; + public static final int COD_POSTAL_INDEX = 5; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "acidentados.localidade"; + public static final int LOCALIDADE_INDEX = 6; + public static final String CONTACTO_TELEFONICO = "contacto_telefonico"; + public static final String CONTACTO_TELEFONICO_FULL = "acidentados.contacto_telefonico"; + public static final int CONTACTO_TELEFONICO_INDEX = 7; + public static final String DATA_ADMISSAO = "data_admissao"; + public static final String DATA_ADMISSAO_FULL = "acidentados.data_admissao"; + public static final int DATA_ADMISSAO_INDEX = 8; + public static final String FUNCAO = "funcao"; + public static final String FUNCAO_FULL = "acidentados.funcao"; + public static final int FUNCAO_INDEX = 9; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "acidentados.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 10; + public static final String TURNO = "turno"; + public static final String TURNO_FULL = "acidentados.turno"; + public static final int TURNO_INDEX = 11; + public static final String NUMERO_MECANOGRAFICO = "numero_mecanografico"; + public static final String NUMERO_MECANOGRAFICO_FULL = "acidentados.numero_mecanografico"; + public static final int NUMERO_MECANOGRAFICO_INDEX = 12; + public static final String NOME_SUPERIOR_HIERARQUICO = "nome_superior_hierarquico"; + public static final String NOME_SUPERIOR_HIERARQUICO_FULL = "acidentados.nome_superior_hierarquico"; + public static final int NOME_SUPERIOR_HIERARQUICO_INDEX = 13; + public static final String EMAIL_SUPERIOR_HIERARQUICO = "email_superior_hierarquico"; + public static final String EMAIL_SUPERIOR_HIERARQUICO_FULL = "acidentados.email_superior_hierarquico"; + public static final int EMAIL_SUPERIOR_HIERARQUICO_INDEX = 14; + public static final String ESTABELECIMENTO_ORIGEM = "estabelecimento_origem"; + public static final String ESTABELECIMENTO_ORIGEM_FULL = "acidentados.estabelecimento_origem"; + public static final int ESTABELECIMENTO_ORIGEM_INDEX = 15; + public static final String DATA_EMAIL_SUPERIOR_HIERARQUICO = "data_email_superior_hierarquico"; + public static final String DATA_EMAIL_SUPERIOR_HIERARQUICO_FULL = "acidentados.data_email_superior_hierarquico"; + public static final int DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX = 16; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, DATA_NASCIMENTO, BILHETE_IDENTIDADE, MORADA, COD_POSTAL, LOCALIDADE, + CONTACTO_TELEFONICO, DATA_ADMISSAO, FUNCAO, TRABALHADOR_ID, TURNO, + NUMERO_MECANOGRAFICO, NOME_SUPERIOR_HIERARQUICO, + EMAIL_SUPERIOR_HIERARQUICO, ESTABELECIMENTO_ORIGEM, + DATA_EMAIL_SUPERIOR_HIERARQUICO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + DATA_NASCIMENTO, TABLENAME + "." + BILHETE_IDENTIDADE, TABLENAME + "." + MORADA, TABLENAME + "." + COD_POSTAL, TABLENAME + "." + LOCALIDADE, + TABLENAME + "." + CONTACTO_TELEFONICO, TABLENAME + "." + DATA_ADMISSAO, TABLENAME + "." + FUNCAO, TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TURNO, + TABLENAME + "." + NUMERO_MECANOGRAFICO, TABLENAME + "." + NOME_SUPERIOR_HIERARQUICO, + TABLENAME + "." + EMAIL_SUPERIOR_HIERARQUICO, TABLENAME + "." + ESTABELECIMENTO_ORIGEM, + TABLENAME + "." + DATA_EMAIL_SUPERIOR_HIERARQUICO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, DATA_NASCIMENTO, BILHETE_IDENTIDADE, MORADA, COD_POSTAL, LOCALIDADE, + CONTACTO_TELEFONICO, DATA_ADMISSAO, FUNCAO, TRABALHADOR_ID, TURNO, + NUMERO_MECANOGRAFICO, NOME_SUPERIOR_HIERARQUICO, + EMAIL_SUPERIOR_HIERARQUICO, ESTABELECIMENTO_ORIGEM, + DATA_EMAIL_SUPERIOR_HIERARQUICO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, DATA_NASCIMENTO, BILHETE_IDENTIDADE, MORADA, COD_POSTAL, LOCALIDADE, + CONTACTO_TELEFONICO, DATA_ADMISSAO, FUNCAO, TRABALHADOR_ID, TURNO, + NUMERO_MECANOGRAFICO, NOME_SUPERIOR_HIERARQUICO, + EMAIL_SUPERIOR_HIERARQUICO, ESTABELECIMENTO_ORIGEM, + DATA_EMAIL_SUPERIOR_HIERARQUICO, }; + + private Integer id; + private String nome; + private java.util.Date data_nascimento; + private String bilhete_identidade; + private String morada; + private String cod_postal; + private String localidade; + private String contacto_telefonico; + private java.util.Date data_admissao; + private String funcao; + private Integer trabalhador_id; + private String turno; + private String numero_mecanografico; + private String nome_superior_hierarquico; + private String email_superior_hierarquico; + private String estabelecimento_origem; + private java.util.Date data_email_superior_hierarquico; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Acidentados() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAnalisesAcidentes_acidentado_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AnalisesAcidentesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "acidentado_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public java.util.Date getData_nascimento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_NASCIMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_nascimento; + } + + public void setData_nascimento( java.util.Date data_nascimento ) + { + try + { + preProcess( DATA_NASCIMENTO, data_nascimento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_nascimento = data_nascimento; + LAZY_LOADED_OBJECTS.put( DATA_NASCIMENTO, Boolean.TRUE ); + } + + public String getBilhete_identidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( BILHETE_IDENTIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.bilhete_identidade; + } + + public void setBilhete_identidade( String bilhete_identidade ) + { + try + { + preProcess( BILHETE_IDENTIDADE, bilhete_identidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.bilhete_identidade = bilhete_identidade; + LAZY_LOADED_OBJECTS.put( BILHETE_IDENTIDADE, Boolean.TRUE ); + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCod_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( COD_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cod_postal; + } + + public void setCod_postal( String cod_postal ) + { + try + { + preProcess( COD_POSTAL, cod_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cod_postal = cod_postal; + LAZY_LOADED_OBJECTS.put( COD_POSTAL, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public String getContacto_telefonico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTACTO_TELEFONICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contacto_telefonico; + } + + public void setContacto_telefonico( String contacto_telefonico ) + { + try + { + preProcess( CONTACTO_TELEFONICO, contacto_telefonico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contacto_telefonico = contacto_telefonico; + LAZY_LOADED_OBJECTS.put( CONTACTO_TELEFONICO, Boolean.TRUE ); + } + + public java.util.Date getData_admissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ADMISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_admissao; + } + + public void setData_admissao( java.util.Date data_admissao ) + { + try + { + preProcess( DATA_ADMISSAO, data_admissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_admissao = data_admissao; + LAZY_LOADED_OBJECTS.put( DATA_ADMISSAO, Boolean.TRUE ); + } + + public String getFuncao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcao; + } + + public void setFuncao( String funcao ) + { + try + { + preProcess( FUNCAO, funcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcao = funcao; + LAZY_LOADED_OBJECTS.put( FUNCAO, Boolean.TRUE ); + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public String getTurno() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TURNO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.turno; + } + + public void setTurno( String turno ) + { + try + { + preProcess( TURNO, turno ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.turno = turno; + LAZY_LOADED_OBJECTS.put( TURNO, Boolean.TRUE ); + } + + public String getNumero_mecanografico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_MECANOGRAFICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_mecanografico; + } + + public void setNumero_mecanografico( String numero_mecanografico ) + { + try + { + preProcess( NUMERO_MECANOGRAFICO, numero_mecanografico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_mecanografico = numero_mecanografico; + LAZY_LOADED_OBJECTS.put( NUMERO_MECANOGRAFICO, Boolean.TRUE ); + } + + public String getNome_superior_hierarquico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_SUPERIOR_HIERARQUICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_superior_hierarquico; + } + + public void setNome_superior_hierarquico( String nome_superior_hierarquico ) + { + try + { + preProcess( NOME_SUPERIOR_HIERARQUICO, nome_superior_hierarquico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_superior_hierarquico = nome_superior_hierarquico; + LAZY_LOADED_OBJECTS.put( NOME_SUPERIOR_HIERARQUICO, Boolean.TRUE ); + } + + public String getEmail_superior_hierarquico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL_SUPERIOR_HIERARQUICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email_superior_hierarquico; + } + + public void setEmail_superior_hierarquico( String email_superior_hierarquico ) + { + try + { + preProcess( EMAIL_SUPERIOR_HIERARQUICO, email_superior_hierarquico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email_superior_hierarquico = email_superior_hierarquico; + LAZY_LOADED_OBJECTS.put( EMAIL_SUPERIOR_HIERARQUICO, Boolean.TRUE ); + } + + public String getEstabelecimento_origem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ORIGEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_origem; + } + + public void setEstabelecimento_origem( String estabelecimento_origem ) + { + try + { + preProcess( ESTABELECIMENTO_ORIGEM, estabelecimento_origem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_origem = estabelecimento_origem; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ORIGEM, Boolean.TRUE ); + } + + public java.util.Date getData_email_superior_hierarquico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMAIL_SUPERIOR_HIERARQUICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_email_superior_hierarquico; + } + + public void setData_email_superior_hierarquico( java.util.Date data_email_superior_hierarquico ) + { + try + { + preProcess( DATA_EMAIL_SUPERIOR_HIERARQUICO, data_email_superior_hierarquico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_email_superior_hierarquico = data_email_superior_hierarquico; + LAZY_LOADED_OBJECTS.put( DATA_EMAIL_SUPERIOR_HIERARQUICO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Acidentados.ID_INDEX: + value = getId(); + break; + case Acidentados.NOME_INDEX: + value = getNome(); + break; + case Acidentados.DATA_NASCIMENTO_INDEX: + value = getData_nascimento(); + break; + case Acidentados.BILHETE_IDENTIDADE_INDEX: + value = getBilhete_identidade(); + break; + case Acidentados.MORADA_INDEX: + value = getMorada(); + break; + case Acidentados.COD_POSTAL_INDEX: + value = getCod_postal(); + break; + case Acidentados.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case Acidentados.CONTACTO_TELEFONICO_INDEX: + value = getContacto_telefonico(); + break; + case Acidentados.DATA_ADMISSAO_INDEX: + value = getData_admissao(); + break; + case Acidentados.FUNCAO_INDEX: + value = getFuncao(); + break; + case Acidentados.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case Acidentados.TURNO_INDEX: + value = getTurno(); + break; + case Acidentados.NUMERO_MECANOGRAFICO_INDEX: + value = getNumero_mecanografico(); + break; + case Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX: + value = getNome_superior_hierarquico(); + break; + case Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX: + value = getEmail_superior_hierarquico(); + break; + case Acidentados.ESTABELECIMENTO_ORIGEM_INDEX: + value = getEstabelecimento_origem(); + break; + case Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX: + value = getData_email_superior_hierarquico(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Acidentados.ID_INDEX: + value = this.id; + break; + case Acidentados.NOME_INDEX: + value = this.nome; + break; + case Acidentados.DATA_NASCIMENTO_INDEX: + value = this.data_nascimento; + break; + case Acidentados.BILHETE_IDENTIDADE_INDEX: + value = this.bilhete_identidade; + break; + case Acidentados.MORADA_INDEX: + value = this.morada; + break; + case Acidentados.COD_POSTAL_INDEX: + value = this.cod_postal; + break; + case Acidentados.LOCALIDADE_INDEX: + value = this.localidade; + break; + case Acidentados.CONTACTO_TELEFONICO_INDEX: + value = this.contacto_telefonico; + break; + case Acidentados.DATA_ADMISSAO_INDEX: + value = this.data_admissao; + break; + case Acidentados.FUNCAO_INDEX: + value = this.funcao; + break; + case Acidentados.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case Acidentados.TURNO_INDEX: + value = this.turno; + break; + case Acidentados.NUMERO_MECANOGRAFICO_INDEX: + value = this.numero_mecanografico; + break; + case Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX: + value = this.nome_superior_hierarquico; + break; + case Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX: + value = this.email_superior_hierarquico; + break; + case Acidentados.ESTABELECIMENTO_ORIGEM_INDEX: + value = this.estabelecimento_origem; + break; + case Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX: + value = this.data_email_superior_hierarquico; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Acidentados.ID_INDEX: + setId( ( Integer ) value ); + break; + case Acidentados.NOME_INDEX: + setNome( ( String ) value ); + break; + case Acidentados.DATA_NASCIMENTO_INDEX: + setData_nascimento( ( java.util.Date ) value ); + break; + case Acidentados.BILHETE_IDENTIDADE_INDEX: + setBilhete_identidade( ( String ) value ); + break; + case Acidentados.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case Acidentados.COD_POSTAL_INDEX: + setCod_postal( ( String ) value ); + break; + case Acidentados.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case Acidentados.CONTACTO_TELEFONICO_INDEX: + setContacto_telefonico( ( String ) value ); + break; + case Acidentados.DATA_ADMISSAO_INDEX: + setData_admissao( ( java.util.Date ) value ); + break; + case Acidentados.FUNCAO_INDEX: + setFuncao( ( String ) value ); + break; + case Acidentados.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case Acidentados.TURNO_INDEX: + setTurno( ( String ) value ); + break; + case Acidentados.NUMERO_MECANOGRAFICO_INDEX: + setNumero_mecanografico( ( String ) value ); + break; + case Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX: + setNome_superior_hierarquico( ( String ) value ); + break; + case Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX: + setEmail_superior_hierarquico( ( String ) value ); + break; + case Acidentados.ESTABELECIMENTO_ORIGEM_INDEX: + setEstabelecimento_origem( ( String ) value ); + break; + case Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX: + setData_email_superior_hierarquico( ( java.util.Date ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Acidentados.ID_INDEX: + this.id = ( Integer ) value; + break; + case Acidentados.NOME_INDEX: + this.nome = ( String ) value; + break; + case Acidentados.DATA_NASCIMENTO_INDEX: + this.data_nascimento = ( java.util.Date ) value; + break; + case Acidentados.BILHETE_IDENTIDADE_INDEX: + this.bilhete_identidade = ( String ) value; + break; + case Acidentados.MORADA_INDEX: + this.morada = ( String ) value; + break; + case Acidentados.COD_POSTAL_INDEX: + this.cod_postal = ( String ) value; + break; + case Acidentados.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case Acidentados.CONTACTO_TELEFONICO_INDEX: + this.contacto_telefonico = ( String ) value; + break; + case Acidentados.DATA_ADMISSAO_INDEX: + this.data_admissao = ( java.util.Date ) value; + break; + case Acidentados.FUNCAO_INDEX: + this.funcao = ( String ) value; + break; + case Acidentados.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case Acidentados.TURNO_INDEX: + this.turno = ( String ) value; + break; + case Acidentados.NUMERO_MECANOGRAFICO_INDEX: + this.numero_mecanografico = ( String ) value; + break; + case Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX: + this.nome_superior_hierarquico = ( String ) value; + break; + case Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX: + this.email_superior_hierarquico = ( String ) value; + break; + case Acidentados.ESTABELECIMENTO_ORIGEM_INDEX: + this.estabelecimento_origem = ( String ) value; + break; + case Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX: + this.data_email_superior_hierarquico = ( java.util.Date ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Acidentados.ID_INDEX: + theClass = Integer.class; + break; + case Acidentados.NOME_INDEX: + theClass = String.class; + break; + case Acidentados.DATA_NASCIMENTO_INDEX: + theClass = java.util.Date.class; + break; + case Acidentados.BILHETE_IDENTIDADE_INDEX: + theClass = String.class; + break; + case Acidentados.MORADA_INDEX: + theClass = String.class; + break; + case Acidentados.COD_POSTAL_INDEX: + theClass = String.class; + break; + case Acidentados.LOCALIDADE_INDEX: + theClass = String.class; + break; + case Acidentados.CONTACTO_TELEFONICO_INDEX: + theClass = String.class; + break; + case Acidentados.DATA_ADMISSAO_INDEX: + theClass = java.util.Date.class; + break; + case Acidentados.FUNCAO_INDEX: + theClass = String.class; + break; + case Acidentados.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Acidentados.TURNO_INDEX: + theClass = String.class; + break; + case Acidentados.NUMERO_MECANOGRAFICO_INDEX: + theClass = String.class; + break; + case Acidentados.NOME_SUPERIOR_HIERARQUICO_INDEX: + theClass = String.class; + break; + case Acidentados.EMAIL_SUPERIOR_HIERARQUICO_INDEX: + theClass = String.class; + break; + case Acidentados.ESTABELECIMENTO_ORIGEM_INDEX: + theClass = String.class; + break; + case Acidentados.DATA_EMAIL_SUPERIOR_HIERARQUICO_INDEX: + theClass = java.util.Date.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Acidentados._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Acidentados.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Actualizacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Actualizacao.java new file mode 100644 index 00000000..bd8499be --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Actualizacao.java @@ -0,0 +1,178 @@ +/* +* Actualizacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Actualizacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "actualizacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.actualizacao"; + + public static final int _INVALID__INDEX = -1; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + }; + + + protected com.evolute.entity.utils.ObjectPrimaryKey primaryKey; + + public Actualizacao() + { + super(); + dirtyProperties = new boolean[]{ }; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on Actualizacao is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Actualizacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.ObjectPrimaryKey( TABLENAME, Actualizacao.PK_FIELD_NAMES ); + } + } + + @Override + public com.evolute.entity.utils.ObjectPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/AnalisesAcidentes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/AnalisesAcidentes.java new file mode 100644 index 00000000..a0af0018 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/AnalisesAcidentes.java @@ -0,0 +1,5856 @@ +/* +* AnalisesAcidentes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class AnalisesAcidentes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( AnalisesAcidentes.ID, AnalisesAcidentes.ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ID_FULL, AnalisesAcidentes.ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ACIDENTE, AnalisesAcidentes.DATA_ACIDENTE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ACIDENTE_FULL, AnalisesAcidentes.DATA_ACIDENTE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( AnalisesAcidentes.CLASS_IDENTIFIER, AnalisesAcidentes.ACIDENTADO_ID, AnalisesAcidentes.TO_ACIDENTADO_ID ); + FIELD_INDEXES.put( AnalisesAcidentes.ACIDENTADO_ID, AnalisesAcidentes.ACIDENTADO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ACIDENTADO_ID_FULL, AnalisesAcidentes.ACIDENTADO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TO_ACIDENTADO_ID, AnalisesAcidentes.TO_ACIDENTADO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTADO, AnalisesAcidentes.ESTADO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTADO_FULL, AnalisesAcidentes.ESTADO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTABELECIMENTO_ID, AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTABELECIMENTO_ID_FULL, AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.HORAS_TURNO, AnalisesAcidentes.HORAS_TURNO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.HORAS_TURNO_FULL, AnalisesAcidentes.HORAS_TURNO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SECCAO, AnalisesAcidentes.SECCAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SECCAO_FULL, AnalisesAcidentes.SECCAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LOCAL_TRABALHO, AnalisesAcidentes.LOCAL_TRABALHO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LOCAL_TRABALHO_FULL, AnalisesAcidentes.LOCAL_TRABALHO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TAREFA, AnalisesAcidentes.TAREFA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TAREFA_FULL, AnalisesAcidentes.TAREFA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SUBSTANCIAS, AnalisesAcidentes.SUBSTANCIAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SUBSTANCIAS_FULL, AnalisesAcidentes.SUBSTANCIAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SUPERIOR_HIERARQUICO, AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SUPERIOR_HIERARQUICO_FULL, AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CONDICOES, AnalisesAcidentes.CONDICOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CONDICOES_FULL, AnalisesAcidentes.CONDICOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TESTEMUNHAS, AnalisesAcidentes.TESTEMUNHAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TESTEMUNHAS_FULL, AnalisesAcidentes.TESTEMUNHAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DESCRICAO, AnalisesAcidentes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DESCRICAO_FULL, AnalisesAcidentes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CONCLUSOES, AnalisesAcidentes.CONCLUSOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CONCLUSOES_FULL, AnalisesAcidentes.CONCLUSOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ACCOES, AnalisesAcidentes.ACCOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ACCOES_FULL, AnalisesAcidentes.ACCOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.HORA_ACIDENTE, AnalisesAcidentes.HORA_ACIDENTE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.HORA_ACIDENTE_FULL, AnalisesAcidentes.HORA_ACIDENTE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.FORMACAO_SHST, AnalisesAcidentes.FORMACAO_SHST_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.FORMACAO_SHST_FULL, AnalisesAcidentes.FORMACAO_SHST_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE, AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_FULL, AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR, AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_FULL, AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR, AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_FULL, AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES, AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_FULL, AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES, AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_FULL, AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_FULL, AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_CABECA, AnalisesAcidentes.LESAO_CABECA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_CABECA_FULL, AnalisesAcidentes.LESAO_CABECA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_PESCOCO, AnalisesAcidentes.LESAO_PESCOCO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_PESCOCO_FULL, AnalisesAcidentes.LESAO_PESCOCO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_TRONCO, AnalisesAcidentes.LESAO_TRONCO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_TRONCO_FULL, AnalisesAcidentes.LESAO_TRONCO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR, AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_FULL, AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ, AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_FULL, AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_INF_DIR, AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_FULL, AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ, AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_FULL, AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF1, AnalisesAcidentes.ESPECIF1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF1_FULL, AnalisesAcidentes.ESPECIF1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF2, AnalisesAcidentes.ESPECIF2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF2_FULL, AnalisesAcidentes.ESPECIF2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF3, AnalisesAcidentes.ESPECIF3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF3_FULL, AnalisesAcidentes.ESPECIF3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF4, AnalisesAcidentes.ESPECIF4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESPECIF4_FULL, AnalisesAcidentes.ESPECIF4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TIPO_INCAPACIDADE, AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TIPO_INCAPACIDADE_FULL, AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.COEF_INCAPACIDADE, AnalisesAcidentes.COEF_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.COEF_INCAPACIDADE_FULL, AnalisesAcidentes.COEF_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_AVAL_INCAPACIDADE, AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_FULL, AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_REV_INCAPACIDADE, AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_REV_INCAPACIDADE_FULL, AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.PERIODO_INCAPACIDADE_DE, AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_FULL, AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.PERIODO_INCAPACIDADE_A, AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.PERIODO_INCAPACIDADE_A_FULL, AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_FLEXAO, AnalisesAcidentes.IMG_FLEXAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_FLEXAO_FULL, AnalisesAcidentes.IMG_FLEXAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_EXT1, AnalisesAcidentes.IMG_EXT1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_EXT1_FULL, AnalisesAcidentes.IMG_EXT1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_EXT2, AnalisesAcidentes.IMG_EXT2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_EXT2_FULL, AnalisesAcidentes.IMG_EXT2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB2, AnalisesAcidentes.IMG_CAB2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB2_FULL, AnalisesAcidentes.IMG_CAB2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB3, AnalisesAcidentes.IMG_CAB3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB3_FULL, AnalisesAcidentes.IMG_CAB3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA2, AnalisesAcidentes.IMG_MA2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA2_FULL, AnalisesAcidentes.IMG_MA2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA3, AnalisesAcidentes.IMG_MA3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA3_FULL, AnalisesAcidentes.IMG_MA3_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA5, AnalisesAcidentes.IMG_MA5_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA5_FULL, AnalisesAcidentes.IMG_MA5_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA6, AnalisesAcidentes.IMG_MA6_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA6_FULL, AnalisesAcidentes.IMG_MA6_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA8, AnalisesAcidentes.IMG_MA8_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA8_FULL, AnalisesAcidentes.IMG_MA8_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA10, AnalisesAcidentes.IMG_MA10_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA10_FULL, AnalisesAcidentes.IMG_MA10_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_CARGA, AnalisesAcidentes.RESTRICAO_CARGA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_CARGA_FULL, AnalisesAcidentes.RESTRICAO_CARGA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_MOTRICIDADE, AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_MOTRICIDADE_FULL, AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_CONDUCAO, AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_CONDUCAO_FULL, AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_VIBRACOES, AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_VIBRACOES_FULL, AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_OUTRAS, AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RESTRICAO_OUTRAS_FULL, AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.MED_OBSERV, AnalisesAcidentes.MED_OBSERV_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.MED_OBSERV_FULL, AnalisesAcidentes.MED_OBSERV_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TIPO_LESAO, AnalisesAcidentes.TIPO_LESAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TIPO_LESAO_FULL, AnalisesAcidentes.TIPO_LESAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_ROT1, AnalisesAcidentes.IMG_ROT1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_ROT1_FULL, AnalisesAcidentes.IMG_ROT1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_ROT2, AnalisesAcidentes.IMG_ROT2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_ROT2_FULL, AnalisesAcidentes.IMG_ROT2_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB1, AnalisesAcidentes.IMG_CAB1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB1_FULL, AnalisesAcidentes.IMG_CAB1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB4, AnalisesAcidentes.IMG_CAB4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_CAB4_FULL, AnalisesAcidentes.IMG_CAB4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA1, AnalisesAcidentes.IMG_MA1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA1_FULL, AnalisesAcidentes.IMG_MA1_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA4, AnalisesAcidentes.IMG_MA4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA4_FULL, AnalisesAcidentes.IMG_MA4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA7, AnalisesAcidentes.IMG_MA7_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA7_FULL, AnalisesAcidentes.IMG_MA7_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA9, AnalisesAcidentes.IMG_MA9_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.IMG_MA9_FULL, AnalisesAcidentes.IMG_MA9_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.EMPRESA_ID, AnalisesAcidentes.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.EMPRESA_ID_FULL, AnalisesAcidentes.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.MEDICO_ID, AnalisesAcidentes.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.MEDICO_ID_FULL, AnalisesAcidentes.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TECNICO_SAUDE_ID, AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TECNICO_SAUDE_ID_FULL, AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ANALISE_NR, AnalisesAcidentes.ANALISE_NR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ANALISE_NR_FULL, AnalisesAcidentes.ANALISE_NR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTADO_ASSINATURA, AnalisesAcidentes.ESTADO_ASSINATURA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTADO_ASSINATURA_FULL, AnalisesAcidentes.ESTADO_ASSINATURA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_RESP_SEG, AnalisesAcidentes.ASS_RESP_SEG_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_RESP_SEG_FULL, AnalisesAcidentes.ASS_RESP_SEG_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_RESP_RH, AnalisesAcidentes.ASS_RESP_RH_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_RESP_RH_FULL, AnalisesAcidentes.ASS_RESP_RH_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_CONSOLIDACAO, AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_CONSOLIDACAO_FULL, AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ASSINATURA_SEG, AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ASSINATURA_SEG_FULL, AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ASSINATURA_RH, AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ASSINATURA_RH_FULL, AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_CONSOLIDACAO, AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_CONSOLIDACAO_FULL, AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESP_SEG, AnalisesAcidentes.NOME_RESP_SEG_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESP_SEG_FULL, AnalisesAcidentes.NOME_RESP_SEG_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESP_RH, AnalisesAcidentes.NOME_RESP_RH_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESP_RH_FULL, AnalisesAcidentes.NOME_RESP_RH_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CAUSAS, AnalisesAcidentes.CAUSAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CAUSAS_FULL, AnalisesAcidentes.CAUSAS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTADO_ANTES_CORRECAO, AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ESTADO_ANTES_CORRECAO_FULL, AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.OBSERVACOES_CORRECAO, AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.OBSERVACOES_CORRECAO_FULL, AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CORRECAO, AnalisesAcidentes.CORRECAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CORRECAO_FULL, AnalisesAcidentes.CORRECAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_SUPERIOR, AnalisesAcidentes.ASS_SUPERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.ASS_SUPERIOR_FULL, AnalisesAcidentes.ASS_SUPERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_SUPERIOR, AnalisesAcidentes.NOME_SUPERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_SUPERIOR_FULL, AnalisesAcidentes.NOME_SUPERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR, AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_FULL, AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.AVERIGUADOR, AnalisesAcidentes.AVERIGUADOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.AVERIGUADOR_FULL, AnalisesAcidentes.AVERIGUADOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.AVERIGUACAO_POSTERIOR, AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.AVERIGUACAO_POSTERIOR_FULL, AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.AVERIGUACAO_OBS, AnalisesAcidentes.AVERIGUACAO_OBS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.AVERIGUACAO_OBS_FULL, AnalisesAcidentes.AVERIGUACAO_OBS_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESP_CONSOLIDACAO, AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_FULL, AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_INICIO_PROCESSO, AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_INICIO_PROCESSO_FULL, AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( AnalisesAcidentes.CLASS_IDENTIFIER, AnalisesAcidentes.DEPARTAMENTO_ID, AnalisesAcidentes.TO_DEPARTAMENTO_ID ); + FIELD_INDEXES.put( AnalisesAcidentes.DEPARTAMENTO_ID, AnalisesAcidentes.DEPARTAMENTO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DEPARTAMENTO_ID_FULL, AnalisesAcidentes.DEPARTAMENTO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TO_DEPARTAMENTO_ID, AnalisesAcidentes.TO_DEPARTAMENTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( AnalisesAcidentes.CLASS_IDENTIFIER, AnalisesAcidentes.SECCAO_ID, AnalisesAcidentes.TO_SECCAO_ID ); + FIELD_INDEXES.put( AnalisesAcidentes.SECCAO_ID, AnalisesAcidentes.SECCAO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.SECCAO_ID_FULL, AnalisesAcidentes.SECCAO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.TO_SECCAO_ID, AnalisesAcidentes.TO_SECCAO_ID_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RH_FASE4, AnalisesAcidentes.RH_FASE4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.RH_FASE4_FULL, AnalisesAcidentes.RH_FASE4_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.APAGADA, AnalisesAcidentes.APAGADA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.APAGADA_FULL, AnalisesAcidentes.APAGADA_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO, AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_FULL, AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_DESACTIVACAO, AnalisesAcidentes.DATA_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_DESACTIVACAO_FULL, AnalisesAcidentes.DATA_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.COMENTARIO_DESACTIVACAO, AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.COMENTARIO_DESACTIVACAO_FULL, AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.PARTICIPADO, AnalisesAcidentes.PARTICIPADO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.PARTICIPADO_FULL, AnalisesAcidentes.PARTICIPADO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO, AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_FULL, AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_PARTICIPACAO, AnalisesAcidentes.DATA_PARTICIPACAO_INDEX ); + FIELD_INDEXES.put( AnalisesAcidentes.DATA_PARTICIPACAO_FULL, AnalisesAcidentes.DATA_PARTICIPACAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyacidentado_idToacidentados = + new com.evolute.entity.ForeignKey( AnalisesAcidentes.class, AnalisesAcidentes.ACIDENTADO_ID, db.data.siprp.outer.AcidentadosData.class, db.data.siprp.outer.AcidentadosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeydepartamento_idTodepartamentos = + new com.evolute.entity.ForeignKey( AnalisesAcidentes.class, AnalisesAcidentes.DEPARTAMENTO_ID, db.data.siprp.outer.DepartamentosData.class, db.data.siprp.outer.DepartamentosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyseccao_idToseccoes = + new com.evolute.entity.ForeignKey( AnalisesAcidentes.class, AnalisesAcidentes.SECCAO_ID, db.data.siprp.outer.SeccoesData.class, db.data.siprp.outer.SeccoesData.ID ); + + public static final String TABLENAME = "analises_acidentes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.analises_acidentes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "analises_acidentes.id"; + public static final int ID_INDEX = 0; + public static final String DATA_ACIDENTE = "data_acidente"; + public static final String DATA_ACIDENTE_FULL = "analises_acidentes.data_acidente"; + public static final int DATA_ACIDENTE_INDEX = 1; + public static final String ACIDENTADO_ID = "acidentado_id"; + public static final String ACIDENTADO_ID_FULL = "analises_acidentes.acidentado_id"; + public static final int ACIDENTADO_ID_INDEX = 2; + public static final String TO_ACIDENTADO_ID = "to_acidentado_id"; + public static final String TO_ACIDENTADO_ID_FULL = "analises_acidentes.to_acidentado_id"; + public static final int TO_ACIDENTADO_ID_INDEX = 3; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "analises_acidentes.estado"; + public static final int ESTADO_INDEX = 4; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "analises_acidentes.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 5; + public static final String HORAS_TURNO = "horas_turno"; + public static final String HORAS_TURNO_FULL = "analises_acidentes.horas_turno"; + public static final int HORAS_TURNO_INDEX = 6; + public static final String SECCAO = "seccao"; + public static final String SECCAO_FULL = "analises_acidentes.seccao"; + public static final int SECCAO_INDEX = 7; + public static final String LOCAL_TRABALHO = "local_trabalho"; + public static final String LOCAL_TRABALHO_FULL = "analises_acidentes.local_trabalho"; + public static final int LOCAL_TRABALHO_INDEX = 8; + public static final String TAREFA = "tarefa"; + public static final String TAREFA_FULL = "analises_acidentes.tarefa"; + public static final int TAREFA_INDEX = 9; + public static final String SUBSTANCIAS = "substancias"; + public static final String SUBSTANCIAS_FULL = "analises_acidentes.substancias"; + public static final int SUBSTANCIAS_INDEX = 10; + public static final String SUPERIOR_HIERARQUICO = "superior_hierarquico"; + public static final String SUPERIOR_HIERARQUICO_FULL = "analises_acidentes.superior_hierarquico"; + public static final int SUPERIOR_HIERARQUICO_INDEX = 11; + public static final String CONDICOES = "condicoes"; + public static final String CONDICOES_FULL = "analises_acidentes.condicoes"; + public static final int CONDICOES_INDEX = 12; + public static final String TESTEMUNHAS = "testemunhas"; + public static final String TESTEMUNHAS_FULL = "analises_acidentes.testemunhas"; + public static final int TESTEMUNHAS_INDEX = 13; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "analises_acidentes.descricao"; + public static final int DESCRICAO_INDEX = 14; + public static final String CONCLUSOES = "conclusoes"; + public static final String CONCLUSOES_FULL = "analises_acidentes.conclusoes"; + public static final int CONCLUSOES_INDEX = 15; + public static final String ACCOES = "accoes"; + public static final String ACCOES_FULL = "analises_acidentes.accoes"; + public static final int ACCOES_INDEX = 16; + public static final String HORA_ACIDENTE = "hora_acidente"; + public static final String HORA_ACIDENTE_FULL = "analises_acidentes.hora_acidente"; + public static final int HORA_ACIDENTE_INDEX = 17; + public static final String FORMACAO_SHST = "formacao_shst"; + public static final String FORMACAO_SHST_FULL = "analises_acidentes.formacao_shst"; + public static final int FORMACAO_SHST_INDEX = 18; + public static final String FORMACAO_SHST_NAO_PORQUE = "formacao_shst_nao_porque"; + public static final String FORMACAO_SHST_NAO_PORQUE_FULL = "analises_acidentes.formacao_shst_nao_porque"; + public static final int FORMACAO_SHST_NAO_PORQUE_INDEX = 19; + public static final String OUTROS_ACIDENTES_COM_COLABORADOR = "outros_acidentes_com_colaborador"; + public static final String OUTROS_ACIDENTES_COM_COLABORADOR_FULL = "analises_acidentes.outros_acidentes_com_colaborador"; + public static final int OUTROS_ACIDENTES_COM_COLABORADOR_INDEX = 20; + public static final String NR_ACIDENTES_COM_COLABORADOR = "nr_acidentes_com_colaborador"; + public static final String NR_ACIDENTES_COM_COLABORADOR_FULL = "analises_acidentes.nr_acidentes_com_colaborador"; + public static final int NR_ACIDENTES_COM_COLABORADOR_INDEX = 21; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR1 = "nr_relatorio_acidente_colaborador1"; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR1_FULL = "analises_acidentes.nr_relatorio_acidente_colaborador1"; + public static final int NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX = 22; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR2 = "nr_relatorio_acidente_colaborador2"; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR2_FULL = "analises_acidentes.nr_relatorio_acidente_colaborador2"; + public static final int NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX = 23; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR3 = "nr_relatorio_acidente_colaborador3"; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR3_FULL = "analises_acidentes.nr_relatorio_acidente_colaborador3"; + public static final int NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX = 24; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR4 = "nr_relatorio_acidente_colaborador4"; + public static final String NR_RELATORIO_ACIDENTE_COLABORADOR4_FULL = "analises_acidentes.nr_relatorio_acidente_colaborador4"; + public static final int NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX = 25; + public static final String ACIDENTES_OUTROS_COLABORADORES = "acidentes_outros_colaboradores"; + public static final String ACIDENTES_OUTROS_COLABORADORES_FULL = "analises_acidentes.acidentes_outros_colaboradores"; + public static final int ACIDENTES_OUTROS_COLABORADORES_INDEX = 26; + public static final String NR_ACIDENTES_OUTROS_COLABORADORES = "nr_acidentes_outros_colaboradores"; + public static final String NR_ACIDENTES_OUTROS_COLABORADORES_FULL = "analises_acidentes.nr_acidentes_outros_colaboradores"; + public static final int NR_ACIDENTES_OUTROS_COLABORADORES_INDEX = 27; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1 = "nr_relatorio_acidente_outros_colaboradores1"; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_FULL = "analises_acidentes.nr_relatorio_acidente_outros_colaboradores1"; + public static final int NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX = 28; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2 = "nr_relatorio_acidente_outros_colaboradores2"; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_FULL = "analises_acidentes.nr_relatorio_acidente_outros_colaboradores2"; + public static final int NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX = 29; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3 = "nr_relatorio_acidente_outros_colaboradores3"; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_FULL = "analises_acidentes.nr_relatorio_acidente_outros_colaboradores3"; + public static final int NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX = 30; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4 = "nr_relatorio_acidente_outros_colaboradores4"; + public static final String NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_FULL = "analises_acidentes.nr_relatorio_acidente_outros_colaboradores4"; + public static final int NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX = 31; + public static final String LESAO_CABECA = "lesao_cabeca"; + public static final String LESAO_CABECA_FULL = "analises_acidentes.lesao_cabeca"; + public static final int LESAO_CABECA_INDEX = 32; + public static final String LESAO_PESCOCO = "lesao_pescoco"; + public static final String LESAO_PESCOCO_FULL = "analises_acidentes.lesao_pescoco"; + public static final int LESAO_PESCOCO_INDEX = 33; + public static final String LESAO_TRONCO = "lesao_tronco"; + public static final String LESAO_TRONCO_FULL = "analises_acidentes.lesao_tronco"; + public static final int LESAO_TRONCO_INDEX = 34; + public static final String LESAO_MEMBRO_SUP_DIR = "lesao_membro_sup_dir"; + public static final String LESAO_MEMBRO_SUP_DIR_FULL = "analises_acidentes.lesao_membro_sup_dir"; + public static final int LESAO_MEMBRO_SUP_DIR_INDEX = 35; + public static final String LESAO_MEMBRO_SUP_ESQ = "lesao_membro_sup_esq"; + public static final String LESAO_MEMBRO_SUP_ESQ_FULL = "analises_acidentes.lesao_membro_sup_esq"; + public static final int LESAO_MEMBRO_SUP_ESQ_INDEX = 36; + public static final String LESAO_MEMBRO_INF_DIR = "lesao_membro_inf_dir"; + public static final String LESAO_MEMBRO_INF_DIR_FULL = "analises_acidentes.lesao_membro_inf_dir"; + public static final int LESAO_MEMBRO_INF_DIR_INDEX = 37; + public static final String LESAO_MEMBRO_INF_ESQ = "lesao_membro_inf_esq"; + public static final String LESAO_MEMBRO_INF_ESQ_FULL = "analises_acidentes.lesao_membro_inf_esq"; + public static final int LESAO_MEMBRO_INF_ESQ_INDEX = 38; + public static final String ESPECIF1 = "especif1"; + public static final String ESPECIF1_FULL = "analises_acidentes.especif1"; + public static final int ESPECIF1_INDEX = 39; + public static final String ESPECIF2 = "especif2"; + public static final String ESPECIF2_FULL = "analises_acidentes.especif2"; + public static final int ESPECIF2_INDEX = 40; + public static final String ESPECIF3 = "especif3"; + public static final String ESPECIF3_FULL = "analises_acidentes.especif3"; + public static final int ESPECIF3_INDEX = 41; + public static final String ESPECIF4 = "especif4"; + public static final String ESPECIF4_FULL = "analises_acidentes.especif4"; + public static final int ESPECIF4_INDEX = 42; + public static final String TIPO_INCAPACIDADE = "tipo_incapacidade"; + public static final String TIPO_INCAPACIDADE_FULL = "analises_acidentes.tipo_incapacidade"; + public static final int TIPO_INCAPACIDADE_INDEX = 43; + public static final String COEF_INCAPACIDADE = "coef_incapacidade"; + public static final String COEF_INCAPACIDADE_FULL = "analises_acidentes.coef_incapacidade"; + public static final int COEF_INCAPACIDADE_INDEX = 44; + public static final String DATA_AVAL_INCAPACIDADE = "data_aval_incapacidade"; + public static final String DATA_AVAL_INCAPACIDADE_FULL = "analises_acidentes.data_aval_incapacidade"; + public static final int DATA_AVAL_INCAPACIDADE_INDEX = 45; + public static final String DATA_REV_INCAPACIDADE = "data_rev_incapacidade"; + public static final String DATA_REV_INCAPACIDADE_FULL = "analises_acidentes.data_rev_incapacidade"; + public static final int DATA_REV_INCAPACIDADE_INDEX = 46; + public static final String PERIODO_INCAPACIDADE_DE = "periodo_incapacidade_de"; + public static final String PERIODO_INCAPACIDADE_DE_FULL = "analises_acidentes.periodo_incapacidade_de"; + public static final int PERIODO_INCAPACIDADE_DE_INDEX = 47; + public static final String PERIODO_INCAPACIDADE_A = "periodo_incapacidade_a"; + public static final String PERIODO_INCAPACIDADE_A_FULL = "analises_acidentes.periodo_incapacidade_a"; + public static final int PERIODO_INCAPACIDADE_A_INDEX = 48; + public static final String IMG_FLEXAO = "img_flexao"; + public static final String IMG_FLEXAO_FULL = "analises_acidentes.img_flexao"; + public static final int IMG_FLEXAO_INDEX = 49; + public static final String IMG_EXT1 = "img_ext1"; + public static final String IMG_EXT1_FULL = "analises_acidentes.img_ext1"; + public static final int IMG_EXT1_INDEX = 50; + public static final String IMG_EXT2 = "img_ext2"; + public static final String IMG_EXT2_FULL = "analises_acidentes.img_ext2"; + public static final int IMG_EXT2_INDEX = 51; + public static final String IMG_CAB2 = "img_cab2"; + public static final String IMG_CAB2_FULL = "analises_acidentes.img_cab2"; + public static final int IMG_CAB2_INDEX = 52; + public static final String IMG_CAB3 = "img_cab3"; + public static final String IMG_CAB3_FULL = "analises_acidentes.img_cab3"; + public static final int IMG_CAB3_INDEX = 53; + public static final String IMG_MA2 = "img_ma2"; + public static final String IMG_MA2_FULL = "analises_acidentes.img_ma2"; + public static final int IMG_MA2_INDEX = 54; + public static final String IMG_MA3 = "img_ma3"; + public static final String IMG_MA3_FULL = "analises_acidentes.img_ma3"; + public static final int IMG_MA3_INDEX = 55; + public static final String IMG_MA5 = "img_ma5"; + public static final String IMG_MA5_FULL = "analises_acidentes.img_ma5"; + public static final int IMG_MA5_INDEX = 56; + public static final String IMG_MA6 = "img_ma6"; + public static final String IMG_MA6_FULL = "analises_acidentes.img_ma6"; + public static final int IMG_MA6_INDEX = 57; + public static final String IMG_MA8 = "img_ma8"; + public static final String IMG_MA8_FULL = "analises_acidentes.img_ma8"; + public static final int IMG_MA8_INDEX = 58; + public static final String IMG_MA10 = "img_ma10"; + public static final String IMG_MA10_FULL = "analises_acidentes.img_ma10"; + public static final int IMG_MA10_INDEX = 59; + public static final String RESTRICAO_CARGA = "restricao_carga"; + public static final String RESTRICAO_CARGA_FULL = "analises_acidentes.restricao_carga"; + public static final int RESTRICAO_CARGA_INDEX = 60; + public static final String RESTRICAO_MOTRICIDADE = "restricao_motricidade"; + public static final String RESTRICAO_MOTRICIDADE_FULL = "analises_acidentes.restricao_motricidade"; + public static final int RESTRICAO_MOTRICIDADE_INDEX = 61; + public static final String RESTRICAO_CONDUCAO = "restricao_conducao"; + public static final String RESTRICAO_CONDUCAO_FULL = "analises_acidentes.restricao_conducao"; + public static final int RESTRICAO_CONDUCAO_INDEX = 62; + public static final String RESTRICAO_VIBRACOES = "restricao_vibracoes"; + public static final String RESTRICAO_VIBRACOES_FULL = "analises_acidentes.restricao_vibracoes"; + public static final int RESTRICAO_VIBRACOES_INDEX = 63; + public static final String RESTRICAO_OUTRAS = "restricao_outras"; + public static final String RESTRICAO_OUTRAS_FULL = "analises_acidentes.restricao_outras"; + public static final int RESTRICAO_OUTRAS_INDEX = 64; + public static final String MED_OBSERV = "med_observ"; + public static final String MED_OBSERV_FULL = "analises_acidentes.med_observ"; + public static final int MED_OBSERV_INDEX = 65; + public static final String TIPO_LESAO = "tipo_lesao"; + public static final String TIPO_LESAO_FULL = "analises_acidentes.tipo_lesao"; + public static final int TIPO_LESAO_INDEX = 66; + public static final String IMG_ROT1 = "img_rot1"; + public static final String IMG_ROT1_FULL = "analises_acidentes.img_rot1"; + public static final int IMG_ROT1_INDEX = 67; + public static final String IMG_ROT2 = "img_rot2"; + public static final String IMG_ROT2_FULL = "analises_acidentes.img_rot2"; + public static final int IMG_ROT2_INDEX = 68; + public static final String IMG_CAB1 = "img_cab1"; + public static final String IMG_CAB1_FULL = "analises_acidentes.img_cab1"; + public static final int IMG_CAB1_INDEX = 69; + public static final String IMG_CAB4 = "img_cab4"; + public static final String IMG_CAB4_FULL = "analises_acidentes.img_cab4"; + public static final int IMG_CAB4_INDEX = 70; + public static final String IMG_MA1 = "img_ma1"; + public static final String IMG_MA1_FULL = "analises_acidentes.img_ma1"; + public static final int IMG_MA1_INDEX = 71; + public static final String IMG_MA4 = "img_ma4"; + public static final String IMG_MA4_FULL = "analises_acidentes.img_ma4"; + public static final int IMG_MA4_INDEX = 72; + public static final String IMG_MA7 = "img_ma7"; + public static final String IMG_MA7_FULL = "analises_acidentes.img_ma7"; + public static final int IMG_MA7_INDEX = 73; + public static final String IMG_MA9 = "img_ma9"; + public static final String IMG_MA9_FULL = "analises_acidentes.img_ma9"; + public static final int IMG_MA9_INDEX = 74; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "analises_acidentes.empresa_id"; + public static final int EMPRESA_ID_INDEX = 75; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "analises_acidentes.medico_id"; + public static final int MEDICO_ID_INDEX = 76; + public static final String TECNICO_SAUDE_ID = "tecnico_saude_id"; + public static final String TECNICO_SAUDE_ID_FULL = "analises_acidentes.tecnico_saude_id"; + public static final int TECNICO_SAUDE_ID_INDEX = 77; + public static final String ANALISE_NR = "analise_nr"; + public static final String ANALISE_NR_FULL = "analises_acidentes.analise_nr"; + public static final int ANALISE_NR_INDEX = 78; + public static final String ESTADO_ASSINATURA = "estado_assinatura"; + public static final String ESTADO_ASSINATURA_FULL = "analises_acidentes.estado_assinatura"; + public static final int ESTADO_ASSINATURA_INDEX = 79; + public static final String ASS_RESP_SEG = "ass_resp_seg"; + public static final String ASS_RESP_SEG_FULL = "analises_acidentes.ass_resp_seg"; + public static final int ASS_RESP_SEG_INDEX = 80; + public static final String ASS_RESP_RH = "ass_resp_rh"; + public static final String ASS_RESP_RH_FULL = "analises_acidentes.ass_resp_rh"; + public static final int ASS_RESP_RH_INDEX = 81; + public static final String DATA_CONSOLIDACAO = "data_consolidacao"; + public static final String DATA_CONSOLIDACAO_FULL = "analises_acidentes.data_consolidacao"; + public static final int DATA_CONSOLIDACAO_INDEX = 82; + public static final String DATA_ASSINATURA_SEG = "data_assinatura_seg"; + public static final String DATA_ASSINATURA_SEG_FULL = "analises_acidentes.data_assinatura_seg"; + public static final int DATA_ASSINATURA_SEG_INDEX = 83; + public static final String DATA_ASSINATURA_RH = "data_assinatura_rh"; + public static final String DATA_ASSINATURA_RH_FULL = "analises_acidentes.data_assinatura_rh"; + public static final int DATA_ASSINATURA_RH_INDEX = 84; + public static final String ASS_CONSOLIDACAO = "ass_consolidacao"; + public static final String ASS_CONSOLIDACAO_FULL = "analises_acidentes.ass_consolidacao"; + public static final int ASS_CONSOLIDACAO_INDEX = 85; + public static final String NOME_RESP_SEG = "nome_resp_seg"; + public static final String NOME_RESP_SEG_FULL = "analises_acidentes.nome_resp_seg"; + public static final int NOME_RESP_SEG_INDEX = 86; + public static final String NOME_RESP_RH = "nome_resp_rh"; + public static final String NOME_RESP_RH_FULL = "analises_acidentes.nome_resp_rh"; + public static final int NOME_RESP_RH_INDEX = 87; + public static final String CAUSAS = "causas"; + public static final String CAUSAS_FULL = "analises_acidentes.causas"; + public static final int CAUSAS_INDEX = 88; + public static final String ESTADO_ANTES_CORRECAO = "estado_antes_correcao"; + public static final String ESTADO_ANTES_CORRECAO_FULL = "analises_acidentes.estado_antes_correcao"; + public static final int ESTADO_ANTES_CORRECAO_INDEX = 89; + public static final String OBSERVACOES_CORRECAO = "observacoes_correcao"; + public static final String OBSERVACOES_CORRECAO_FULL = "analises_acidentes.observacoes_correcao"; + public static final int OBSERVACOES_CORRECAO_INDEX = 90; + public static final String CORRECAO = "correcao"; + public static final String CORRECAO_FULL = "analises_acidentes.correcao"; + public static final int CORRECAO_INDEX = 91; + public static final String ASS_SUPERIOR = "ass_superior"; + public static final String ASS_SUPERIOR_FULL = "analises_acidentes.ass_superior"; + public static final int ASS_SUPERIOR_INDEX = 92; + public static final String NOME_SUPERIOR = "nome_superior"; + public static final String NOME_SUPERIOR_FULL = "analises_acidentes.nome_superior"; + public static final int NOME_SUPERIOR_INDEX = 93; + public static final String DATA_ASSINATURA_SUPERIOR = "data_assinatura_superior"; + public static final String DATA_ASSINATURA_SUPERIOR_FULL = "analises_acidentes.data_assinatura_superior"; + public static final int DATA_ASSINATURA_SUPERIOR_INDEX = 94; + public static final String AVERIGUADOR = "averiguador"; + public static final String AVERIGUADOR_FULL = "analises_acidentes.averiguador"; + public static final int AVERIGUADOR_INDEX = 95; + public static final String AVERIGUACAO_POSTERIOR = "averiguacao_posterior"; + public static final String AVERIGUACAO_POSTERIOR_FULL = "analises_acidentes.averiguacao_posterior"; + public static final int AVERIGUACAO_POSTERIOR_INDEX = 96; + public static final String AVERIGUACAO_OBS = "averiguacao_obs"; + public static final String AVERIGUACAO_OBS_FULL = "analises_acidentes.averiguacao_obs"; + public static final int AVERIGUACAO_OBS_INDEX = 97; + public static final String NOME_RESP_CONSOLIDACAO = "nome_resp_consolidacao"; + public static final String NOME_RESP_CONSOLIDACAO_FULL = "analises_acidentes.nome_resp_consolidacao"; + public static final int NOME_RESP_CONSOLIDACAO_INDEX = 98; + public static final String DATA_INICIO_PROCESSO = "data_inicio_processo"; + public static final String DATA_INICIO_PROCESSO_FULL = "analises_acidentes.data_inicio_processo"; + public static final int DATA_INICIO_PROCESSO_INDEX = 99; + public static final String DEPARTAMENTO_ID = "departamento_id"; + public static final String DEPARTAMENTO_ID_FULL = "analises_acidentes.departamento_id"; + public static final int DEPARTAMENTO_ID_INDEX = 100; + public static final String TO_DEPARTAMENTO_ID = "to_departamento_id"; + public static final String TO_DEPARTAMENTO_ID_FULL = "analises_acidentes.to_departamento_id"; + public static final int TO_DEPARTAMENTO_ID_INDEX = 101; + public static final String SECCAO_ID = "seccao_id"; + public static final String SECCAO_ID_FULL = "analises_acidentes.seccao_id"; + public static final int SECCAO_ID_INDEX = 102; + public static final String TO_SECCAO_ID = "to_seccao_id"; + public static final String TO_SECCAO_ID_FULL = "analises_acidentes.to_seccao_id"; + public static final int TO_SECCAO_ID_INDEX = 103; + public static final String RH_FASE4 = "rh_fase4"; + public static final String RH_FASE4_FULL = "analises_acidentes.rh_fase4"; + public static final int RH_FASE4_INDEX = 104; + public static final String APAGADA = "apagada"; + public static final String APAGADA_FULL = "analises_acidentes.apagada"; + public static final int APAGADA_INDEX = 105; + public static final String CONCLUIDO_POR_DESACTIVACAO = "concluido_por_desactivacao"; + public static final String CONCLUIDO_POR_DESACTIVACAO_FULL = "analises_acidentes.concluido_por_desactivacao"; + public static final int CONCLUIDO_POR_DESACTIVACAO_INDEX = 106; + public static final String DATA_DESACTIVACAO = "data_desactivacao"; + public static final String DATA_DESACTIVACAO_FULL = "analises_acidentes.data_desactivacao"; + public static final int DATA_DESACTIVACAO_INDEX = 107; + public static final String COMENTARIO_DESACTIVACAO = "comentario_desactivacao"; + public static final String COMENTARIO_DESACTIVACAO_FULL = "analises_acidentes.comentario_desactivacao"; + public static final int COMENTARIO_DESACTIVACAO_INDEX = 108; + public static final String PARTICIPADO = "participado"; + public static final String PARTICIPADO_FULL = "analises_acidentes.participado"; + public static final int PARTICIPADO_INDEX = 109; + public static final String NOME_RESPONSAVEL_PARTICIPACAO = "nome_responsavel_participacao"; + public static final String NOME_RESPONSAVEL_PARTICIPACAO_FULL = "analises_acidentes.nome_responsavel_participacao"; + public static final int NOME_RESPONSAVEL_PARTICIPACAO_INDEX = 110; + public static final String DATA_PARTICIPACAO = "data_participacao"; + public static final String DATA_PARTICIPACAO_FULL = "analises_acidentes.data_participacao"; + public static final int DATA_PARTICIPACAO_INDEX = 111; + + public static final String FIELD_NAMES[] = new String[]{ + DATA_ACIDENTE, ACIDENTADO_ID, TO_ACIDENTADO_ID, ESTADO, ESTABELECIMENTO_ID, + HORAS_TURNO, SECCAO, LOCAL_TRABALHO, TAREFA, SUBSTANCIAS, SUPERIOR_HIERARQUICO, + CONDICOES, TESTEMUNHAS, DESCRICAO, CONCLUSOES, ACCOES, HORA_ACIDENTE, + FORMACAO_SHST, FORMACAO_SHST_NAO_PORQUE, OUTROS_ACIDENTES_COM_COLABORADOR, + NR_ACIDENTES_COM_COLABORADOR, NR_RELATORIO_ACIDENTE_COLABORADOR1, + NR_RELATORIO_ACIDENTE_COLABORADOR2, NR_RELATORIO_ACIDENTE_COLABORADOR3, + NR_RELATORIO_ACIDENTE_COLABORADOR4, ACIDENTES_OUTROS_COLABORADORES, + NR_ACIDENTES_OUTROS_COLABORADORES, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, LESAO_CABECA, LESAO_PESCOCO, + LESAO_TRONCO, LESAO_MEMBRO_SUP_DIR, LESAO_MEMBRO_SUP_ESQ, + LESAO_MEMBRO_INF_DIR, LESAO_MEMBRO_INF_ESQ, ESPECIF1, ESPECIF2, ESPECIF3, + ESPECIF4, TIPO_INCAPACIDADE, COEF_INCAPACIDADE, DATA_AVAL_INCAPACIDADE, + DATA_REV_INCAPACIDADE, PERIODO_INCAPACIDADE_DE, PERIODO_INCAPACIDADE_A, + IMG_FLEXAO, IMG_EXT1, IMG_EXT2, IMG_CAB2, IMG_CAB3, IMG_MA2, IMG_MA3, IMG_MA5, IMG_MA6, + IMG_MA8, IMG_MA10, RESTRICAO_CARGA, RESTRICAO_MOTRICIDADE, RESTRICAO_CONDUCAO, + RESTRICAO_VIBRACOES, RESTRICAO_OUTRAS, MED_OBSERV, TIPO_LESAO, IMG_ROT1, + IMG_ROT2, IMG_CAB1, IMG_CAB4, IMG_MA1, IMG_MA4, IMG_MA7, IMG_MA9, EMPRESA_ID, + MEDICO_ID, TECNICO_SAUDE_ID, ANALISE_NR, ESTADO_ASSINATURA, ASS_RESP_SEG, + ASS_RESP_RH, DATA_CONSOLIDACAO, DATA_ASSINATURA_SEG, DATA_ASSINATURA_RH, + ASS_CONSOLIDACAO, NOME_RESP_SEG, NOME_RESP_RH, CAUSAS, ESTADO_ANTES_CORRECAO, + OBSERVACOES_CORRECAO, CORRECAO, ASS_SUPERIOR, NOME_SUPERIOR, + DATA_ASSINATURA_SUPERIOR, AVERIGUADOR, AVERIGUACAO_POSTERIOR, + AVERIGUACAO_OBS, NOME_RESP_CONSOLIDACAO, DATA_INICIO_PROCESSO, + DEPARTAMENTO_ID, TO_DEPARTAMENTO_ID, SECCAO_ID, TO_SECCAO_ID, RH_FASE4, APAGADA, + CONCLUIDO_POR_DESACTIVACAO, DATA_DESACTIVACAO, COMENTARIO_DESACTIVACAO, + PARTICIPADO, NOME_RESPONSAVEL_PARTICIPACAO, DATA_PARTICIPACAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA_ACIDENTE, TABLENAME + "." + ACIDENTADO_ID, TABLENAME + "." + TO_ACIDENTADO_ID, TABLENAME + "." + ESTADO, TABLENAME + "." + ESTABELECIMENTO_ID, + TABLENAME + "." + HORAS_TURNO, TABLENAME + "." + SECCAO, TABLENAME + "." + LOCAL_TRABALHO, TABLENAME + "." + TAREFA, TABLENAME + "." + SUBSTANCIAS, TABLENAME + "." + SUPERIOR_HIERARQUICO, + TABLENAME + "." + CONDICOES, TABLENAME + "." + TESTEMUNHAS, TABLENAME + "." + DESCRICAO, TABLENAME + "." + CONCLUSOES, TABLENAME + "." + ACCOES, TABLENAME + "." + HORA_ACIDENTE, + TABLENAME + "." + FORMACAO_SHST, TABLENAME + "." + FORMACAO_SHST_NAO_PORQUE, TABLENAME + "." + OUTROS_ACIDENTES_COM_COLABORADOR, + TABLENAME + "." + NR_ACIDENTES_COM_COLABORADOR, TABLENAME + "." + NR_RELATORIO_ACIDENTE_COLABORADOR1, + TABLENAME + "." + NR_RELATORIO_ACIDENTE_COLABORADOR2, TABLENAME + "." + NR_RELATORIO_ACIDENTE_COLABORADOR3, + TABLENAME + "." + NR_RELATORIO_ACIDENTE_COLABORADOR4, TABLENAME + "." + ACIDENTES_OUTROS_COLABORADORES, + TABLENAME + "." + NR_ACIDENTES_OUTROS_COLABORADORES, + TABLENAME + "." + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, + TABLENAME + "." + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, + TABLENAME + "." + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, + TABLENAME + "." + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, TABLENAME + "." + LESAO_CABECA, TABLENAME + "." + LESAO_PESCOCO, + TABLENAME + "." + LESAO_TRONCO, TABLENAME + "." + LESAO_MEMBRO_SUP_DIR, TABLENAME + "." + LESAO_MEMBRO_SUP_ESQ, + TABLENAME + "." + LESAO_MEMBRO_INF_DIR, TABLENAME + "." + LESAO_MEMBRO_INF_ESQ, TABLENAME + "." + ESPECIF1, TABLENAME + "." + ESPECIF2, TABLENAME + "." + ESPECIF3, + TABLENAME + "." + ESPECIF4, TABLENAME + "." + TIPO_INCAPACIDADE, TABLENAME + "." + COEF_INCAPACIDADE, TABLENAME + "." + DATA_AVAL_INCAPACIDADE, + TABLENAME + "." + DATA_REV_INCAPACIDADE, TABLENAME + "." + PERIODO_INCAPACIDADE_DE, TABLENAME + "." + PERIODO_INCAPACIDADE_A, + TABLENAME + "." + IMG_FLEXAO, TABLENAME + "." + IMG_EXT1, TABLENAME + "." + IMG_EXT2, TABLENAME + "." + IMG_CAB2, TABLENAME + "." + IMG_CAB3, TABLENAME + "." + IMG_MA2, TABLENAME + "." + IMG_MA3, TABLENAME + "." + IMG_MA5, TABLENAME + "." + IMG_MA6, + TABLENAME + "." + IMG_MA8, TABLENAME + "." + IMG_MA10, TABLENAME + "." + RESTRICAO_CARGA, TABLENAME + "." + RESTRICAO_MOTRICIDADE, TABLENAME + "." + RESTRICAO_CONDUCAO, + TABLENAME + "." + RESTRICAO_VIBRACOES, TABLENAME + "." + RESTRICAO_OUTRAS, TABLENAME + "." + MED_OBSERV, TABLENAME + "." + TIPO_LESAO, TABLENAME + "." + IMG_ROT1, + TABLENAME + "." + IMG_ROT2, TABLENAME + "." + IMG_CAB1, TABLENAME + "." + IMG_CAB4, TABLENAME + "." + IMG_MA1, TABLENAME + "." + IMG_MA4, TABLENAME + "." + IMG_MA7, TABLENAME + "." + IMG_MA9, TABLENAME + "." + EMPRESA_ID, + TABLENAME + "." + MEDICO_ID, TABLENAME + "." + TECNICO_SAUDE_ID, TABLENAME + "." + ANALISE_NR, TABLENAME + "." + ESTADO_ASSINATURA, TABLENAME + "." + ASS_RESP_SEG, + TABLENAME + "." + ASS_RESP_RH, TABLENAME + "." + DATA_CONSOLIDACAO, TABLENAME + "." + DATA_ASSINATURA_SEG, TABLENAME + "." + DATA_ASSINATURA_RH, + TABLENAME + "." + ASS_CONSOLIDACAO, TABLENAME + "." + NOME_RESP_SEG, TABLENAME + "." + NOME_RESP_RH, TABLENAME + "." + CAUSAS, TABLENAME + "." + ESTADO_ANTES_CORRECAO, + TABLENAME + "." + OBSERVACOES_CORRECAO, TABLENAME + "." + CORRECAO, TABLENAME + "." + ASS_SUPERIOR, TABLENAME + "." + NOME_SUPERIOR, + TABLENAME + "." + DATA_ASSINATURA_SUPERIOR, TABLENAME + "." + AVERIGUADOR, TABLENAME + "." + AVERIGUACAO_POSTERIOR, + TABLENAME + "." + AVERIGUACAO_OBS, TABLENAME + "." + NOME_RESP_CONSOLIDACAO, TABLENAME + "." + DATA_INICIO_PROCESSO, + TABLENAME + "." + DEPARTAMENTO_ID, TABLENAME + "." + TO_DEPARTAMENTO_ID, TABLENAME + "." + SECCAO_ID, TABLENAME + "." + TO_SECCAO_ID, TABLENAME + "." + RH_FASE4, TABLENAME + "." + APAGADA, + TABLENAME + "." + CONCLUIDO_POR_DESACTIVACAO, TABLENAME + "." + DATA_DESACTIVACAO, TABLENAME + "." + COMENTARIO_DESACTIVACAO, + TABLENAME + "." + PARTICIPADO, TABLENAME + "." + NOME_RESPONSAVEL_PARTICIPACAO, TABLENAME + "." + DATA_PARTICIPACAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA_ACIDENTE, ACIDENTADO_ID, ESTADO, ESTABELECIMENTO_ID, HORAS_TURNO, SECCAO, + LOCAL_TRABALHO, TAREFA, SUBSTANCIAS, SUPERIOR_HIERARQUICO, CONDICOES, + TESTEMUNHAS, DESCRICAO, CONCLUSOES, ACCOES, HORA_ACIDENTE, FORMACAO_SHST, + FORMACAO_SHST_NAO_PORQUE, OUTROS_ACIDENTES_COM_COLABORADOR, + NR_ACIDENTES_COM_COLABORADOR, NR_RELATORIO_ACIDENTE_COLABORADOR1, + NR_RELATORIO_ACIDENTE_COLABORADOR2, NR_RELATORIO_ACIDENTE_COLABORADOR3, + NR_RELATORIO_ACIDENTE_COLABORADOR4, ACIDENTES_OUTROS_COLABORADORES, + NR_ACIDENTES_OUTROS_COLABORADORES, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, LESAO_CABECA, LESAO_PESCOCO, + LESAO_TRONCO, LESAO_MEMBRO_SUP_DIR, LESAO_MEMBRO_SUP_ESQ, + LESAO_MEMBRO_INF_DIR, LESAO_MEMBRO_INF_ESQ, ESPECIF1, ESPECIF2, ESPECIF3, + ESPECIF4, TIPO_INCAPACIDADE, COEF_INCAPACIDADE, DATA_AVAL_INCAPACIDADE, + DATA_REV_INCAPACIDADE, PERIODO_INCAPACIDADE_DE, PERIODO_INCAPACIDADE_A, + IMG_FLEXAO, IMG_EXT1, IMG_EXT2, IMG_CAB2, IMG_CAB3, IMG_MA2, IMG_MA3, IMG_MA5, IMG_MA6, + IMG_MA8, IMG_MA10, RESTRICAO_CARGA, RESTRICAO_MOTRICIDADE, RESTRICAO_CONDUCAO, + RESTRICAO_VIBRACOES, RESTRICAO_OUTRAS, MED_OBSERV, TIPO_LESAO, IMG_ROT1, + IMG_ROT2, IMG_CAB1, IMG_CAB4, IMG_MA1, IMG_MA4, IMG_MA7, IMG_MA9, EMPRESA_ID, + MEDICO_ID, TECNICO_SAUDE_ID, ANALISE_NR, ESTADO_ASSINATURA, ASS_RESP_SEG, + ASS_RESP_RH, DATA_CONSOLIDACAO, DATA_ASSINATURA_SEG, DATA_ASSINATURA_RH, + ASS_CONSOLIDACAO, NOME_RESP_SEG, NOME_RESP_RH, CAUSAS, ESTADO_ANTES_CORRECAO, + OBSERVACOES_CORRECAO, CORRECAO, ASS_SUPERIOR, NOME_SUPERIOR, + DATA_ASSINATURA_SUPERIOR, AVERIGUADOR, AVERIGUACAO_POSTERIOR, + AVERIGUACAO_OBS, NOME_RESP_CONSOLIDACAO, DATA_INICIO_PROCESSO, + DEPARTAMENTO_ID, SECCAO_ID, RH_FASE4, APAGADA, CONCLUIDO_POR_DESACTIVACAO, + DATA_DESACTIVACAO, COMENTARIO_DESACTIVACAO, PARTICIPADO, + NOME_RESPONSAVEL_PARTICIPACAO, DATA_PARTICIPACAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA_ACIDENTE, ACIDENTADO_ID, ESTADO, ESTABELECIMENTO_ID, HORAS_TURNO, SECCAO, + LOCAL_TRABALHO, TAREFA, SUBSTANCIAS, SUPERIOR_HIERARQUICO, CONDICOES, + TESTEMUNHAS, DESCRICAO, CONCLUSOES, ACCOES, HORA_ACIDENTE, FORMACAO_SHST, + FORMACAO_SHST_NAO_PORQUE, OUTROS_ACIDENTES_COM_COLABORADOR, + NR_ACIDENTES_COM_COLABORADOR, NR_RELATORIO_ACIDENTE_COLABORADOR1, + NR_RELATORIO_ACIDENTE_COLABORADOR2, NR_RELATORIO_ACIDENTE_COLABORADOR3, + NR_RELATORIO_ACIDENTE_COLABORADOR4, ACIDENTES_OUTROS_COLABORADORES, + NR_ACIDENTES_OUTROS_COLABORADORES, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, + NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, LESAO_CABECA, LESAO_PESCOCO, + LESAO_TRONCO, LESAO_MEMBRO_SUP_DIR, LESAO_MEMBRO_SUP_ESQ, + LESAO_MEMBRO_INF_DIR, LESAO_MEMBRO_INF_ESQ, ESPECIF1, ESPECIF2, ESPECIF3, + ESPECIF4, TIPO_INCAPACIDADE, COEF_INCAPACIDADE, DATA_AVAL_INCAPACIDADE, + DATA_REV_INCAPACIDADE, PERIODO_INCAPACIDADE_DE, PERIODO_INCAPACIDADE_A, + IMG_FLEXAO, IMG_EXT1, IMG_EXT2, IMG_CAB2, IMG_CAB3, IMG_MA2, IMG_MA3, IMG_MA5, IMG_MA6, + IMG_MA8, IMG_MA10, RESTRICAO_CARGA, RESTRICAO_MOTRICIDADE, RESTRICAO_CONDUCAO, + RESTRICAO_VIBRACOES, RESTRICAO_OUTRAS, MED_OBSERV, TIPO_LESAO, IMG_ROT1, + IMG_ROT2, IMG_CAB1, IMG_CAB4, IMG_MA1, IMG_MA4, IMG_MA7, IMG_MA9, EMPRESA_ID, + MEDICO_ID, TECNICO_SAUDE_ID, ANALISE_NR, ESTADO_ASSINATURA, ASS_RESP_SEG, + ASS_RESP_RH, DATA_CONSOLIDACAO, DATA_ASSINATURA_SEG, DATA_ASSINATURA_RH, + ASS_CONSOLIDACAO, NOME_RESP_SEG, NOME_RESP_RH, CAUSAS, ESTADO_ANTES_CORRECAO, + OBSERVACOES_CORRECAO, CORRECAO, ASS_SUPERIOR, NOME_SUPERIOR, + DATA_ASSINATURA_SUPERIOR, AVERIGUADOR, AVERIGUACAO_POSTERIOR, + AVERIGUACAO_OBS, NOME_RESP_CONSOLIDACAO, DATA_INICIO_PROCESSO, + DEPARTAMENTO_ID, SECCAO_ID, RH_FASE4, APAGADA, CONCLUIDO_POR_DESACTIVACAO, + DATA_DESACTIVACAO, COMENTARIO_DESACTIVACAO, PARTICIPADO, + NOME_RESPONSAVEL_PARTICIPACAO, DATA_PARTICIPACAO, }; + + private Integer id; + private java.util.Date data_acidente; + private Integer acidentado_id; + private db.data.siprp.outer.AcidentadosData to_acidentado_id; + private Integer estado; + private Integer estabelecimento_id; + private Integer horas_turno; + private String seccao; + private String local_trabalho; + private String tarefa; + private String substancias; + private String superior_hierarquico; + private String condicoes; + private String testemunhas; + private String descricao; + private String conclusoes; + private String accoes; + private java.sql.Time hora_acidente; + private String formacao_shst; + private String formacao_shst_nao_porque; + private String outros_acidentes_com_colaborador; + private Integer nr_acidentes_com_colaborador; + private Integer nr_relatorio_acidente_colaborador1; + private Integer nr_relatorio_acidente_colaborador2; + private Integer nr_relatorio_acidente_colaborador3; + private Integer nr_relatorio_acidente_colaborador4; + private String acidentes_outros_colaboradores; + private Integer nr_acidentes_outros_colaboradores; + private Integer nr_relatorio_acidente_outros_colaboradores1; + private Integer nr_relatorio_acidente_outros_colaboradores2; + private Integer nr_relatorio_acidente_outros_colaboradores3; + private Integer nr_relatorio_acidente_outros_colaboradores4; + private String lesao_cabeca; + private String lesao_pescoco; + private String lesao_tronco; + private String lesao_membro_sup_dir; + private String lesao_membro_sup_esq; + private String lesao_membro_inf_dir; + private String lesao_membro_inf_esq; + private String especif1; + private String especif2; + private String especif3; + private String especif4; + private String tipo_incapacidade; + private Integer coef_incapacidade; + private java.util.Date data_aval_incapacidade; + private java.util.Date data_rev_incapacidade; + private java.util.Date periodo_incapacidade_de; + private java.util.Date periodo_incapacidade_a; + private String img_flexao; + private String img_ext1; + private String img_ext2; + private String img_cab2; + private String img_cab3; + private String img_ma2; + private String img_ma3; + private String img_ma5; + private String img_ma6; + private String img_ma8; + private String img_ma10; + private Integer restricao_carga; + private String restricao_motricidade; + private String restricao_conducao; + private String restricao_vibracoes; + private String restricao_outras; + private String med_observ; + private String tipo_lesao; + private String img_rot1; + private String img_rot2; + private String img_cab1; + private String img_cab4; + private String img_ma1; + private String img_ma4; + private String img_ma7; + private String img_ma9; + private Integer empresa_id; + private Integer medico_id; + private Integer tecnico_saude_id; + private String analise_nr; + private Integer estado_assinatura; + private String ass_resp_seg; + private String ass_resp_rh; + private java.util.Date data_consolidacao; + private java.util.Date data_assinatura_seg; + private java.util.Date data_assinatura_rh; + private String ass_consolidacao; + private String nome_resp_seg; + private String nome_resp_rh; + private Integer causas; + private Integer estado_antes_correcao; + private String observacoes_correcao; + private String correcao; + private String ass_superior; + private String nome_superior; + private java.util.Date data_assinatura_superior; + private String averiguador; + private String averiguacao_posterior; + private String averiguacao_obs; + private String nome_resp_consolidacao; + private java.util.Date data_inicio_processo; + private Integer departamento_id; + private db.data.siprp.outer.DepartamentosData to_departamento_id; + private Integer seccao_id; + private db.data.siprp.outer.SeccoesData to_seccao_id; + private Integer rh_fase4; + private String apagada; + private Boolean concluido_por_desactivacao; + private java.util.Date data_desactivacao; + private String comentario_desactivacao; + private String participado; + private String nome_responsavel_participacao; + private java.util.Date data_participacao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public AnalisesAcidentes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromMedidas_analise_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.MedidasData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.MedidasData.class , getPrimaryKey().getMap().get("id"), "analise_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromRecomendacoes_analise_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.RecomendacoesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.RecomendacoesData.class , getPrimaryKey().getMap().get("id"), "analise_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.Date getData_acidente() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ACIDENTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_acidente; + } + + public void setData_acidente( java.util.Date data_acidente ) + { + try + { + preProcess( DATA_ACIDENTE, data_acidente ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_acidente = data_acidente; + LAZY_LOADED_OBJECTS.put( DATA_ACIDENTE, Boolean.TRUE ); + } + + public Integer getAcidentado_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACIDENTADO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.acidentado_id; + } + + public void setAcidentado_id( Integer acidentado_id ) + { + try + { + preProcess( ACIDENTADO_ID, acidentado_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.acidentado_id = acidentado_id; + LAZY_LOADED_OBJECTS.put( ACIDENTADO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.AcidentadosData toAcidentado_id() + { + try + { + prepare( TO_ACIDENTADO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_acidentado_id; + } + + public void setToAcidentado_id( db.data.siprp.outer.AcidentadosData to_acidentado_id ) + { + try + { + preProcess( TO_ACIDENTADO_ID, to_acidentado_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_acidentado_id = to_acidentado_id; + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public Integer getHoras_turno() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HORAS_TURNO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.horas_turno; + } + + public void setHoras_turno( Integer horas_turno ) + { + try + { + preProcess( HORAS_TURNO, horas_turno ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.horas_turno = horas_turno; + LAZY_LOADED_OBJECTS.put( HORAS_TURNO, Boolean.TRUE ); + } + + public String getSeccao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SECCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.seccao; + } + + public void setSeccao( String seccao ) + { + try + { + preProcess( SECCAO, seccao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.seccao = seccao; + LAZY_LOADED_OBJECTS.put( SECCAO, Boolean.TRUE ); + } + + public String getLocal_trabalho() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCAL_TRABALHO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.local_trabalho; + } + + public void setLocal_trabalho( String local_trabalho ) + { + try + { + preProcess( LOCAL_TRABALHO, local_trabalho ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.local_trabalho = local_trabalho; + LAZY_LOADED_OBJECTS.put( LOCAL_TRABALHO, Boolean.TRUE ); + } + + public String getTarefa() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TAREFA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tarefa; + } + + public void setTarefa( String tarefa ) + { + try + { + preProcess( TAREFA, tarefa ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tarefa = tarefa; + LAZY_LOADED_OBJECTS.put( TAREFA, Boolean.TRUE ); + } + + public String getSubstancias() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SUBSTANCIAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.substancias; + } + + public void setSubstancias( String substancias ) + { + try + { + preProcess( SUBSTANCIAS, substancias ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.substancias = substancias; + LAZY_LOADED_OBJECTS.put( SUBSTANCIAS, Boolean.TRUE ); + } + + public String getSuperior_hierarquico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SUPERIOR_HIERARQUICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.superior_hierarquico; + } + + public void setSuperior_hierarquico( String superior_hierarquico ) + { + try + { + preProcess( SUPERIOR_HIERARQUICO, superior_hierarquico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.superior_hierarquico = superior_hierarquico; + LAZY_LOADED_OBJECTS.put( SUPERIOR_HIERARQUICO, Boolean.TRUE ); + } + + public String getCondicoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONDICOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.condicoes; + } + + public void setCondicoes( String condicoes ) + { + try + { + preProcess( CONDICOES, condicoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.condicoes = condicoes; + LAZY_LOADED_OBJECTS.put( CONDICOES, Boolean.TRUE ); + } + + public String getTestemunhas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TESTEMUNHAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.testemunhas; + } + + public void setTestemunhas( String testemunhas ) + { + try + { + preProcess( TESTEMUNHAS, testemunhas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.testemunhas = testemunhas; + LAZY_LOADED_OBJECTS.put( TESTEMUNHAS, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getConclusoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONCLUSOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.conclusoes; + } + + public void setConclusoes( String conclusoes ) + { + try + { + preProcess( CONCLUSOES, conclusoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.conclusoes = conclusoes; + LAZY_LOADED_OBJECTS.put( CONCLUSOES, Boolean.TRUE ); + } + + public String getAccoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACCOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.accoes; + } + + public void setAccoes( String accoes ) + { + try + { + preProcess( ACCOES, accoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.accoes = accoes; + LAZY_LOADED_OBJECTS.put( ACCOES, Boolean.TRUE ); + } + + public java.sql.Time getHora_acidente() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HORA_ACIDENTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hora_acidente; + } + + public void setHora_acidente( java.sql.Time hora_acidente ) + { + try + { + preProcess( HORA_ACIDENTE, hora_acidente ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hora_acidente = hora_acidente; + LAZY_LOADED_OBJECTS.put( HORA_ACIDENTE, Boolean.TRUE ); + } + + public String getFormacao_shst() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMACAO_SHST ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formacao_shst; + } + + public void setFormacao_shst( String formacao_shst ) + { + try + { + preProcess( FORMACAO_SHST, formacao_shst ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formacao_shst = formacao_shst; + LAZY_LOADED_OBJECTS.put( FORMACAO_SHST, Boolean.TRUE ); + } + + public String getFormacao_shst_nao_porque() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMACAO_SHST_NAO_PORQUE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formacao_shst_nao_porque; + } + + public void setFormacao_shst_nao_porque( String formacao_shst_nao_porque ) + { + try + { + preProcess( FORMACAO_SHST_NAO_PORQUE, formacao_shst_nao_porque ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formacao_shst_nao_porque = formacao_shst_nao_porque; + LAZY_LOADED_OBJECTS.put( FORMACAO_SHST_NAO_PORQUE, Boolean.TRUE ); + } + + public String getOutros_acidentes_com_colaborador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTROS_ACIDENTES_COM_COLABORADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outros_acidentes_com_colaborador; + } + + public void setOutros_acidentes_com_colaborador( String outros_acidentes_com_colaborador ) + { + try + { + preProcess( OUTROS_ACIDENTES_COM_COLABORADOR, outros_acidentes_com_colaborador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outros_acidentes_com_colaborador = outros_acidentes_com_colaborador; + LAZY_LOADED_OBJECTS.put( OUTROS_ACIDENTES_COM_COLABORADOR, Boolean.TRUE ); + } + + public Integer getNr_acidentes_com_colaborador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_ACIDENTES_COM_COLABORADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_acidentes_com_colaborador; + } + + public void setNr_acidentes_com_colaborador( Integer nr_acidentes_com_colaborador ) + { + try + { + preProcess( NR_ACIDENTES_COM_COLABORADOR, nr_acidentes_com_colaborador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_acidentes_com_colaborador = nr_acidentes_com_colaborador; + LAZY_LOADED_OBJECTS.put( NR_ACIDENTES_COM_COLABORADOR, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_colaborador1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_COLABORADOR1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_colaborador1; + } + + public void setNr_relatorio_acidente_colaborador1( Integer nr_relatorio_acidente_colaborador1 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_COLABORADOR1, nr_relatorio_acidente_colaborador1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_colaborador1 = nr_relatorio_acidente_colaborador1; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_COLABORADOR1, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_colaborador2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_COLABORADOR2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_colaborador2; + } + + public void setNr_relatorio_acidente_colaborador2( Integer nr_relatorio_acidente_colaborador2 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_COLABORADOR2, nr_relatorio_acidente_colaborador2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_colaborador2 = nr_relatorio_acidente_colaborador2; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_COLABORADOR2, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_colaborador3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_COLABORADOR3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_colaborador3; + } + + public void setNr_relatorio_acidente_colaborador3( Integer nr_relatorio_acidente_colaborador3 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_COLABORADOR3, nr_relatorio_acidente_colaborador3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_colaborador3 = nr_relatorio_acidente_colaborador3; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_COLABORADOR3, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_colaborador4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_COLABORADOR4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_colaborador4; + } + + public void setNr_relatorio_acidente_colaborador4( Integer nr_relatorio_acidente_colaborador4 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_COLABORADOR4, nr_relatorio_acidente_colaborador4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_colaborador4 = nr_relatorio_acidente_colaborador4; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_COLABORADOR4, Boolean.TRUE ); + } + + public String getAcidentes_outros_colaboradores() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACIDENTES_OUTROS_COLABORADORES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.acidentes_outros_colaboradores; + } + + public void setAcidentes_outros_colaboradores( String acidentes_outros_colaboradores ) + { + try + { + preProcess( ACIDENTES_OUTROS_COLABORADORES, acidentes_outros_colaboradores ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.acidentes_outros_colaboradores = acidentes_outros_colaboradores; + LAZY_LOADED_OBJECTS.put( ACIDENTES_OUTROS_COLABORADORES, Boolean.TRUE ); + } + + public Integer getNr_acidentes_outros_colaboradores() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_ACIDENTES_OUTROS_COLABORADORES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_acidentes_outros_colaboradores; + } + + public void setNr_acidentes_outros_colaboradores( Integer nr_acidentes_outros_colaboradores ) + { + try + { + preProcess( NR_ACIDENTES_OUTROS_COLABORADORES, nr_acidentes_outros_colaboradores ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_acidentes_outros_colaboradores = nr_acidentes_outros_colaboradores; + LAZY_LOADED_OBJECTS.put( NR_ACIDENTES_OUTROS_COLABORADORES, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_outros_colaboradores1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_outros_colaboradores1; + } + + public void setNr_relatorio_acidente_outros_colaboradores1( Integer nr_relatorio_acidente_outros_colaboradores1 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, nr_relatorio_acidente_outros_colaboradores1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_outros_colaboradores1 = nr_relatorio_acidente_outros_colaboradores1; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_outros_colaboradores2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_outros_colaboradores2; + } + + public void setNr_relatorio_acidente_outros_colaboradores2( Integer nr_relatorio_acidente_outros_colaboradores2 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, nr_relatorio_acidente_outros_colaboradores2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_outros_colaboradores2 = nr_relatorio_acidente_outros_colaboradores2; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_outros_colaboradores3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_outros_colaboradores3; + } + + public void setNr_relatorio_acidente_outros_colaboradores3( Integer nr_relatorio_acidente_outros_colaboradores3 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, nr_relatorio_acidente_outros_colaboradores3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_outros_colaboradores3 = nr_relatorio_acidente_outros_colaboradores3; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3, Boolean.TRUE ); + } + + public Integer getNr_relatorio_acidente_outros_colaboradores4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nr_relatorio_acidente_outros_colaboradores4; + } + + public void setNr_relatorio_acidente_outros_colaboradores4( Integer nr_relatorio_acidente_outros_colaboradores4 ) + { + try + { + preProcess( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, nr_relatorio_acidente_outros_colaboradores4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nr_relatorio_acidente_outros_colaboradores4 = nr_relatorio_acidente_outros_colaboradores4; + LAZY_LOADED_OBJECTS.put( NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4, Boolean.TRUE ); + } + + public String getLesao_cabeca() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_CABECA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_cabeca; + } + + public void setLesao_cabeca( String lesao_cabeca ) + { + try + { + preProcess( LESAO_CABECA, lesao_cabeca ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_cabeca = lesao_cabeca; + LAZY_LOADED_OBJECTS.put( LESAO_CABECA, Boolean.TRUE ); + } + + public String getLesao_pescoco() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_PESCOCO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_pescoco; + } + + public void setLesao_pescoco( String lesao_pescoco ) + { + try + { + preProcess( LESAO_PESCOCO, lesao_pescoco ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_pescoco = lesao_pescoco; + LAZY_LOADED_OBJECTS.put( LESAO_PESCOCO, Boolean.TRUE ); + } + + public String getLesao_tronco() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_TRONCO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_tronco; + } + + public void setLesao_tronco( String lesao_tronco ) + { + try + { + preProcess( LESAO_TRONCO, lesao_tronco ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_tronco = lesao_tronco; + LAZY_LOADED_OBJECTS.put( LESAO_TRONCO, Boolean.TRUE ); + } + + public String getLesao_membro_sup_dir() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_MEMBRO_SUP_DIR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_membro_sup_dir; + } + + public void setLesao_membro_sup_dir( String lesao_membro_sup_dir ) + { + try + { + preProcess( LESAO_MEMBRO_SUP_DIR, lesao_membro_sup_dir ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_membro_sup_dir = lesao_membro_sup_dir; + LAZY_LOADED_OBJECTS.put( LESAO_MEMBRO_SUP_DIR, Boolean.TRUE ); + } + + public String getLesao_membro_sup_esq() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_MEMBRO_SUP_ESQ ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_membro_sup_esq; + } + + public void setLesao_membro_sup_esq( String lesao_membro_sup_esq ) + { + try + { + preProcess( LESAO_MEMBRO_SUP_ESQ, lesao_membro_sup_esq ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_membro_sup_esq = lesao_membro_sup_esq; + LAZY_LOADED_OBJECTS.put( LESAO_MEMBRO_SUP_ESQ, Boolean.TRUE ); + } + + public String getLesao_membro_inf_dir() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_MEMBRO_INF_DIR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_membro_inf_dir; + } + + public void setLesao_membro_inf_dir( String lesao_membro_inf_dir ) + { + try + { + preProcess( LESAO_MEMBRO_INF_DIR, lesao_membro_inf_dir ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_membro_inf_dir = lesao_membro_inf_dir; + LAZY_LOADED_OBJECTS.put( LESAO_MEMBRO_INF_DIR, Boolean.TRUE ); + } + + public String getLesao_membro_inf_esq() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LESAO_MEMBRO_INF_ESQ ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.lesao_membro_inf_esq; + } + + public void setLesao_membro_inf_esq( String lesao_membro_inf_esq ) + { + try + { + preProcess( LESAO_MEMBRO_INF_ESQ, lesao_membro_inf_esq ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.lesao_membro_inf_esq = lesao_membro_inf_esq; + LAZY_LOADED_OBJECTS.put( LESAO_MEMBRO_INF_ESQ, Boolean.TRUE ); + } + + public String getEspecif1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESPECIF1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.especif1; + } + + public void setEspecif1( String especif1 ) + { + try + { + preProcess( ESPECIF1, especif1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.especif1 = especif1; + LAZY_LOADED_OBJECTS.put( ESPECIF1, Boolean.TRUE ); + } + + public String getEspecif2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESPECIF2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.especif2; + } + + public void setEspecif2( String especif2 ) + { + try + { + preProcess( ESPECIF2, especif2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.especif2 = especif2; + LAZY_LOADED_OBJECTS.put( ESPECIF2, Boolean.TRUE ); + } + + public String getEspecif3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESPECIF3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.especif3; + } + + public void setEspecif3( String especif3 ) + { + try + { + preProcess( ESPECIF3, especif3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.especif3 = especif3; + LAZY_LOADED_OBJECTS.put( ESPECIF3, Boolean.TRUE ); + } + + public String getEspecif4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESPECIF4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.especif4; + } + + public void setEspecif4( String especif4 ) + { + try + { + preProcess( ESPECIF4, especif4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.especif4 = especif4; + LAZY_LOADED_OBJECTS.put( ESPECIF4, Boolean.TRUE ); + } + + public String getTipo_incapacidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_INCAPACIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_incapacidade; + } + + public void setTipo_incapacidade( String tipo_incapacidade ) + { + try + { + preProcess( TIPO_INCAPACIDADE, tipo_incapacidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_incapacidade = tipo_incapacidade; + LAZY_LOADED_OBJECTS.put( TIPO_INCAPACIDADE, Boolean.TRUE ); + } + + public Integer getCoef_incapacidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( COEF_INCAPACIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.coef_incapacidade; + } + + public void setCoef_incapacidade( Integer coef_incapacidade ) + { + try + { + preProcess( COEF_INCAPACIDADE, coef_incapacidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.coef_incapacidade = coef_incapacidade; + LAZY_LOADED_OBJECTS.put( COEF_INCAPACIDADE, Boolean.TRUE ); + } + + public java.util.Date getData_aval_incapacidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_AVAL_INCAPACIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_aval_incapacidade; + } + + public void setData_aval_incapacidade( java.util.Date data_aval_incapacidade ) + { + try + { + preProcess( DATA_AVAL_INCAPACIDADE, data_aval_incapacidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_aval_incapacidade = data_aval_incapacidade; + LAZY_LOADED_OBJECTS.put( DATA_AVAL_INCAPACIDADE, Boolean.TRUE ); + } + + public java.util.Date getData_rev_incapacidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_REV_INCAPACIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_rev_incapacidade; + } + + public void setData_rev_incapacidade( java.util.Date data_rev_incapacidade ) + { + try + { + preProcess( DATA_REV_INCAPACIDADE, data_rev_incapacidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_rev_incapacidade = data_rev_incapacidade; + LAZY_LOADED_OBJECTS.put( DATA_REV_INCAPACIDADE, Boolean.TRUE ); + } + + public java.util.Date getPeriodo_incapacidade_de() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERIODO_INCAPACIDADE_DE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.periodo_incapacidade_de; + } + + public void setPeriodo_incapacidade_de( java.util.Date periodo_incapacidade_de ) + { + try + { + preProcess( PERIODO_INCAPACIDADE_DE, periodo_incapacidade_de ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.periodo_incapacidade_de = periodo_incapacidade_de; + LAZY_LOADED_OBJECTS.put( PERIODO_INCAPACIDADE_DE, Boolean.TRUE ); + } + + public java.util.Date getPeriodo_incapacidade_a() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERIODO_INCAPACIDADE_A ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.periodo_incapacidade_a; + } + + public void setPeriodo_incapacidade_a( java.util.Date periodo_incapacidade_a ) + { + try + { + preProcess( PERIODO_INCAPACIDADE_A, periodo_incapacidade_a ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.periodo_incapacidade_a = periodo_incapacidade_a; + LAZY_LOADED_OBJECTS.put( PERIODO_INCAPACIDADE_A, Boolean.TRUE ); + } + + public String getImg_flexao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_FLEXAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_flexao; + } + + public void setImg_flexao( String img_flexao ) + { + try + { + preProcess( IMG_FLEXAO, img_flexao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_flexao = img_flexao; + LAZY_LOADED_OBJECTS.put( IMG_FLEXAO, Boolean.TRUE ); + } + + public String getImg_ext1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_EXT1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ext1; + } + + public void setImg_ext1( String img_ext1 ) + { + try + { + preProcess( IMG_EXT1, img_ext1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ext1 = img_ext1; + LAZY_LOADED_OBJECTS.put( IMG_EXT1, Boolean.TRUE ); + } + + public String getImg_ext2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_EXT2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ext2; + } + + public void setImg_ext2( String img_ext2 ) + { + try + { + preProcess( IMG_EXT2, img_ext2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ext2 = img_ext2; + LAZY_LOADED_OBJECTS.put( IMG_EXT2, Boolean.TRUE ); + } + + public String getImg_cab2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_CAB2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_cab2; + } + + public void setImg_cab2( String img_cab2 ) + { + try + { + preProcess( IMG_CAB2, img_cab2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_cab2 = img_cab2; + LAZY_LOADED_OBJECTS.put( IMG_CAB2, Boolean.TRUE ); + } + + public String getImg_cab3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_CAB3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_cab3; + } + + public void setImg_cab3( String img_cab3 ) + { + try + { + preProcess( IMG_CAB3, img_cab3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_cab3 = img_cab3; + LAZY_LOADED_OBJECTS.put( IMG_CAB3, Boolean.TRUE ); + } + + public String getImg_ma2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma2; + } + + public void setImg_ma2( String img_ma2 ) + { + try + { + preProcess( IMG_MA2, img_ma2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma2 = img_ma2; + LAZY_LOADED_OBJECTS.put( IMG_MA2, Boolean.TRUE ); + } + + public String getImg_ma3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma3; + } + + public void setImg_ma3( String img_ma3 ) + { + try + { + preProcess( IMG_MA3, img_ma3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma3 = img_ma3; + LAZY_LOADED_OBJECTS.put( IMG_MA3, Boolean.TRUE ); + } + + public String getImg_ma5() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA5 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma5; + } + + public void setImg_ma5( String img_ma5 ) + { + try + { + preProcess( IMG_MA5, img_ma5 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma5 = img_ma5; + LAZY_LOADED_OBJECTS.put( IMG_MA5, Boolean.TRUE ); + } + + public String getImg_ma6() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA6 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma6; + } + + public void setImg_ma6( String img_ma6 ) + { + try + { + preProcess( IMG_MA6, img_ma6 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma6 = img_ma6; + LAZY_LOADED_OBJECTS.put( IMG_MA6, Boolean.TRUE ); + } + + public String getImg_ma8() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA8 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma8; + } + + public void setImg_ma8( String img_ma8 ) + { + try + { + preProcess( IMG_MA8, img_ma8 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma8 = img_ma8; + LAZY_LOADED_OBJECTS.put( IMG_MA8, Boolean.TRUE ); + } + + public String getImg_ma10() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA10 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma10; + } + + public void setImg_ma10( String img_ma10 ) + { + try + { + preProcess( IMG_MA10, img_ma10 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma10 = img_ma10; + LAZY_LOADED_OBJECTS.put( IMG_MA10, Boolean.TRUE ); + } + + public Integer getRestricao_carga() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESTRICAO_CARGA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.restricao_carga; + } + + public void setRestricao_carga( Integer restricao_carga ) + { + try + { + preProcess( RESTRICAO_CARGA, restricao_carga ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.restricao_carga = restricao_carga; + LAZY_LOADED_OBJECTS.put( RESTRICAO_CARGA, Boolean.TRUE ); + } + + public String getRestricao_motricidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESTRICAO_MOTRICIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.restricao_motricidade; + } + + public void setRestricao_motricidade( String restricao_motricidade ) + { + try + { + preProcess( RESTRICAO_MOTRICIDADE, restricao_motricidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.restricao_motricidade = restricao_motricidade; + LAZY_LOADED_OBJECTS.put( RESTRICAO_MOTRICIDADE, Boolean.TRUE ); + } + + public String getRestricao_conducao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESTRICAO_CONDUCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.restricao_conducao; + } + + public void setRestricao_conducao( String restricao_conducao ) + { + try + { + preProcess( RESTRICAO_CONDUCAO, restricao_conducao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.restricao_conducao = restricao_conducao; + LAZY_LOADED_OBJECTS.put( RESTRICAO_CONDUCAO, Boolean.TRUE ); + } + + public String getRestricao_vibracoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESTRICAO_VIBRACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.restricao_vibracoes; + } + + public void setRestricao_vibracoes( String restricao_vibracoes ) + { + try + { + preProcess( RESTRICAO_VIBRACOES, restricao_vibracoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.restricao_vibracoes = restricao_vibracoes; + LAZY_LOADED_OBJECTS.put( RESTRICAO_VIBRACOES, Boolean.TRUE ); + } + + public String getRestricao_outras() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESTRICAO_OUTRAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.restricao_outras; + } + + public void setRestricao_outras( String restricao_outras ) + { + try + { + preProcess( RESTRICAO_OUTRAS, restricao_outras ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.restricao_outras = restricao_outras; + LAZY_LOADED_OBJECTS.put( RESTRICAO_OUTRAS, Boolean.TRUE ); + } + + public String getMed_observ() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MED_OBSERV ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.med_observ; + } + + public void setMed_observ( String med_observ ) + { + try + { + preProcess( MED_OBSERV, med_observ ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.med_observ = med_observ; + LAZY_LOADED_OBJECTS.put( MED_OBSERV, Boolean.TRUE ); + } + + public String getTipo_lesao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_LESAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_lesao; + } + + public void setTipo_lesao( String tipo_lesao ) + { + try + { + preProcess( TIPO_LESAO, tipo_lesao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_lesao = tipo_lesao; + LAZY_LOADED_OBJECTS.put( TIPO_LESAO, Boolean.TRUE ); + } + + public String getImg_rot1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_ROT1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_rot1; + } + + public void setImg_rot1( String img_rot1 ) + { + try + { + preProcess( IMG_ROT1, img_rot1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_rot1 = img_rot1; + LAZY_LOADED_OBJECTS.put( IMG_ROT1, Boolean.TRUE ); + } + + public String getImg_rot2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_ROT2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_rot2; + } + + public void setImg_rot2( String img_rot2 ) + { + try + { + preProcess( IMG_ROT2, img_rot2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_rot2 = img_rot2; + LAZY_LOADED_OBJECTS.put( IMG_ROT2, Boolean.TRUE ); + } + + public String getImg_cab1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_CAB1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_cab1; + } + + public void setImg_cab1( String img_cab1 ) + { + try + { + preProcess( IMG_CAB1, img_cab1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_cab1 = img_cab1; + LAZY_LOADED_OBJECTS.put( IMG_CAB1, Boolean.TRUE ); + } + + public String getImg_cab4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_CAB4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_cab4; + } + + public void setImg_cab4( String img_cab4 ) + { + try + { + preProcess( IMG_CAB4, img_cab4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_cab4 = img_cab4; + LAZY_LOADED_OBJECTS.put( IMG_CAB4, Boolean.TRUE ); + } + + public String getImg_ma1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma1; + } + + public void setImg_ma1( String img_ma1 ) + { + try + { + preProcess( IMG_MA1, img_ma1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma1 = img_ma1; + LAZY_LOADED_OBJECTS.put( IMG_MA1, Boolean.TRUE ); + } + + public String getImg_ma4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma4; + } + + public void setImg_ma4( String img_ma4 ) + { + try + { + preProcess( IMG_MA4, img_ma4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma4 = img_ma4; + LAZY_LOADED_OBJECTS.put( IMG_MA4, Boolean.TRUE ); + } + + public String getImg_ma7() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA7 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma7; + } + + public void setImg_ma7( String img_ma7 ) + { + try + { + preProcess( IMG_MA7, img_ma7 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma7 = img_ma7; + LAZY_LOADED_OBJECTS.put( IMG_MA7, Boolean.TRUE ); + } + + public String getImg_ma9() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMG_MA9 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.img_ma9; + } + + public void setImg_ma9( String img_ma9 ) + { + try + { + preProcess( IMG_MA9, img_ma9 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.img_ma9 = img_ma9; + LAZY_LOADED_OBJECTS.put( IMG_MA9, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public Integer getTecnico_saude_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_SAUDE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_saude_id; + } + + public void setTecnico_saude_id( Integer tecnico_saude_id ) + { + try + { + preProcess( TECNICO_SAUDE_ID, tecnico_saude_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_saude_id = tecnico_saude_id; + LAZY_LOADED_OBJECTS.put( TECNICO_SAUDE_ID, Boolean.TRUE ); + } + + public String getAnalise_nr() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISE_NR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analise_nr; + } + + public void setAnalise_nr( String analise_nr ) + { + try + { + preProcess( ANALISE_NR, analise_nr ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analise_nr = analise_nr; + LAZY_LOADED_OBJECTS.put( ANALISE_NR, Boolean.TRUE ); + } + + public Integer getEstado_assinatura() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO_ASSINATURA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado_assinatura; + } + + public void setEstado_assinatura( Integer estado_assinatura ) + { + try + { + preProcess( ESTADO_ASSINATURA, estado_assinatura ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado_assinatura = estado_assinatura; + LAZY_LOADED_OBJECTS.put( ESTADO_ASSINATURA, Boolean.TRUE ); + } + + public String getAss_resp_seg() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ASS_RESP_SEG ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ass_resp_seg; + } + + public void setAss_resp_seg( String ass_resp_seg ) + { + try + { + preProcess( ASS_RESP_SEG, ass_resp_seg ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ass_resp_seg = ass_resp_seg; + LAZY_LOADED_OBJECTS.put( ASS_RESP_SEG, Boolean.TRUE ); + } + + public String getAss_resp_rh() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ASS_RESP_RH ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ass_resp_rh; + } + + public void setAss_resp_rh( String ass_resp_rh ) + { + try + { + preProcess( ASS_RESP_RH, ass_resp_rh ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ass_resp_rh = ass_resp_rh; + LAZY_LOADED_OBJECTS.put( ASS_RESP_RH, Boolean.TRUE ); + } + + public java.util.Date getData_consolidacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_CONSOLIDACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_consolidacao; + } + + public void setData_consolidacao( java.util.Date data_consolidacao ) + { + try + { + preProcess( DATA_CONSOLIDACAO, data_consolidacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_consolidacao = data_consolidacao; + LAZY_LOADED_OBJECTS.put( DATA_CONSOLIDACAO, Boolean.TRUE ); + } + + public java.util.Date getData_assinatura_seg() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ASSINATURA_SEG ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_assinatura_seg; + } + + public void setData_assinatura_seg( java.util.Date data_assinatura_seg ) + { + try + { + preProcess( DATA_ASSINATURA_SEG, data_assinatura_seg ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_assinatura_seg = data_assinatura_seg; + LAZY_LOADED_OBJECTS.put( DATA_ASSINATURA_SEG, Boolean.TRUE ); + } + + public java.util.Date getData_assinatura_rh() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ASSINATURA_RH ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_assinatura_rh; + } + + public void setData_assinatura_rh( java.util.Date data_assinatura_rh ) + { + try + { + preProcess( DATA_ASSINATURA_RH, data_assinatura_rh ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_assinatura_rh = data_assinatura_rh; + LAZY_LOADED_OBJECTS.put( DATA_ASSINATURA_RH, Boolean.TRUE ); + } + + public String getAss_consolidacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ASS_CONSOLIDACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ass_consolidacao; + } + + public void setAss_consolidacao( String ass_consolidacao ) + { + try + { + preProcess( ASS_CONSOLIDACAO, ass_consolidacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ass_consolidacao = ass_consolidacao; + LAZY_LOADED_OBJECTS.put( ASS_CONSOLIDACAO, Boolean.TRUE ); + } + + public String getNome_resp_seg() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_RESP_SEG ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_resp_seg; + } + + public void setNome_resp_seg( String nome_resp_seg ) + { + try + { + preProcess( NOME_RESP_SEG, nome_resp_seg ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_resp_seg = nome_resp_seg; + LAZY_LOADED_OBJECTS.put( NOME_RESP_SEG, Boolean.TRUE ); + } + + public String getNome_resp_rh() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_RESP_RH ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_resp_rh; + } + + public void setNome_resp_rh( String nome_resp_rh ) + { + try + { + preProcess( NOME_RESP_RH, nome_resp_rh ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_resp_rh = nome_resp_rh; + LAZY_LOADED_OBJECTS.put( NOME_RESP_RH, Boolean.TRUE ); + } + + public Integer getCausas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAUSAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.causas; + } + + public void setCausas( Integer causas ) + { + try + { + preProcess( CAUSAS, causas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.causas = causas; + LAZY_LOADED_OBJECTS.put( CAUSAS, Boolean.TRUE ); + } + + public Integer getEstado_antes_correcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO_ANTES_CORRECAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado_antes_correcao; + } + + public void setEstado_antes_correcao( Integer estado_antes_correcao ) + { + try + { + preProcess( ESTADO_ANTES_CORRECAO, estado_antes_correcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado_antes_correcao = estado_antes_correcao; + LAZY_LOADED_OBJECTS.put( ESTADO_ANTES_CORRECAO, Boolean.TRUE ); + } + + public String getObservacoes_correcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES_CORRECAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes_correcao; + } + + public void setObservacoes_correcao( String observacoes_correcao ) + { + try + { + preProcess( OBSERVACOES_CORRECAO, observacoes_correcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes_correcao = observacoes_correcao; + LAZY_LOADED_OBJECTS.put( OBSERVACOES_CORRECAO, Boolean.TRUE ); + } + + public String getCorrecao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CORRECAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.correcao; + } + + public void setCorrecao( String correcao ) + { + try + { + preProcess( CORRECAO, correcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.correcao = correcao; + LAZY_LOADED_OBJECTS.put( CORRECAO, Boolean.TRUE ); + } + + public String getAss_superior() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ASS_SUPERIOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ass_superior; + } + + public void setAss_superior( String ass_superior ) + { + try + { + preProcess( ASS_SUPERIOR, ass_superior ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ass_superior = ass_superior; + LAZY_LOADED_OBJECTS.put( ASS_SUPERIOR, Boolean.TRUE ); + } + + public String getNome_superior() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_SUPERIOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_superior; + } + + public void setNome_superior( String nome_superior ) + { + try + { + preProcess( NOME_SUPERIOR, nome_superior ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_superior = nome_superior; + LAZY_LOADED_OBJECTS.put( NOME_SUPERIOR, Boolean.TRUE ); + } + + public java.util.Date getData_assinatura_superior() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ASSINATURA_SUPERIOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_assinatura_superior; + } + + public void setData_assinatura_superior( java.util.Date data_assinatura_superior ) + { + try + { + preProcess( DATA_ASSINATURA_SUPERIOR, data_assinatura_superior ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_assinatura_superior = data_assinatura_superior; + LAZY_LOADED_OBJECTS.put( DATA_ASSINATURA_SUPERIOR, Boolean.TRUE ); + } + + public String getAveriguador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AVERIGUADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.averiguador; + } + + public void setAveriguador( String averiguador ) + { + try + { + preProcess( AVERIGUADOR, averiguador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.averiguador = averiguador; + LAZY_LOADED_OBJECTS.put( AVERIGUADOR, Boolean.TRUE ); + } + + public String getAveriguacao_posterior() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AVERIGUACAO_POSTERIOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.averiguacao_posterior; + } + + public void setAveriguacao_posterior( String averiguacao_posterior ) + { + try + { + preProcess( AVERIGUACAO_POSTERIOR, averiguacao_posterior ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.averiguacao_posterior = averiguacao_posterior; + LAZY_LOADED_OBJECTS.put( AVERIGUACAO_POSTERIOR, Boolean.TRUE ); + } + + public String getAveriguacao_obs() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AVERIGUACAO_OBS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.averiguacao_obs; + } + + public void setAveriguacao_obs( String averiguacao_obs ) + { + try + { + preProcess( AVERIGUACAO_OBS, averiguacao_obs ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.averiguacao_obs = averiguacao_obs; + LAZY_LOADED_OBJECTS.put( AVERIGUACAO_OBS, Boolean.TRUE ); + } + + public String getNome_resp_consolidacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_RESP_CONSOLIDACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_resp_consolidacao; + } + + public void setNome_resp_consolidacao( String nome_resp_consolidacao ) + { + try + { + preProcess( NOME_RESP_CONSOLIDACAO, nome_resp_consolidacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_resp_consolidacao = nome_resp_consolidacao; + LAZY_LOADED_OBJECTS.put( NOME_RESP_CONSOLIDACAO, Boolean.TRUE ); + } + + public java.util.Date getData_inicio_processo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_INICIO_PROCESSO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_inicio_processo; + } + + public void setData_inicio_processo( java.util.Date data_inicio_processo ) + { + try + { + preProcess( DATA_INICIO_PROCESSO, data_inicio_processo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_inicio_processo = data_inicio_processo; + LAZY_LOADED_OBJECTS.put( DATA_INICIO_PROCESSO, Boolean.TRUE ); + } + + public Integer getDepartamento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DEPARTAMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.departamento_id; + } + + public void setDepartamento_id( Integer departamento_id ) + { + try + { + preProcess( DEPARTAMENTO_ID, departamento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.departamento_id = departamento_id; + LAZY_LOADED_OBJECTS.put( DEPARTAMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.DepartamentosData toDepartamento_id() + { + try + { + prepare( TO_DEPARTAMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_departamento_id; + } + + public void setToDepartamento_id( db.data.siprp.outer.DepartamentosData to_departamento_id ) + { + try + { + preProcess( TO_DEPARTAMENTO_ID, to_departamento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_departamento_id = to_departamento_id; + } + + public Integer getSeccao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SECCAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.seccao_id; + } + + public void setSeccao_id( Integer seccao_id ) + { + try + { + preProcess( SECCAO_ID, seccao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.seccao_id = seccao_id; + LAZY_LOADED_OBJECTS.put( SECCAO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.SeccoesData toSeccao_id() + { + try + { + prepare( TO_SECCAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_seccao_id; + } + + public void setToSeccao_id( db.data.siprp.outer.SeccoesData to_seccao_id ) + { + try + { + preProcess( TO_SECCAO_ID, to_seccao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_seccao_id = to_seccao_id; + } + + public Integer getRh_fase4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RH_FASE4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.rh_fase4; + } + + public void setRh_fase4( Integer rh_fase4 ) + { + try + { + preProcess( RH_FASE4, rh_fase4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.rh_fase4 = rh_fase4; + LAZY_LOADED_OBJECTS.put( RH_FASE4, Boolean.TRUE ); + } + + public String getApagada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( APAGADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.apagada; + } + + public void setApagada( String apagada ) + { + try + { + preProcess( APAGADA, apagada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.apagada = apagada; + LAZY_LOADED_OBJECTS.put( APAGADA, Boolean.TRUE ); + } + + public Boolean getConcluido_por_desactivacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONCLUIDO_POR_DESACTIVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.concluido_por_desactivacao; + } + + public void setConcluido_por_desactivacao( Boolean concluido_por_desactivacao ) + { + try + { + preProcess( CONCLUIDO_POR_DESACTIVACAO, concluido_por_desactivacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.concluido_por_desactivacao = concluido_por_desactivacao; + LAZY_LOADED_OBJECTS.put( CONCLUIDO_POR_DESACTIVACAO, Boolean.TRUE ); + } + + public java.util.Date getData_desactivacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_DESACTIVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_desactivacao; + } + + public void setData_desactivacao( java.util.Date data_desactivacao ) + { + try + { + preProcess( DATA_DESACTIVACAO, data_desactivacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_desactivacao = data_desactivacao; + LAZY_LOADED_OBJECTS.put( DATA_DESACTIVACAO, Boolean.TRUE ); + } + + public String getComentario_desactivacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( COMENTARIO_DESACTIVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.comentario_desactivacao; + } + + public void setComentario_desactivacao( String comentario_desactivacao ) + { + try + { + preProcess( COMENTARIO_DESACTIVACAO, comentario_desactivacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.comentario_desactivacao = comentario_desactivacao; + LAZY_LOADED_OBJECTS.put( COMENTARIO_DESACTIVACAO, Boolean.TRUE ); + } + + public String getParticipado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PARTICIPADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.participado; + } + + public void setParticipado( String participado ) + { + try + { + preProcess( PARTICIPADO, participado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.participado = participado; + LAZY_LOADED_OBJECTS.put( PARTICIPADO, Boolean.TRUE ); + } + + public String getNome_responsavel_participacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_RESPONSAVEL_PARTICIPACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_responsavel_participacao; + } + + public void setNome_responsavel_participacao( String nome_responsavel_participacao ) + { + try + { + preProcess( NOME_RESPONSAVEL_PARTICIPACAO, nome_responsavel_participacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_responsavel_participacao = nome_responsavel_participacao; + LAZY_LOADED_OBJECTS.put( NOME_RESPONSAVEL_PARTICIPACAO, Boolean.TRUE ); + } + + public java.util.Date getData_participacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_PARTICIPACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_participacao; + } + + public void setData_participacao( java.util.Date data_participacao ) + { + try + { + preProcess( DATA_PARTICIPACAO, data_participacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_participacao = data_participacao; + LAZY_LOADED_OBJECTS.put( DATA_PARTICIPACAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AnalisesAcidentes.ID_INDEX: + value = getId(); + break; + case AnalisesAcidentes.DATA_ACIDENTE_INDEX: + value = getData_acidente(); + break; + case AnalisesAcidentes.ACIDENTADO_ID_INDEX: + value = getAcidentado_id(); + break; + case AnalisesAcidentes.TO_ACIDENTADO_ID_INDEX: + value = toAcidentado_id(); + break; + case AnalisesAcidentes.ESTADO_INDEX: + value = getEstado(); + break; + case AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case AnalisesAcidentes.HORAS_TURNO_INDEX: + value = getHoras_turno(); + break; + case AnalisesAcidentes.SECCAO_INDEX: + value = getSeccao(); + break; + case AnalisesAcidentes.LOCAL_TRABALHO_INDEX: + value = getLocal_trabalho(); + break; + case AnalisesAcidentes.TAREFA_INDEX: + value = getTarefa(); + break; + case AnalisesAcidentes.SUBSTANCIAS_INDEX: + value = getSubstancias(); + break; + case AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX: + value = getSuperior_hierarquico(); + break; + case AnalisesAcidentes.CONDICOES_INDEX: + value = getCondicoes(); + break; + case AnalisesAcidentes.TESTEMUNHAS_INDEX: + value = getTestemunhas(); + break; + case AnalisesAcidentes.DESCRICAO_INDEX: + value = getDescricao(); + break; + case AnalisesAcidentes.CONCLUSOES_INDEX: + value = getConclusoes(); + break; + case AnalisesAcidentes.ACCOES_INDEX: + value = getAccoes(); + break; + case AnalisesAcidentes.HORA_ACIDENTE_INDEX: + value = getHora_acidente(); + break; + case AnalisesAcidentes.FORMACAO_SHST_INDEX: + value = getFormacao_shst(); + break; + case AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX: + value = getFormacao_shst_nao_porque(); + break; + case AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX: + value = getOutros_acidentes_com_colaborador(); + break; + case AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX: + value = getNr_acidentes_com_colaborador(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX: + value = getNr_relatorio_acidente_colaborador1(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX: + value = getNr_relatorio_acidente_colaborador2(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX: + value = getNr_relatorio_acidente_colaborador3(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX: + value = getNr_relatorio_acidente_colaborador4(); + break; + case AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX: + value = getAcidentes_outros_colaboradores(); + break; + case AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX: + value = getNr_acidentes_outros_colaboradores(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX: + value = getNr_relatorio_acidente_outros_colaboradores1(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX: + value = getNr_relatorio_acidente_outros_colaboradores2(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX: + value = getNr_relatorio_acidente_outros_colaboradores3(); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX: + value = getNr_relatorio_acidente_outros_colaboradores4(); + break; + case AnalisesAcidentes.LESAO_CABECA_INDEX: + value = getLesao_cabeca(); + break; + case AnalisesAcidentes.LESAO_PESCOCO_INDEX: + value = getLesao_pescoco(); + break; + case AnalisesAcidentes.LESAO_TRONCO_INDEX: + value = getLesao_tronco(); + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX: + value = getLesao_membro_sup_dir(); + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX: + value = getLesao_membro_sup_esq(); + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX: + value = getLesao_membro_inf_dir(); + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX: + value = getLesao_membro_inf_esq(); + break; + case AnalisesAcidentes.ESPECIF1_INDEX: + value = getEspecif1(); + break; + case AnalisesAcidentes.ESPECIF2_INDEX: + value = getEspecif2(); + break; + case AnalisesAcidentes.ESPECIF3_INDEX: + value = getEspecif3(); + break; + case AnalisesAcidentes.ESPECIF4_INDEX: + value = getEspecif4(); + break; + case AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX: + value = getTipo_incapacidade(); + break; + case AnalisesAcidentes.COEF_INCAPACIDADE_INDEX: + value = getCoef_incapacidade(); + break; + case AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX: + value = getData_aval_incapacidade(); + break; + case AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX: + value = getData_rev_incapacidade(); + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX: + value = getPeriodo_incapacidade_de(); + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX: + value = getPeriodo_incapacidade_a(); + break; + case AnalisesAcidentes.IMG_FLEXAO_INDEX: + value = getImg_flexao(); + break; + case AnalisesAcidentes.IMG_EXT1_INDEX: + value = getImg_ext1(); + break; + case AnalisesAcidentes.IMG_EXT2_INDEX: + value = getImg_ext2(); + break; + case AnalisesAcidentes.IMG_CAB2_INDEX: + value = getImg_cab2(); + break; + case AnalisesAcidentes.IMG_CAB3_INDEX: + value = getImg_cab3(); + break; + case AnalisesAcidentes.IMG_MA2_INDEX: + value = getImg_ma2(); + break; + case AnalisesAcidentes.IMG_MA3_INDEX: + value = getImg_ma3(); + break; + case AnalisesAcidentes.IMG_MA5_INDEX: + value = getImg_ma5(); + break; + case AnalisesAcidentes.IMG_MA6_INDEX: + value = getImg_ma6(); + break; + case AnalisesAcidentes.IMG_MA8_INDEX: + value = getImg_ma8(); + break; + case AnalisesAcidentes.IMG_MA10_INDEX: + value = getImg_ma10(); + break; + case AnalisesAcidentes.RESTRICAO_CARGA_INDEX: + value = getRestricao_carga(); + break; + case AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX: + value = getRestricao_motricidade(); + break; + case AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX: + value = getRestricao_conducao(); + break; + case AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX: + value = getRestricao_vibracoes(); + break; + case AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX: + value = getRestricao_outras(); + break; + case AnalisesAcidentes.MED_OBSERV_INDEX: + value = getMed_observ(); + break; + case AnalisesAcidentes.TIPO_LESAO_INDEX: + value = getTipo_lesao(); + break; + case AnalisesAcidentes.IMG_ROT1_INDEX: + value = getImg_rot1(); + break; + case AnalisesAcidentes.IMG_ROT2_INDEX: + value = getImg_rot2(); + break; + case AnalisesAcidentes.IMG_CAB1_INDEX: + value = getImg_cab1(); + break; + case AnalisesAcidentes.IMG_CAB4_INDEX: + value = getImg_cab4(); + break; + case AnalisesAcidentes.IMG_MA1_INDEX: + value = getImg_ma1(); + break; + case AnalisesAcidentes.IMG_MA4_INDEX: + value = getImg_ma4(); + break; + case AnalisesAcidentes.IMG_MA7_INDEX: + value = getImg_ma7(); + break; + case AnalisesAcidentes.IMG_MA9_INDEX: + value = getImg_ma9(); + break; + case AnalisesAcidentes.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case AnalisesAcidentes.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + case AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX: + value = getTecnico_saude_id(); + break; + case AnalisesAcidentes.ANALISE_NR_INDEX: + value = getAnalise_nr(); + break; + case AnalisesAcidentes.ESTADO_ASSINATURA_INDEX: + value = getEstado_assinatura(); + break; + case AnalisesAcidentes.ASS_RESP_SEG_INDEX: + value = getAss_resp_seg(); + break; + case AnalisesAcidentes.ASS_RESP_RH_INDEX: + value = getAss_resp_rh(); + break; + case AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX: + value = getData_consolidacao(); + break; + case AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX: + value = getData_assinatura_seg(); + break; + case AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX: + value = getData_assinatura_rh(); + break; + case AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX: + value = getAss_consolidacao(); + break; + case AnalisesAcidentes.NOME_RESP_SEG_INDEX: + value = getNome_resp_seg(); + break; + case AnalisesAcidentes.NOME_RESP_RH_INDEX: + value = getNome_resp_rh(); + break; + case AnalisesAcidentes.CAUSAS_INDEX: + value = getCausas(); + break; + case AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX: + value = getEstado_antes_correcao(); + break; + case AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX: + value = getObservacoes_correcao(); + break; + case AnalisesAcidentes.CORRECAO_INDEX: + value = getCorrecao(); + break; + case AnalisesAcidentes.ASS_SUPERIOR_INDEX: + value = getAss_superior(); + break; + case AnalisesAcidentes.NOME_SUPERIOR_INDEX: + value = getNome_superior(); + break; + case AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX: + value = getData_assinatura_superior(); + break; + case AnalisesAcidentes.AVERIGUADOR_INDEX: + value = getAveriguador(); + break; + case AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX: + value = getAveriguacao_posterior(); + break; + case AnalisesAcidentes.AVERIGUACAO_OBS_INDEX: + value = getAveriguacao_obs(); + break; + case AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX: + value = getNome_resp_consolidacao(); + break; + case AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX: + value = getData_inicio_processo(); + break; + case AnalisesAcidentes.DEPARTAMENTO_ID_INDEX: + value = getDepartamento_id(); + break; + case AnalisesAcidentes.TO_DEPARTAMENTO_ID_INDEX: + value = toDepartamento_id(); + break; + case AnalisesAcidentes.SECCAO_ID_INDEX: + value = getSeccao_id(); + break; + case AnalisesAcidentes.TO_SECCAO_ID_INDEX: + value = toSeccao_id(); + break; + case AnalisesAcidentes.RH_FASE4_INDEX: + value = getRh_fase4(); + break; + case AnalisesAcidentes.APAGADA_INDEX: + value = getApagada(); + break; + case AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX: + value = getConcluido_por_desactivacao(); + break; + case AnalisesAcidentes.DATA_DESACTIVACAO_INDEX: + value = getData_desactivacao(); + break; + case AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX: + value = getComentario_desactivacao(); + break; + case AnalisesAcidentes.PARTICIPADO_INDEX: + value = getParticipado(); + break; + case AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX: + value = getNome_responsavel_participacao(); + break; + case AnalisesAcidentes.DATA_PARTICIPACAO_INDEX: + value = getData_participacao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AnalisesAcidentes.ID_INDEX: + value = this.id; + break; + case AnalisesAcidentes.DATA_ACIDENTE_INDEX: + value = this.data_acidente; + break; + case AnalisesAcidentes.ACIDENTADO_ID_INDEX: + value = this.acidentado_id; + break; + case AnalisesAcidentes.TO_ACIDENTADO_ID_INDEX: + value = this.to_acidentado_id; + break; + case AnalisesAcidentes.ESTADO_INDEX: + value = this.estado; + break; + case AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case AnalisesAcidentes.HORAS_TURNO_INDEX: + value = this.horas_turno; + break; + case AnalisesAcidentes.SECCAO_INDEX: + value = this.seccao; + break; + case AnalisesAcidentes.LOCAL_TRABALHO_INDEX: + value = this.local_trabalho; + break; + case AnalisesAcidentes.TAREFA_INDEX: + value = this.tarefa; + break; + case AnalisesAcidentes.SUBSTANCIAS_INDEX: + value = this.substancias; + break; + case AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX: + value = this.superior_hierarquico; + break; + case AnalisesAcidentes.CONDICOES_INDEX: + value = this.condicoes; + break; + case AnalisesAcidentes.TESTEMUNHAS_INDEX: + value = this.testemunhas; + break; + case AnalisesAcidentes.DESCRICAO_INDEX: + value = this.descricao; + break; + case AnalisesAcidentes.CONCLUSOES_INDEX: + value = this.conclusoes; + break; + case AnalisesAcidentes.ACCOES_INDEX: + value = this.accoes; + break; + case AnalisesAcidentes.HORA_ACIDENTE_INDEX: + value = this.hora_acidente; + break; + case AnalisesAcidentes.FORMACAO_SHST_INDEX: + value = this.formacao_shst; + break; + case AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX: + value = this.formacao_shst_nao_porque; + break; + case AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX: + value = this.outros_acidentes_com_colaborador; + break; + case AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX: + value = this.nr_acidentes_com_colaborador; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX: + value = this.nr_relatorio_acidente_colaborador1; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX: + value = this.nr_relatorio_acidente_colaborador2; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX: + value = this.nr_relatorio_acidente_colaborador3; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX: + value = this.nr_relatorio_acidente_colaborador4; + break; + case AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX: + value = this.acidentes_outros_colaboradores; + break; + case AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX: + value = this.nr_acidentes_outros_colaboradores; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX: + value = this.nr_relatorio_acidente_outros_colaboradores1; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX: + value = this.nr_relatorio_acidente_outros_colaboradores2; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX: + value = this.nr_relatorio_acidente_outros_colaboradores3; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX: + value = this.nr_relatorio_acidente_outros_colaboradores4; + break; + case AnalisesAcidentes.LESAO_CABECA_INDEX: + value = this.lesao_cabeca; + break; + case AnalisesAcidentes.LESAO_PESCOCO_INDEX: + value = this.lesao_pescoco; + break; + case AnalisesAcidentes.LESAO_TRONCO_INDEX: + value = this.lesao_tronco; + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX: + value = this.lesao_membro_sup_dir; + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX: + value = this.lesao_membro_sup_esq; + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX: + value = this.lesao_membro_inf_dir; + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX: + value = this.lesao_membro_inf_esq; + break; + case AnalisesAcidentes.ESPECIF1_INDEX: + value = this.especif1; + break; + case AnalisesAcidentes.ESPECIF2_INDEX: + value = this.especif2; + break; + case AnalisesAcidentes.ESPECIF3_INDEX: + value = this.especif3; + break; + case AnalisesAcidentes.ESPECIF4_INDEX: + value = this.especif4; + break; + case AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX: + value = this.tipo_incapacidade; + break; + case AnalisesAcidentes.COEF_INCAPACIDADE_INDEX: + value = this.coef_incapacidade; + break; + case AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX: + value = this.data_aval_incapacidade; + break; + case AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX: + value = this.data_rev_incapacidade; + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX: + value = this.periodo_incapacidade_de; + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX: + value = this.periodo_incapacidade_a; + break; + case AnalisesAcidentes.IMG_FLEXAO_INDEX: + value = this.img_flexao; + break; + case AnalisesAcidentes.IMG_EXT1_INDEX: + value = this.img_ext1; + break; + case AnalisesAcidentes.IMG_EXT2_INDEX: + value = this.img_ext2; + break; + case AnalisesAcidentes.IMG_CAB2_INDEX: + value = this.img_cab2; + break; + case AnalisesAcidentes.IMG_CAB3_INDEX: + value = this.img_cab3; + break; + case AnalisesAcidentes.IMG_MA2_INDEX: + value = this.img_ma2; + break; + case AnalisesAcidentes.IMG_MA3_INDEX: + value = this.img_ma3; + break; + case AnalisesAcidentes.IMG_MA5_INDEX: + value = this.img_ma5; + break; + case AnalisesAcidentes.IMG_MA6_INDEX: + value = this.img_ma6; + break; + case AnalisesAcidentes.IMG_MA8_INDEX: + value = this.img_ma8; + break; + case AnalisesAcidentes.IMG_MA10_INDEX: + value = this.img_ma10; + break; + case AnalisesAcidentes.RESTRICAO_CARGA_INDEX: + value = this.restricao_carga; + break; + case AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX: + value = this.restricao_motricidade; + break; + case AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX: + value = this.restricao_conducao; + break; + case AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX: + value = this.restricao_vibracoes; + break; + case AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX: + value = this.restricao_outras; + break; + case AnalisesAcidentes.MED_OBSERV_INDEX: + value = this.med_observ; + break; + case AnalisesAcidentes.TIPO_LESAO_INDEX: + value = this.tipo_lesao; + break; + case AnalisesAcidentes.IMG_ROT1_INDEX: + value = this.img_rot1; + break; + case AnalisesAcidentes.IMG_ROT2_INDEX: + value = this.img_rot2; + break; + case AnalisesAcidentes.IMG_CAB1_INDEX: + value = this.img_cab1; + break; + case AnalisesAcidentes.IMG_CAB4_INDEX: + value = this.img_cab4; + break; + case AnalisesAcidentes.IMG_MA1_INDEX: + value = this.img_ma1; + break; + case AnalisesAcidentes.IMG_MA4_INDEX: + value = this.img_ma4; + break; + case AnalisesAcidentes.IMG_MA7_INDEX: + value = this.img_ma7; + break; + case AnalisesAcidentes.IMG_MA9_INDEX: + value = this.img_ma9; + break; + case AnalisesAcidentes.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case AnalisesAcidentes.MEDICO_ID_INDEX: + value = this.medico_id; + break; + case AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX: + value = this.tecnico_saude_id; + break; + case AnalisesAcidentes.ANALISE_NR_INDEX: + value = this.analise_nr; + break; + case AnalisesAcidentes.ESTADO_ASSINATURA_INDEX: + value = this.estado_assinatura; + break; + case AnalisesAcidentes.ASS_RESP_SEG_INDEX: + value = this.ass_resp_seg; + break; + case AnalisesAcidentes.ASS_RESP_RH_INDEX: + value = this.ass_resp_rh; + break; + case AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX: + value = this.data_consolidacao; + break; + case AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX: + value = this.data_assinatura_seg; + break; + case AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX: + value = this.data_assinatura_rh; + break; + case AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX: + value = this.ass_consolidacao; + break; + case AnalisesAcidentes.NOME_RESP_SEG_INDEX: + value = this.nome_resp_seg; + break; + case AnalisesAcidentes.NOME_RESP_RH_INDEX: + value = this.nome_resp_rh; + break; + case AnalisesAcidentes.CAUSAS_INDEX: + value = this.causas; + break; + case AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX: + value = this.estado_antes_correcao; + break; + case AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX: + value = this.observacoes_correcao; + break; + case AnalisesAcidentes.CORRECAO_INDEX: + value = this.correcao; + break; + case AnalisesAcidentes.ASS_SUPERIOR_INDEX: + value = this.ass_superior; + break; + case AnalisesAcidentes.NOME_SUPERIOR_INDEX: + value = this.nome_superior; + break; + case AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX: + value = this.data_assinatura_superior; + break; + case AnalisesAcidentes.AVERIGUADOR_INDEX: + value = this.averiguador; + break; + case AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX: + value = this.averiguacao_posterior; + break; + case AnalisesAcidentes.AVERIGUACAO_OBS_INDEX: + value = this.averiguacao_obs; + break; + case AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX: + value = this.nome_resp_consolidacao; + break; + case AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX: + value = this.data_inicio_processo; + break; + case AnalisesAcidentes.DEPARTAMENTO_ID_INDEX: + value = this.departamento_id; + break; + case AnalisesAcidentes.TO_DEPARTAMENTO_ID_INDEX: + value = this.to_departamento_id; + break; + case AnalisesAcidentes.SECCAO_ID_INDEX: + value = this.seccao_id; + break; + case AnalisesAcidentes.TO_SECCAO_ID_INDEX: + value = this.to_seccao_id; + break; + case AnalisesAcidentes.RH_FASE4_INDEX: + value = this.rh_fase4; + break; + case AnalisesAcidentes.APAGADA_INDEX: + value = this.apagada; + break; + case AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX: + value = this.concluido_por_desactivacao; + break; + case AnalisesAcidentes.DATA_DESACTIVACAO_INDEX: + value = this.data_desactivacao; + break; + case AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX: + value = this.comentario_desactivacao; + break; + case AnalisesAcidentes.PARTICIPADO_INDEX: + value = this.participado; + break; + case AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX: + value = this.nome_responsavel_participacao; + break; + case AnalisesAcidentes.DATA_PARTICIPACAO_INDEX: + value = this.data_participacao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AnalisesAcidentes.ID_INDEX: + setId( ( Integer ) value ); + break; + case AnalisesAcidentes.DATA_ACIDENTE_INDEX: + setData_acidente( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.ACIDENTADO_ID_INDEX: + setAcidentado_id( ( Integer ) value ); + break; + case AnalisesAcidentes.TO_ACIDENTADO_ID_INDEX: + setToAcidentado_id( ( db.data.siprp.outer.AcidentadosData ) value ); + break; + case AnalisesAcidentes.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case AnalisesAcidentes.HORAS_TURNO_INDEX: + setHoras_turno( ( Integer ) value ); + break; + case AnalisesAcidentes.SECCAO_INDEX: + setSeccao( ( String ) value ); + break; + case AnalisesAcidentes.LOCAL_TRABALHO_INDEX: + setLocal_trabalho( ( String ) value ); + break; + case AnalisesAcidentes.TAREFA_INDEX: + setTarefa( ( String ) value ); + break; + case AnalisesAcidentes.SUBSTANCIAS_INDEX: + setSubstancias( ( String ) value ); + break; + case AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX: + setSuperior_hierarquico( ( String ) value ); + break; + case AnalisesAcidentes.CONDICOES_INDEX: + setCondicoes( ( String ) value ); + break; + case AnalisesAcidentes.TESTEMUNHAS_INDEX: + setTestemunhas( ( String ) value ); + break; + case AnalisesAcidentes.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case AnalisesAcidentes.CONCLUSOES_INDEX: + setConclusoes( ( String ) value ); + break; + case AnalisesAcidentes.ACCOES_INDEX: + setAccoes( ( String ) value ); + break; + case AnalisesAcidentes.HORA_ACIDENTE_INDEX: + setHora_acidente( ( java.sql.Time ) value ); + break; + case AnalisesAcidentes.FORMACAO_SHST_INDEX: + setFormacao_shst( ( String ) value ); + break; + case AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX: + setFormacao_shst_nao_porque( ( String ) value ); + break; + case AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX: + setOutros_acidentes_com_colaborador( ( String ) value ); + break; + case AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX: + setNr_acidentes_com_colaborador( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX: + setNr_relatorio_acidente_colaborador1( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX: + setNr_relatorio_acidente_colaborador2( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX: + setNr_relatorio_acidente_colaborador3( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX: + setNr_relatorio_acidente_colaborador4( ( Integer ) value ); + break; + case AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX: + setAcidentes_outros_colaboradores( ( String ) value ); + break; + case AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX: + setNr_acidentes_outros_colaboradores( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX: + setNr_relatorio_acidente_outros_colaboradores1( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX: + setNr_relatorio_acidente_outros_colaboradores2( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX: + setNr_relatorio_acidente_outros_colaboradores3( ( Integer ) value ); + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX: + setNr_relatorio_acidente_outros_colaboradores4( ( Integer ) value ); + break; + case AnalisesAcidentes.LESAO_CABECA_INDEX: + setLesao_cabeca( ( String ) value ); + break; + case AnalisesAcidentes.LESAO_PESCOCO_INDEX: + setLesao_pescoco( ( String ) value ); + break; + case AnalisesAcidentes.LESAO_TRONCO_INDEX: + setLesao_tronco( ( String ) value ); + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX: + setLesao_membro_sup_dir( ( String ) value ); + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX: + setLesao_membro_sup_esq( ( String ) value ); + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX: + setLesao_membro_inf_dir( ( String ) value ); + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX: + setLesao_membro_inf_esq( ( String ) value ); + break; + case AnalisesAcidentes.ESPECIF1_INDEX: + setEspecif1( ( String ) value ); + break; + case AnalisesAcidentes.ESPECIF2_INDEX: + setEspecif2( ( String ) value ); + break; + case AnalisesAcidentes.ESPECIF3_INDEX: + setEspecif3( ( String ) value ); + break; + case AnalisesAcidentes.ESPECIF4_INDEX: + setEspecif4( ( String ) value ); + break; + case AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX: + setTipo_incapacidade( ( String ) value ); + break; + case AnalisesAcidentes.COEF_INCAPACIDADE_INDEX: + setCoef_incapacidade( ( Integer ) value ); + break; + case AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX: + setData_aval_incapacidade( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX: + setData_rev_incapacidade( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX: + setPeriodo_incapacidade_de( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX: + setPeriodo_incapacidade_a( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.IMG_FLEXAO_INDEX: + setImg_flexao( ( String ) value ); + break; + case AnalisesAcidentes.IMG_EXT1_INDEX: + setImg_ext1( ( String ) value ); + break; + case AnalisesAcidentes.IMG_EXT2_INDEX: + setImg_ext2( ( String ) value ); + break; + case AnalisesAcidentes.IMG_CAB2_INDEX: + setImg_cab2( ( String ) value ); + break; + case AnalisesAcidentes.IMG_CAB3_INDEX: + setImg_cab3( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA2_INDEX: + setImg_ma2( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA3_INDEX: + setImg_ma3( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA5_INDEX: + setImg_ma5( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA6_INDEX: + setImg_ma6( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA8_INDEX: + setImg_ma8( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA10_INDEX: + setImg_ma10( ( String ) value ); + break; + case AnalisesAcidentes.RESTRICAO_CARGA_INDEX: + setRestricao_carga( ( Integer ) value ); + break; + case AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX: + setRestricao_motricidade( ( String ) value ); + break; + case AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX: + setRestricao_conducao( ( String ) value ); + break; + case AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX: + setRestricao_vibracoes( ( String ) value ); + break; + case AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX: + setRestricao_outras( ( String ) value ); + break; + case AnalisesAcidentes.MED_OBSERV_INDEX: + setMed_observ( ( String ) value ); + break; + case AnalisesAcidentes.TIPO_LESAO_INDEX: + setTipo_lesao( ( String ) value ); + break; + case AnalisesAcidentes.IMG_ROT1_INDEX: + setImg_rot1( ( String ) value ); + break; + case AnalisesAcidentes.IMG_ROT2_INDEX: + setImg_rot2( ( String ) value ); + break; + case AnalisesAcidentes.IMG_CAB1_INDEX: + setImg_cab1( ( String ) value ); + break; + case AnalisesAcidentes.IMG_CAB4_INDEX: + setImg_cab4( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA1_INDEX: + setImg_ma1( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA4_INDEX: + setImg_ma4( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA7_INDEX: + setImg_ma7( ( String ) value ); + break; + case AnalisesAcidentes.IMG_MA9_INDEX: + setImg_ma9( ( String ) value ); + break; + case AnalisesAcidentes.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case AnalisesAcidentes.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + case AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX: + setTecnico_saude_id( ( Integer ) value ); + break; + case AnalisesAcidentes.ANALISE_NR_INDEX: + setAnalise_nr( ( String ) value ); + break; + case AnalisesAcidentes.ESTADO_ASSINATURA_INDEX: + setEstado_assinatura( ( Integer ) value ); + break; + case AnalisesAcidentes.ASS_RESP_SEG_INDEX: + setAss_resp_seg( ( String ) value ); + break; + case AnalisesAcidentes.ASS_RESP_RH_INDEX: + setAss_resp_rh( ( String ) value ); + break; + case AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX: + setData_consolidacao( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX: + setData_assinatura_seg( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX: + setData_assinatura_rh( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX: + setAss_consolidacao( ( String ) value ); + break; + case AnalisesAcidentes.NOME_RESP_SEG_INDEX: + setNome_resp_seg( ( String ) value ); + break; + case AnalisesAcidentes.NOME_RESP_RH_INDEX: + setNome_resp_rh( ( String ) value ); + break; + case AnalisesAcidentes.CAUSAS_INDEX: + setCausas( ( Integer ) value ); + break; + case AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX: + setEstado_antes_correcao( ( Integer ) value ); + break; + case AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX: + setObservacoes_correcao( ( String ) value ); + break; + case AnalisesAcidentes.CORRECAO_INDEX: + setCorrecao( ( String ) value ); + break; + case AnalisesAcidentes.ASS_SUPERIOR_INDEX: + setAss_superior( ( String ) value ); + break; + case AnalisesAcidentes.NOME_SUPERIOR_INDEX: + setNome_superior( ( String ) value ); + break; + case AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX: + setData_assinatura_superior( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.AVERIGUADOR_INDEX: + setAveriguador( ( String ) value ); + break; + case AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX: + setAveriguacao_posterior( ( String ) value ); + break; + case AnalisesAcidentes.AVERIGUACAO_OBS_INDEX: + setAveriguacao_obs( ( String ) value ); + break; + case AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX: + setNome_resp_consolidacao( ( String ) value ); + break; + case AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX: + setData_inicio_processo( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.DEPARTAMENTO_ID_INDEX: + setDepartamento_id( ( Integer ) value ); + break; + case AnalisesAcidentes.TO_DEPARTAMENTO_ID_INDEX: + setToDepartamento_id( ( db.data.siprp.outer.DepartamentosData ) value ); + break; + case AnalisesAcidentes.SECCAO_ID_INDEX: + setSeccao_id( ( Integer ) value ); + break; + case AnalisesAcidentes.TO_SECCAO_ID_INDEX: + setToSeccao_id( ( db.data.siprp.outer.SeccoesData ) value ); + break; + case AnalisesAcidentes.RH_FASE4_INDEX: + setRh_fase4( ( Integer ) value ); + break; + case AnalisesAcidentes.APAGADA_INDEX: + setApagada( ( String ) value ); + break; + case AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX: + setConcluido_por_desactivacao( ( Boolean ) value ); + break; + case AnalisesAcidentes.DATA_DESACTIVACAO_INDEX: + setData_desactivacao( ( java.util.Date ) value ); + break; + case AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX: + setComentario_desactivacao( ( String ) value ); + break; + case AnalisesAcidentes.PARTICIPADO_INDEX: + setParticipado( ( String ) value ); + break; + case AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX: + setNome_responsavel_participacao( ( String ) value ); + break; + case AnalisesAcidentes.DATA_PARTICIPACAO_INDEX: + setData_participacao( ( java.util.Date ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AnalisesAcidentes.ID_INDEX: + this.id = ( Integer ) value; + break; + case AnalisesAcidentes.DATA_ACIDENTE_INDEX: + this.data_acidente = ( java.util.Date ) value; + break; + case AnalisesAcidentes.ACIDENTADO_ID_INDEX: + this.acidentado_id = ( Integer ) value; + break; + case AnalisesAcidentes.TO_ACIDENTADO_ID_INDEX: + this.to_acidentado_id = ( db.data.siprp.outer.AcidentadosData ) value; + break; + case AnalisesAcidentes.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case AnalisesAcidentes.HORAS_TURNO_INDEX: + this.horas_turno = ( Integer ) value; + break; + case AnalisesAcidentes.SECCAO_INDEX: + this.seccao = ( String ) value; + break; + case AnalisesAcidentes.LOCAL_TRABALHO_INDEX: + this.local_trabalho = ( String ) value; + break; + case AnalisesAcidentes.TAREFA_INDEX: + this.tarefa = ( String ) value; + break; + case AnalisesAcidentes.SUBSTANCIAS_INDEX: + this.substancias = ( String ) value; + break; + case AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX: + this.superior_hierarquico = ( String ) value; + break; + case AnalisesAcidentes.CONDICOES_INDEX: + this.condicoes = ( String ) value; + break; + case AnalisesAcidentes.TESTEMUNHAS_INDEX: + this.testemunhas = ( String ) value; + break; + case AnalisesAcidentes.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case AnalisesAcidentes.CONCLUSOES_INDEX: + this.conclusoes = ( String ) value; + break; + case AnalisesAcidentes.ACCOES_INDEX: + this.accoes = ( String ) value; + break; + case AnalisesAcidentes.HORA_ACIDENTE_INDEX: + try + { + this.hora_acidente = ( java.sql.Time ) value; + } + catch( java.lang.ClassCastException cce ) + { + if( value instanceof java.util.Date ) + { + this.hora_acidente = new java.sql.Time( ( ( java.util.Date ) value ).getTime() ); + } + } + break; + case AnalisesAcidentes.FORMACAO_SHST_INDEX: + this.formacao_shst = ( String ) value; + break; + case AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX: + this.formacao_shst_nao_porque = ( String ) value; + break; + case AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX: + this.outros_acidentes_com_colaborador = ( String ) value; + break; + case AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX: + this.nr_acidentes_com_colaborador = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX: + this.nr_relatorio_acidente_colaborador1 = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX: + this.nr_relatorio_acidente_colaborador2 = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX: + this.nr_relatorio_acidente_colaborador3 = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX: + this.nr_relatorio_acidente_colaborador4 = ( Integer ) value; + break; + case AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX: + this.acidentes_outros_colaboradores = ( String ) value; + break; + case AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX: + this.nr_acidentes_outros_colaboradores = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX: + this.nr_relatorio_acidente_outros_colaboradores1 = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX: + this.nr_relatorio_acidente_outros_colaboradores2 = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX: + this.nr_relatorio_acidente_outros_colaboradores3 = ( Integer ) value; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX: + this.nr_relatorio_acidente_outros_colaboradores4 = ( Integer ) value; + break; + case AnalisesAcidentes.LESAO_CABECA_INDEX: + this.lesao_cabeca = ( String ) value; + break; + case AnalisesAcidentes.LESAO_PESCOCO_INDEX: + this.lesao_pescoco = ( String ) value; + break; + case AnalisesAcidentes.LESAO_TRONCO_INDEX: + this.lesao_tronco = ( String ) value; + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX: + this.lesao_membro_sup_dir = ( String ) value; + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX: + this.lesao_membro_sup_esq = ( String ) value; + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX: + this.lesao_membro_inf_dir = ( String ) value; + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX: + this.lesao_membro_inf_esq = ( String ) value; + break; + case AnalisesAcidentes.ESPECIF1_INDEX: + this.especif1 = ( String ) value; + break; + case AnalisesAcidentes.ESPECIF2_INDEX: + this.especif2 = ( String ) value; + break; + case AnalisesAcidentes.ESPECIF3_INDEX: + this.especif3 = ( String ) value; + break; + case AnalisesAcidentes.ESPECIF4_INDEX: + this.especif4 = ( String ) value; + break; + case AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX: + this.tipo_incapacidade = ( String ) value; + break; + case AnalisesAcidentes.COEF_INCAPACIDADE_INDEX: + this.coef_incapacidade = ( Integer ) value; + break; + case AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX: + this.data_aval_incapacidade = ( java.util.Date ) value; + break; + case AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX: + this.data_rev_incapacidade = ( java.util.Date ) value; + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX: + this.periodo_incapacidade_de = ( java.util.Date ) value; + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX: + this.periodo_incapacidade_a = ( java.util.Date ) value; + break; + case AnalisesAcidentes.IMG_FLEXAO_INDEX: + this.img_flexao = ( String ) value; + break; + case AnalisesAcidentes.IMG_EXT1_INDEX: + this.img_ext1 = ( String ) value; + break; + case AnalisesAcidentes.IMG_EXT2_INDEX: + this.img_ext2 = ( String ) value; + break; + case AnalisesAcidentes.IMG_CAB2_INDEX: + this.img_cab2 = ( String ) value; + break; + case AnalisesAcidentes.IMG_CAB3_INDEX: + this.img_cab3 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA2_INDEX: + this.img_ma2 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA3_INDEX: + this.img_ma3 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA5_INDEX: + this.img_ma5 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA6_INDEX: + this.img_ma6 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA8_INDEX: + this.img_ma8 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA10_INDEX: + this.img_ma10 = ( String ) value; + break; + case AnalisesAcidentes.RESTRICAO_CARGA_INDEX: + this.restricao_carga = ( Integer ) value; + break; + case AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX: + this.restricao_motricidade = ( String ) value; + break; + case AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX: + this.restricao_conducao = ( String ) value; + break; + case AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX: + this.restricao_vibracoes = ( String ) value; + break; + case AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX: + this.restricao_outras = ( String ) value; + break; + case AnalisesAcidentes.MED_OBSERV_INDEX: + this.med_observ = ( String ) value; + break; + case AnalisesAcidentes.TIPO_LESAO_INDEX: + this.tipo_lesao = ( String ) value; + break; + case AnalisesAcidentes.IMG_ROT1_INDEX: + this.img_rot1 = ( String ) value; + break; + case AnalisesAcidentes.IMG_ROT2_INDEX: + this.img_rot2 = ( String ) value; + break; + case AnalisesAcidentes.IMG_CAB1_INDEX: + this.img_cab1 = ( String ) value; + break; + case AnalisesAcidentes.IMG_CAB4_INDEX: + this.img_cab4 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA1_INDEX: + this.img_ma1 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA4_INDEX: + this.img_ma4 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA7_INDEX: + this.img_ma7 = ( String ) value; + break; + case AnalisesAcidentes.IMG_MA9_INDEX: + this.img_ma9 = ( String ) value; + break; + case AnalisesAcidentes.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case AnalisesAcidentes.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + case AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX: + this.tecnico_saude_id = ( Integer ) value; + break; + case AnalisesAcidentes.ANALISE_NR_INDEX: + this.analise_nr = ( String ) value; + break; + case AnalisesAcidentes.ESTADO_ASSINATURA_INDEX: + this.estado_assinatura = ( Integer ) value; + break; + case AnalisesAcidentes.ASS_RESP_SEG_INDEX: + this.ass_resp_seg = ( String ) value; + break; + case AnalisesAcidentes.ASS_RESP_RH_INDEX: + this.ass_resp_rh = ( String ) value; + break; + case AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX: + this.data_consolidacao = ( java.util.Date ) value; + break; + case AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX: + this.data_assinatura_seg = ( java.util.Date ) value; + break; + case AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX: + this.data_assinatura_rh = ( java.util.Date ) value; + break; + case AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX: + this.ass_consolidacao = ( String ) value; + break; + case AnalisesAcidentes.NOME_RESP_SEG_INDEX: + this.nome_resp_seg = ( String ) value; + break; + case AnalisesAcidentes.NOME_RESP_RH_INDEX: + this.nome_resp_rh = ( String ) value; + break; + case AnalisesAcidentes.CAUSAS_INDEX: + this.causas = ( Integer ) value; + break; + case AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX: + this.estado_antes_correcao = ( Integer ) value; + break; + case AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX: + this.observacoes_correcao = ( String ) value; + break; + case AnalisesAcidentes.CORRECAO_INDEX: + this.correcao = ( String ) value; + break; + case AnalisesAcidentes.ASS_SUPERIOR_INDEX: + this.ass_superior = ( String ) value; + break; + case AnalisesAcidentes.NOME_SUPERIOR_INDEX: + this.nome_superior = ( String ) value; + break; + case AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX: + this.data_assinatura_superior = ( java.util.Date ) value; + break; + case AnalisesAcidentes.AVERIGUADOR_INDEX: + this.averiguador = ( String ) value; + break; + case AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX: + this.averiguacao_posterior = ( String ) value; + break; + case AnalisesAcidentes.AVERIGUACAO_OBS_INDEX: + this.averiguacao_obs = ( String ) value; + break; + case AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX: + this.nome_resp_consolidacao = ( String ) value; + break; + case AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX: + this.data_inicio_processo = ( java.util.Date ) value; + break; + case AnalisesAcidentes.DEPARTAMENTO_ID_INDEX: + this.departamento_id = ( Integer ) value; + break; + case AnalisesAcidentes.TO_DEPARTAMENTO_ID_INDEX: + this.to_departamento_id = ( db.data.siprp.outer.DepartamentosData ) value; + break; + case AnalisesAcidentes.SECCAO_ID_INDEX: + this.seccao_id = ( Integer ) value; + break; + case AnalisesAcidentes.TO_SECCAO_ID_INDEX: + this.to_seccao_id = ( db.data.siprp.outer.SeccoesData ) value; + break; + case AnalisesAcidentes.RH_FASE4_INDEX: + this.rh_fase4 = ( Integer ) value; + break; + case AnalisesAcidentes.APAGADA_INDEX: + this.apagada = ( String ) value; + break; + case AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX: + this.concluido_por_desactivacao = ( Boolean ) value; + break; + case AnalisesAcidentes.DATA_DESACTIVACAO_INDEX: + this.data_desactivacao = ( java.util.Date ) value; + break; + case AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX: + this.comentario_desactivacao = ( String ) value; + break; + case AnalisesAcidentes.PARTICIPADO_INDEX: + this.participado = ( String ) value; + break; + case AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX: + this.nome_responsavel_participacao = ( String ) value; + break; + case AnalisesAcidentes.DATA_PARTICIPACAO_INDEX: + this.data_participacao = ( java.util.Date ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case AnalisesAcidentes.ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.DATA_ACIDENTE_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.ACIDENTADO_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.TO_ACIDENTADO_ID_INDEX: + theClass = db.data.siprp.outer.AcidentadosData.class; + break; + case AnalisesAcidentes.ESTADO_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.HORAS_TURNO_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.SECCAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LOCAL_TRABALHO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.TAREFA_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.SUBSTANCIAS_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.SUPERIOR_HIERARQUICO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.CONDICOES_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.TESTEMUNHAS_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.DESCRICAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.CONCLUSOES_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ACCOES_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.HORA_ACIDENTE_INDEX: + theClass = java.sql.Time.class; + break; + case AnalisesAcidentes.FORMACAO_SHST_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.FORMACAO_SHST_NAO_PORQUE_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.OUTROS_ACIDENTES_COM_COLABORADOR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NR_ACIDENTES_COM_COLABORADOR_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR1_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR2_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR3_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_COLABORADOR4_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.ACIDENTES_OUTROS_COLABORADORES_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NR_ACIDENTES_OUTROS_COLABORADORES_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES1_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES2_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES3_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.NR_RELATORIO_ACIDENTE_OUTROS_COLABORADORES4_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.LESAO_CABECA_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LESAO_PESCOCO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LESAO_TRONCO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_DIR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LESAO_MEMBRO_SUP_ESQ_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_DIR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.LESAO_MEMBRO_INF_ESQ_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ESPECIF1_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ESPECIF2_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ESPECIF3_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ESPECIF4_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.TIPO_INCAPACIDADE_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.COEF_INCAPACIDADE_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.DATA_AVAL_INCAPACIDADE_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.DATA_REV_INCAPACIDADE_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_DE_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.PERIODO_INCAPACIDADE_A_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.IMG_FLEXAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_EXT1_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_EXT2_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_CAB2_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_CAB3_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA2_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA3_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA5_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA6_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA8_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA10_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.RESTRICAO_CARGA_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.RESTRICAO_MOTRICIDADE_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.RESTRICAO_CONDUCAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.RESTRICAO_VIBRACOES_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.RESTRICAO_OUTRAS_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.MED_OBSERV_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.TIPO_LESAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_ROT1_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_ROT2_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_CAB1_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_CAB4_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA1_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA4_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA7_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.IMG_MA9_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.TECNICO_SAUDE_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.ANALISE_NR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ESTADO_ASSINATURA_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.ASS_RESP_SEG_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ASS_RESP_RH_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.DATA_CONSOLIDACAO_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.DATA_ASSINATURA_SEG_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.DATA_ASSINATURA_RH_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.ASS_CONSOLIDACAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NOME_RESP_SEG_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NOME_RESP_RH_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.CAUSAS_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.ESTADO_ANTES_CORRECAO_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.OBSERVACOES_CORRECAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.CORRECAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.ASS_SUPERIOR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NOME_SUPERIOR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.DATA_ASSINATURA_SUPERIOR_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.AVERIGUADOR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.AVERIGUACAO_POSTERIOR_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.AVERIGUACAO_OBS_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NOME_RESP_CONSOLIDACAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.DATA_INICIO_PROCESSO_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.DEPARTAMENTO_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.TO_DEPARTAMENTO_ID_INDEX: + theClass = db.data.siprp.outer.DepartamentosData.class; + break; + case AnalisesAcidentes.SECCAO_ID_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.TO_SECCAO_ID_INDEX: + theClass = db.data.siprp.outer.SeccoesData.class; + break; + case AnalisesAcidentes.RH_FASE4_INDEX: + theClass = Integer.class; + break; + case AnalisesAcidentes.APAGADA_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.CONCLUIDO_POR_DESACTIVACAO_INDEX: + theClass = Boolean.class; + break; + case AnalisesAcidentes.DATA_DESACTIVACAO_INDEX: + theClass = java.util.Date.class; + break; + case AnalisesAcidentes.COMENTARIO_DESACTIVACAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.PARTICIPADO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.NOME_RESPONSAVEL_PARTICIPACAO_INDEX: + theClass = String.class; + break; + case AnalisesAcidentes.DATA_PARTICIPACAO_INDEX: + theClass = java.util.Date.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : AnalisesAcidentes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, AnalisesAcidentes.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Avisos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Avisos.java new file mode 100644 index 00000000..3af3bbca --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Avisos.java @@ -0,0 +1,776 @@ +/* +* Avisos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Avisos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Avisos.ID, Avisos.ID_INDEX ); + FIELD_INDEXES.put( Avisos.ID_FULL, Avisos.ID_INDEX ); + FIELD_INDEXES.put( Avisos.TIPO, Avisos.TIPO_INDEX ); + FIELD_INDEXES.put( Avisos.TIPO_FULL, Avisos.TIPO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Avisos.CLASS_IDENTIFIER, Avisos.EMPRESA_ID, Avisos.TO_EMPRESA_ID ); + FIELD_INDEXES.put( Avisos.EMPRESA_ID, Avisos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Avisos.EMPRESA_ID_FULL, Avisos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TO_EMPRESA_ID, Avisos.TO_EMPRESA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Avisos.CLASS_IDENTIFIER, Avisos.ESTABELECIMENTO_ID, Avisos.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( Avisos.ESTABELECIMENTO_ID, Avisos.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.ESTABELECIMENTO_ID_FULL, Avisos.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TO_ESTABELECIMENTO_ID, Avisos.TO_ESTABELECIMENTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Avisos.CLASS_IDENTIFIER, Avisos.TRABALHADOR_ID, Avisos.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( Avisos.TRABALHADOR_ID, Avisos.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TRABALHADOR_ID_FULL, Avisos.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TO_TRABALHADOR_ID, Avisos.TO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Avisos.EVENTO_ID, Avisos.EVENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.EVENTO_ID_FULL, Avisos.EVENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_AVISO, Avisos.DATA_AVISO_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_AVISO_FULL, Avisos.DATA_AVISO_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_EVENTO, Avisos.DATA_EVENTO_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_EVENTO_FULL, Avisos.DATA_EVENTO_INDEX ); + FIELD_INDEXES.put( Avisos.DESCRICAO, Avisos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Avisos.DESCRICAO_FULL, Avisos.DESCRICAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( Avisos.class, Avisos.EMPRESA_ID, db.data.siprp.outer.EmpresasData.class, db.data.siprp.outer.EmpresasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( Avisos.class, Avisos.ESTABELECIMENTO_ID, db.data.siprp.outer.EstabelecimentosData.class, db.data.siprp.outer.EstabelecimentosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( Avisos.class, Avisos.TRABALHADOR_ID, db.data.siprp.outer.TrabalhadoresData.class, db.data.siprp.outer.TrabalhadoresData.ID ); + + public static final String TABLENAME = "avisos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.avisos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "avisos.id"; + public static final int ID_INDEX = 0; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "avisos.tipo"; + public static final int TIPO_INDEX = 1; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "avisos.empresa_id"; + public static final int EMPRESA_ID_INDEX = 2; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "avisos.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 3; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "avisos.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 4; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "avisos.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 5; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "avisos.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 6; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "avisos.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 7; + public static final String EVENTO_ID = "evento_id"; + public static final String EVENTO_ID_FULL = "avisos.evento_id"; + public static final int EVENTO_ID_INDEX = 8; + public static final String DATA_AVISO = "data_aviso"; + public static final String DATA_AVISO_FULL = "avisos.data_aviso"; + public static final int DATA_AVISO_INDEX = 9; + public static final String DATA_EVENTO = "data_evento"; + public static final String DATA_EVENTO_FULL = "avisos.data_evento"; + public static final int DATA_EVENTO_INDEX = 10; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "avisos.descricao"; + public static final int DESCRICAO_INDEX = 11; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO, EMPRESA_ID, TO_EMPRESA_ID, ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, + TRABALHADOR_ID, TO_TRABALHADOR_ID, EVENTO_ID, DATA_AVISO, DATA_EVENTO, DESCRICAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + EVENTO_ID, TABLENAME + "." + DATA_AVISO, TABLENAME + "." + DATA_EVENTO, TABLENAME + "." + DESCRICAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO, EMPRESA_ID, ESTABELECIMENTO_ID, TRABALHADOR_ID, EVENTO_ID, DATA_AVISO, + DATA_EVENTO, DESCRICAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO, EMPRESA_ID, ESTABELECIMENTO_ID, TRABALHADOR_ID, EVENTO_ID, DATA_AVISO, + DATA_EVENTO, DESCRICAO, }; + + private Integer id; + private Integer tipo; + private Integer empresa_id; + private db.data.siprp.outer.EmpresasData to_empresa_id; + private Integer estabelecimento_id; + private db.data.siprp.outer.EstabelecimentosData to_estabelecimento_id; + private Integer trabalhador_id; + private db.data.siprp.outer.TrabalhadoresData to_trabalhador_id; + private Integer evento_id; + private java.util.Date data_aviso; + private java.util.Date data_evento; + private String descricao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Avisos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false, false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getEvento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EVENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.evento_id; + } + + public void setEvento_id( Integer evento_id ) + { + try + { + preProcess( EVENTO_ID, evento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.evento_id = evento_id; + LAZY_LOADED_OBJECTS.put( EVENTO_ID, Boolean.TRUE ); + } + + public java.util.Date getData_aviso() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_AVISO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_aviso; + } + + public void setData_aviso( java.util.Date data_aviso ) + { + try + { + preProcess( DATA_AVISO, data_aviso ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_aviso = data_aviso; + LAZY_LOADED_OBJECTS.put( DATA_AVISO, Boolean.TRUE ); + } + + public java.util.Date getData_evento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EVENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_evento; + } + + public void setData_evento( java.util.Date data_evento ) + { + try + { + preProcess( DATA_EVENTO, data_evento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_evento = data_evento; + LAZY_LOADED_OBJECTS.put( DATA_EVENTO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + value = getId(); + break; + case Avisos.TIPO_INDEX: + value = getTipo(); + break; + case Avisos.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case Avisos.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case Avisos.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case Avisos.EVENTO_ID_INDEX: + value = getEvento_id(); + break; + case Avisos.DATA_AVISO_INDEX: + value = getData_aviso(); + break; + case Avisos.DATA_EVENTO_INDEX: + value = getData_evento(); + break; + case Avisos.DESCRICAO_INDEX: + value = getDescricao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + value = this.id; + break; + case Avisos.TIPO_INDEX: + value = this.tipo; + break; + case Avisos.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case Avisos.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case Avisos.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case Avisos.EVENTO_ID_INDEX: + value = this.evento_id; + break; + case Avisos.DATA_AVISO_INDEX: + value = this.data_aviso; + break; + case Avisos.DATA_EVENTO_INDEX: + value = this.data_evento; + break; + case Avisos.DESCRICAO_INDEX: + value = this.descricao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Avisos.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case Avisos.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case Avisos.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp.outer.EmpresasData ) value ); + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp.outer.EstabelecimentosData ) value ); + break; + case Avisos.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp.outer.TrabalhadoresData ) value ); + break; + case Avisos.EVENTO_ID_INDEX: + setEvento_id( ( Integer ) value ); + break; + case Avisos.DATA_AVISO_INDEX: + setData_aviso( ( java.util.Date ) value ); + break; + case Avisos.DATA_EVENTO_INDEX: + setData_evento( ( java.util.Date ) value ); + break; + case Avisos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Avisos.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case Avisos.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case Avisos.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp.outer.EmpresasData ) value; + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp.outer.EstabelecimentosData ) value; + break; + case Avisos.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp.outer.TrabalhadoresData ) value; + break; + case Avisos.EVENTO_ID_INDEX: + this.evento_id = ( Integer ) value; + break; + case Avisos.DATA_AVISO_INDEX: + this.data_aviso = ( java.util.Date ) value; + break; + case Avisos.DATA_EVENTO_INDEX: + this.data_evento = ( java.util.Date ) value; + break; + case Avisos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Avisos.ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TIPO_INDEX: + theClass = Integer.class; + break; + case Avisos.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp.outer.EmpresasData.class; + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp.outer.EstabelecimentosData.class; + break; + case Avisos.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp.outer.TrabalhadoresData.class; + break; + case Avisos.EVENTO_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.DATA_AVISO_INDEX: + theClass = java.util.Date.class; + break; + case Avisos.DATA_EVENTO_INDEX: + theClass = java.util.Date.class; + break; + case Avisos.DESCRICAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Avisos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Avisos.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Causas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Causas.java new file mode 100644 index 00000000..5166f8d2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Causas.java @@ -0,0 +1,342 @@ +/* +* Causas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Causas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Causas.ID, Causas.ID_INDEX ); + FIELD_INDEXES.put( Causas.ID_FULL, Causas.ID_INDEX ); + FIELD_INDEXES.put( Causas.CAUSA, Causas.CAUSA_INDEX ); + FIELD_INDEXES.put( Causas.CAUSA_FULL, Causas.CAUSA_INDEX ); + FIELD_INDEXES.put( Causas.ACTIVA, Causas.ACTIVA_INDEX ); + FIELD_INDEXES.put( Causas.ACTIVA_FULL, Causas.ACTIVA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "causas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.causas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "causas.id"; + public static final int ID_INDEX = 0; + public static final String CAUSA = "causa"; + public static final String CAUSA_FULL = "causas.causa"; + public static final int CAUSA_INDEX = 1; + public static final String ACTIVA = "activa"; + public static final String ACTIVA_FULL = "causas.activa"; + public static final int ACTIVA_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + CAUSA, ACTIVA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CAUSA, TABLENAME + "." + ACTIVA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, CAUSA, ACTIVA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, CAUSA, ACTIVA, }; + + private Integer id; + private String causa; + private String activa; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Causas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getCausa() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAUSA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.causa; + } + + public void setCausa( String causa ) + { + try + { + preProcess( CAUSA, causa ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.causa = causa; + LAZY_LOADED_OBJECTS.put( CAUSA, Boolean.TRUE ); + } + + public String getActiva() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activa; + } + + public void setActiva( String activa ) + { + try + { + preProcess( ACTIVA, activa ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activa = activa; + LAZY_LOADED_OBJECTS.put( ACTIVA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Causas.ID_INDEX: + value = getId(); + break; + case Causas.CAUSA_INDEX: + value = getCausa(); + break; + case Causas.ACTIVA_INDEX: + value = getActiva(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Causas.ID_INDEX: + value = this.id; + break; + case Causas.CAUSA_INDEX: + value = this.causa; + break; + case Causas.ACTIVA_INDEX: + value = this.activa; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Causas.ID_INDEX: + setId( ( Integer ) value ); + break; + case Causas.CAUSA_INDEX: + setCausa( ( String ) value ); + break; + case Causas.ACTIVA_INDEX: + setActiva( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Causas.ID_INDEX: + this.id = ( Integer ) value; + break; + case Causas.CAUSA_INDEX: + this.causa = ( String ) value; + break; + case Causas.ACTIVA_INDEX: + this.activa = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Causas.ID_INDEX: + theClass = Integer.class; + break; + case Causas.CAUSA_INDEX: + theClass = String.class; + break; + case Causas.ACTIVA_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Causas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Causas.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Contactos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Contactos.java new file mode 100644 index 00000000..ed8806b0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Contactos.java @@ -0,0 +1,523 @@ +/* +* Contactos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Contactos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Contactos.ID, Contactos.ID_INDEX ); + FIELD_INDEXES.put( Contactos.ID_FULL, Contactos.ID_INDEX ); + FIELD_INDEXES.put( Contactos.NOME, Contactos.NOME_INDEX ); + FIELD_INDEXES.put( Contactos.NOME_FULL, Contactos.NOME_INDEX ); + FIELD_INDEXES.put( Contactos.TELEFONE, Contactos.TELEFONE_INDEX ); + FIELD_INDEXES.put( Contactos.TELEFONE_FULL, Contactos.TELEFONE_INDEX ); + FIELD_INDEXES.put( Contactos.TELEMOVEL, Contactos.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( Contactos.TELEMOVEL_FULL, Contactos.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( Contactos.FAX, Contactos.FAX_INDEX ); + FIELD_INDEXES.put( Contactos.FAX_FULL, Contactos.FAX_INDEX ); + FIELD_INDEXES.put( Contactos.EMAIL, Contactos.EMAIL_INDEX ); + FIELD_INDEXES.put( Contactos.EMAIL_FULL, Contactos.EMAIL_INDEX ); + FIELD_INDEXES.put( Contactos.CARGO, Contactos.CARGO_INDEX ); + FIELD_INDEXES.put( Contactos.CARGO_FULL, Contactos.CARGO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "contactos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.contactos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "contactos.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "contactos.nome"; + public static final int NOME_INDEX = 1; + public static final String TELEFONE = "telefone"; + public static final String TELEFONE_FULL = "contactos.telefone"; + public static final int TELEFONE_INDEX = 2; + public static final String TELEMOVEL = "telemovel"; + public static final String TELEMOVEL_FULL = "contactos.telemovel"; + public static final int TELEMOVEL_INDEX = 3; + public static final String FAX = "fax"; + public static final String FAX_FULL = "contactos.fax"; + public static final int FAX_INDEX = 4; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "contactos.email"; + public static final int EMAIL_INDEX = 5; + public static final String CARGO = "cargo"; + public static final String CARGO_FULL = "contactos.cargo"; + public static final int CARGO_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, TELEFONE, TELEMOVEL, FAX, EMAIL, CARGO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + TELEFONE, TABLENAME + "." + TELEMOVEL, TABLENAME + "." + FAX, TABLENAME + "." + EMAIL, TABLENAME + "." + CARGO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, TELEFONE, TELEMOVEL, FAX, EMAIL, CARGO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, TELEFONE, TELEMOVEL, FAX, EMAIL, CARGO, }; + + private Integer id; + private String nome; + private String telefone; + private String telemovel; + private String fax; + private String email; + private String cargo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Contactos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getTelefone() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEFONE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telefone; + } + + public void setTelefone( String telefone ) + { + try + { + preProcess( TELEFONE, telefone ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telefone = telefone; + LAZY_LOADED_OBJECTS.put( TELEFONE, Boolean.TRUE ); + } + + public String getTelemovel() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEMOVEL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telemovel; + } + + public void setTelemovel( String telemovel ) + { + try + { + preProcess( TELEMOVEL, telemovel ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telemovel = telemovel; + LAZY_LOADED_OBJECTS.put( TELEMOVEL, Boolean.TRUE ); + } + + public String getFax() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FAX ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fax; + } + + public void setFax( String fax ) + { + try + { + preProcess( FAX, fax ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fax = fax; + LAZY_LOADED_OBJECTS.put( FAX, Boolean.TRUE ); + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public String getCargo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CARGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cargo; + } + + public void setCargo( String cargo ) + { + try + { + preProcess( CARGO, cargo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cargo = cargo; + LAZY_LOADED_OBJECTS.put( CARGO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + value = getId(); + break; + case Contactos.NOME_INDEX: + value = getNome(); + break; + case Contactos.TELEFONE_INDEX: + value = getTelefone(); + break; + case Contactos.TELEMOVEL_INDEX: + value = getTelemovel(); + break; + case Contactos.FAX_INDEX: + value = getFax(); + break; + case Contactos.EMAIL_INDEX: + value = getEmail(); + break; + case Contactos.CARGO_INDEX: + value = getCargo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + value = this.id; + break; + case Contactos.NOME_INDEX: + value = this.nome; + break; + case Contactos.TELEFONE_INDEX: + value = this.telefone; + break; + case Contactos.TELEMOVEL_INDEX: + value = this.telemovel; + break; + case Contactos.FAX_INDEX: + value = this.fax; + break; + case Contactos.EMAIL_INDEX: + value = this.email; + break; + case Contactos.CARGO_INDEX: + value = this.cargo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Contactos.NOME_INDEX: + setNome( ( String ) value ); + break; + case Contactos.TELEFONE_INDEX: + setTelefone( ( String ) value ); + break; + case Contactos.TELEMOVEL_INDEX: + setTelemovel( ( String ) value ); + break; + case Contactos.FAX_INDEX: + setFax( ( String ) value ); + break; + case Contactos.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + case Contactos.CARGO_INDEX: + setCargo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Contactos.NOME_INDEX: + this.nome = ( String ) value; + break; + case Contactos.TELEFONE_INDEX: + this.telefone = ( String ) value; + break; + case Contactos.TELEMOVEL_INDEX: + this.telemovel = ( String ) value; + break; + case Contactos.FAX_INDEX: + this.fax = ( String ) value; + break; + case Contactos.EMAIL_INDEX: + this.email = ( String ) value; + break; + case Contactos.CARGO_INDEX: + this.cargo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Contactos.ID_INDEX: + theClass = Integer.class; + break; + case Contactos.NOME_INDEX: + theClass = String.class; + break; + case Contactos.TELEFONE_INDEX: + theClass = String.class; + break; + case Contactos.TELEMOVEL_INDEX: + theClass = String.class; + break; + case Contactos.FAX_INDEX: + theClass = String.class; + break; + case Contactos.EMAIL_INDEX: + theClass = String.class; + break; + case Contactos.CARGO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Contactos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Contactos.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Controle.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Controle.java new file mode 100644 index 00000000..8bc4ef70 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Controle.java @@ -0,0 +1,342 @@ +/* +* Controle.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Controle extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Controle.ID, Controle.ID_INDEX ); + FIELD_INDEXES.put( Controle.ID_FULL, Controle.ID_INDEX ); + FIELD_INDEXES.put( Controle.ANALISE_YEAR, Controle.ANALISE_YEAR_INDEX ); + FIELD_INDEXES.put( Controle.ANALISE_YEAR_FULL, Controle.ANALISE_YEAR_INDEX ); + FIELD_INDEXES.put( Controle.LAST_ANALISE_NR, Controle.LAST_ANALISE_NR_INDEX ); + FIELD_INDEXES.put( Controle.LAST_ANALISE_NR_FULL, Controle.LAST_ANALISE_NR_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "controle"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.controle"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "controle.id"; + public static final int ID_INDEX = 0; + public static final String ANALISE_YEAR = "analise_year"; + public static final String ANALISE_YEAR_FULL = "controle.analise_year"; + public static final int ANALISE_YEAR_INDEX = 1; + public static final String LAST_ANALISE_NR = "last_analise_nr"; + public static final String LAST_ANALISE_NR_FULL = "controle.last_analise_nr"; + public static final int LAST_ANALISE_NR_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + ANALISE_YEAR, LAST_ANALISE_NR, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ANALISE_YEAR, TABLENAME + "." + LAST_ANALISE_NR, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ANALISE_YEAR, LAST_ANALISE_NR, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ANALISE_YEAR, LAST_ANALISE_NR, }; + + private Integer id; + private Integer analise_year; + private Integer last_analise_nr; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Controle() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getAnalise_year() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISE_YEAR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analise_year; + } + + public void setAnalise_year( Integer analise_year ) + { + try + { + preProcess( ANALISE_YEAR, analise_year ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analise_year = analise_year; + LAZY_LOADED_OBJECTS.put( ANALISE_YEAR, Boolean.TRUE ); + } + + public Integer getLast_analise_nr() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LAST_ANALISE_NR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.last_analise_nr; + } + + public void setLast_analise_nr( Integer last_analise_nr ) + { + try + { + preProcess( LAST_ANALISE_NR, last_analise_nr ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.last_analise_nr = last_analise_nr; + LAZY_LOADED_OBJECTS.put( LAST_ANALISE_NR, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Controle.ID_INDEX: + value = getId(); + break; + case Controle.ANALISE_YEAR_INDEX: + value = getAnalise_year(); + break; + case Controle.LAST_ANALISE_NR_INDEX: + value = getLast_analise_nr(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Controle.ID_INDEX: + value = this.id; + break; + case Controle.ANALISE_YEAR_INDEX: + value = this.analise_year; + break; + case Controle.LAST_ANALISE_NR_INDEX: + value = this.last_analise_nr; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Controle.ID_INDEX: + setId( ( Integer ) value ); + break; + case Controle.ANALISE_YEAR_INDEX: + setAnalise_year( ( Integer ) value ); + break; + case Controle.LAST_ANALISE_NR_INDEX: + setLast_analise_nr( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Controle.ID_INDEX: + this.id = ( Integer ) value; + break; + case Controle.ANALISE_YEAR_INDEX: + this.analise_year = ( Integer ) value; + break; + case Controle.LAST_ANALISE_NR_INDEX: + this.last_analise_nr = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Controle.ID_INDEX: + theClass = Integer.class; + break; + case Controle.ANALISE_YEAR_INDEX: + theClass = Integer.class; + break; + case Controle.LAST_ANALISE_NR_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Controle._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Controle.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Departamentos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Departamentos.java new file mode 100644 index 00000000..bead6f0b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Departamentos.java @@ -0,0 +1,376 @@ +/* +* Departamentos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Departamentos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Departamentos.ID, Departamentos.ID_INDEX ); + FIELD_INDEXES.put( Departamentos.ID_FULL, Departamentos.ID_INDEX ); + FIELD_INDEXES.put( Departamentos.DESCRICAO, Departamentos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Departamentos.DESCRICAO_FULL, Departamentos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Departamentos.ACTIVO, Departamentos.ACTIVO_INDEX ); + FIELD_INDEXES.put( Departamentos.ACTIVO_FULL, Departamentos.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "departamentos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.departamentos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "departamentos.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "departamentos.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "departamentos.activo"; + public static final int ACTIVO_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, ACTIVO, }; + + private Integer id; + private String descricao; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Departamentos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAnalisesAcidentes_departamento_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AnalisesAcidentesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "departamento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromSeccoes_departamento_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.SeccoesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.SeccoesData.class , getPrimaryKey().getMap().get("id"), "departamento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Departamentos.ID_INDEX: + value = getId(); + break; + case Departamentos.DESCRICAO_INDEX: + value = getDescricao(); + break; + case Departamentos.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Departamentos.ID_INDEX: + value = this.id; + break; + case Departamentos.DESCRICAO_INDEX: + value = this.descricao; + break; + case Departamentos.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Departamentos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Departamentos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case Departamentos.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Departamentos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Departamentos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case Departamentos.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Departamentos.ID_INDEX: + theClass = Integer.class; + break; + case Departamentos.DESCRICAO_INDEX: + theClass = String.class; + break; + case Departamentos.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Departamentos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Departamentos.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Empresas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Empresas.java new file mode 100644 index 00000000..708c8283 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Empresas.java @@ -0,0 +1,1022 @@ +/* +* Empresas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Empresas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Empresas.ID, Empresas.ID_INDEX ); + FIELD_INDEXES.put( Empresas.ID_FULL, Empresas.ID_INDEX ); + FIELD_INDEXES.put( Empresas.MORADA, Empresas.MORADA_INDEX ); + FIELD_INDEXES.put( Empresas.MORADA_FULL, Empresas.MORADA_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_POSTAL, Empresas.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_POSTAL_FULL, Empresas.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Empresas.LOCALIDADE, Empresas.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.LOCALIDADE_FULL, Empresas.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.DISTRITO, Empresas.DISTRITO_INDEX ); + FIELD_INDEXES.put( Empresas.DISTRITO_FULL, Empresas.DISTRITO_INDEX ); + FIELD_INDEXES.put( Empresas.CONCELHO, Empresas.CONCELHO_INDEX ); + FIELD_INDEXES.put( Empresas.CONCELHO_FULL, Empresas.CONCELHO_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_1, Empresas.PERFIL_1_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_1_FULL, Empresas.PERFIL_1_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_2, Empresas.PERFIL_2_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_2_FULL, Empresas.PERFIL_2_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO, Empresas.CODIGO_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_FULL, Empresas.CODIGO_INDEX ); + FIELD_INDEXES.put( Empresas.CAE, Empresas.CAE_INDEX ); + FIELD_INDEXES.put( Empresas.CAE_FULL, Empresas.CAE_INDEX ); + FIELD_INDEXES.put( Empresas.CONTRIBUINTE, Empresas.CONTRIBUINTE_INDEX ); + FIELD_INDEXES.put( Empresas.CONTRIBUINTE_FULL, Empresas.CONTRIBUINTE_INDEX ); + FIELD_INDEXES.put( Empresas.SEGURANCA_SOCIAL, Empresas.SEGURANCA_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.SEGURANCA_SOCIAL_FULL, Empresas.SEGURANCA_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.ACTIVIDADE, Empresas.ACTIVIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.ACTIVIDADE_FULL, Empresas.ACTIVIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICOS, Empresas.SERVICOS_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICOS_FULL, Empresas.SERVICOS_INDEX ); + FIELD_INDEXES.put( Empresas.DESIGNACAO_SOCIAL, Empresas.DESIGNACAO_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.DESIGNACAO_SOCIAL_FULL, Empresas.DESIGNACAO_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.EMAIL, Empresas.EMAIL_INDEX ); + FIELD_INDEXES.put( Empresas.EMAIL_FULL, Empresas.EMAIL_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "empresas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.empresas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "empresas.id"; + public static final int ID_INDEX = 0; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "empresas.morada"; + public static final int MORADA_INDEX = 1; + public static final String CODIGO_POSTAL = "codigo_postal"; + public static final String CODIGO_POSTAL_FULL = "empresas.codigo_postal"; + public static final int CODIGO_POSTAL_INDEX = 2; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "empresas.localidade"; + public static final int LOCALIDADE_INDEX = 3; + public static final String DISTRITO = "distrito"; + public static final String DISTRITO_FULL = "empresas.distrito"; + public static final int DISTRITO_INDEX = 4; + public static final String CONCELHO = "concelho"; + public static final String CONCELHO_FULL = "empresas.concelho"; + public static final int CONCELHO_INDEX = 5; + public static final String PERFIL_1 = "perfil_1"; + public static final String PERFIL_1_FULL = "empresas.perfil_1"; + public static final int PERFIL_1_INDEX = 6; + public static final String PERFIL_2 = "perfil_2"; + public static final String PERFIL_2_FULL = "empresas.perfil_2"; + public static final int PERFIL_2_INDEX = 7; + public static final String CODIGO = "codigo"; + public static final String CODIGO_FULL = "empresas.codigo"; + public static final int CODIGO_INDEX = 8; + public static final String CAE = "cae"; + public static final String CAE_FULL = "empresas.cae"; + public static final int CAE_INDEX = 9; + public static final String CONTRIBUINTE = "contribuinte"; + public static final String CONTRIBUINTE_FULL = "empresas.contribuinte"; + public static final int CONTRIBUINTE_INDEX = 10; + public static final String SEGURANCA_SOCIAL = "seguranca_social"; + public static final String SEGURANCA_SOCIAL_FULL = "empresas.seguranca_social"; + public static final int SEGURANCA_SOCIAL_INDEX = 11; + public static final String ACTIVIDADE = "actividade"; + public static final String ACTIVIDADE_FULL = "empresas.actividade"; + public static final int ACTIVIDADE_INDEX = 12; + public static final String SERVICOS = "servicos"; + public static final String SERVICOS_FULL = "empresas.servicos"; + public static final int SERVICOS_INDEX = 13; + public static final String DESIGNACAO_SOCIAL = "designacao_social"; + public static final String DESIGNACAO_SOCIAL_FULL = "empresas.designacao_social"; + public static final int DESIGNACAO_SOCIAL_INDEX = 14; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "empresas.email"; + public static final int EMAIL_INDEX = 15; + + public static final String FIELD_NAMES[] = new String[]{ + MORADA, CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, PERFIL_1, PERFIL_2, CODIGO, CAE, + CONTRIBUINTE, SEGURANCA_SOCIAL, ACTIVIDADE, SERVICOS, DESIGNACAO_SOCIAL, EMAIL, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + MORADA, TABLENAME + "." + CODIGO_POSTAL, TABLENAME + "." + LOCALIDADE, TABLENAME + "." + DISTRITO, TABLENAME + "." + CONCELHO, TABLENAME + "." + PERFIL_1, TABLENAME + "." + PERFIL_2, TABLENAME + "." + CODIGO, TABLENAME + "." + CAE, + TABLENAME + "." + CONTRIBUINTE, TABLENAME + "." + SEGURANCA_SOCIAL, TABLENAME + "." + ACTIVIDADE, TABLENAME + "." + SERVICOS, TABLENAME + "." + DESIGNACAO_SOCIAL, TABLENAME + "." + EMAIL, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, MORADA, CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, PERFIL_1, PERFIL_2, CODIGO, + CAE, CONTRIBUINTE, SEGURANCA_SOCIAL, ACTIVIDADE, SERVICOS, DESIGNACAO_SOCIAL, + EMAIL, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, MORADA, CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, PERFIL_1, PERFIL_2, CODIGO, + CAE, CONTRIBUINTE, SEGURANCA_SOCIAL, ACTIVIDADE, SERVICOS, DESIGNACAO_SOCIAL, + EMAIL, }; + + private Integer id; + private String morada; + private String codigo_postal; + private String localidade; + private String distrito; + private String concelho; + private Integer perfil_1; + private Integer perfil_2; + private String codigo; + private String cae; + private String contribuinte; + private String seguranca_social; + private String actividade; + private Integer servicos; + private String designacao_social; + private String email; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Empresas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAvisos_empresa_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AvisosData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromEstabelecimentos_empresa_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.EstabelecimentosData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromMarcacoesEmpresa_empresa_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.MarcacoesEmpresaData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.MarcacoesEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCodigo_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_postal; + } + + public void setCodigo_postal( String codigo_postal ) + { + try + { + preProcess( CODIGO_POSTAL, codigo_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_postal = codigo_postal; + LAZY_LOADED_OBJECTS.put( CODIGO_POSTAL, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public String getDistrito() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DISTRITO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.distrito; + } + + public void setDistrito( String distrito ) + { + try + { + preProcess( DISTRITO, distrito ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.distrito = distrito; + LAZY_LOADED_OBJECTS.put( DISTRITO, Boolean.TRUE ); + } + + public String getConcelho() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONCELHO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.concelho; + } + + public void setConcelho( String concelho ) + { + try + { + preProcess( CONCELHO, concelho ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.concelho = concelho; + LAZY_LOADED_OBJECTS.put( CONCELHO, Boolean.TRUE ); + } + + public Integer getPerfil_1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL_1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil_1; + } + + public void setPerfil_1( Integer perfil_1 ) + { + try + { + preProcess( PERFIL_1, perfil_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil_1 = perfil_1; + LAZY_LOADED_OBJECTS.put( PERFIL_1, Boolean.TRUE ); + } + + public Integer getPerfil_2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL_2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil_2; + } + + public void setPerfil_2( Integer perfil_2 ) + { + try + { + preProcess( PERFIL_2, perfil_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil_2 = perfil_2; + LAZY_LOADED_OBJECTS.put( PERFIL_2, Boolean.TRUE ); + } + + public String getCodigo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo; + } + + public void setCodigo( String codigo ) + { + try + { + preProcess( CODIGO, codigo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo = codigo; + LAZY_LOADED_OBJECTS.put( CODIGO, Boolean.TRUE ); + } + + public String getCae() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cae; + } + + public void setCae( String cae ) + { + try + { + preProcess( CAE, cae ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cae = cae; + LAZY_LOADED_OBJECTS.put( CAE, Boolean.TRUE ); + } + + public String getContribuinte() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTRIBUINTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contribuinte; + } + + public void setContribuinte( String contribuinte ) + { + try + { + preProcess( CONTRIBUINTE, contribuinte ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contribuinte = contribuinte; + LAZY_LOADED_OBJECTS.put( CONTRIBUINTE, Boolean.TRUE ); + } + + public String getSeguranca_social() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEGURANCA_SOCIAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.seguranca_social; + } + + public void setSeguranca_social( String seguranca_social ) + { + try + { + preProcess( SEGURANCA_SOCIAL, seguranca_social ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.seguranca_social = seguranca_social; + LAZY_LOADED_OBJECTS.put( SEGURANCA_SOCIAL, Boolean.TRUE ); + } + + public String getActividade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.actividade; + } + + public void setActividade( String actividade ) + { + try + { + preProcess( ACTIVIDADE, actividade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.actividade = actividade; + LAZY_LOADED_OBJECTS.put( ACTIVIDADE, Boolean.TRUE ); + } + + public Integer getServicos() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SERVICOS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.servicos; + } + + public void setServicos( Integer servicos ) + { + try + { + preProcess( SERVICOS, servicos ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.servicos = servicos; + LAZY_LOADED_OBJECTS.put( SERVICOS, Boolean.TRUE ); + } + + public String getDesignacao_social() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESIGNACAO_SOCIAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.designacao_social; + } + + public void setDesignacao_social( String designacao_social ) + { + try + { + preProcess( DESIGNACAO_SOCIAL, designacao_social ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.designacao_social = designacao_social; + LAZY_LOADED_OBJECTS.put( DESIGNACAO_SOCIAL, Boolean.TRUE ); + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + value = getId(); + break; + case Empresas.MORADA_INDEX: + value = getMorada(); + break; + case Empresas.CODIGO_POSTAL_INDEX: + value = getCodigo_postal(); + break; + case Empresas.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case Empresas.DISTRITO_INDEX: + value = getDistrito(); + break; + case Empresas.CONCELHO_INDEX: + value = getConcelho(); + break; + case Empresas.PERFIL_1_INDEX: + value = getPerfil_1(); + break; + case Empresas.PERFIL_2_INDEX: + value = getPerfil_2(); + break; + case Empresas.CODIGO_INDEX: + value = getCodigo(); + break; + case Empresas.CAE_INDEX: + value = getCae(); + break; + case Empresas.CONTRIBUINTE_INDEX: + value = getContribuinte(); + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + value = getSeguranca_social(); + break; + case Empresas.ACTIVIDADE_INDEX: + value = getActividade(); + break; + case Empresas.SERVICOS_INDEX: + value = getServicos(); + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + value = getDesignacao_social(); + break; + case Empresas.EMAIL_INDEX: + value = getEmail(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + value = this.id; + break; + case Empresas.MORADA_INDEX: + value = this.morada; + break; + case Empresas.CODIGO_POSTAL_INDEX: + value = this.codigo_postal; + break; + case Empresas.LOCALIDADE_INDEX: + value = this.localidade; + break; + case Empresas.DISTRITO_INDEX: + value = this.distrito; + break; + case Empresas.CONCELHO_INDEX: + value = this.concelho; + break; + case Empresas.PERFIL_1_INDEX: + value = this.perfil_1; + break; + case Empresas.PERFIL_2_INDEX: + value = this.perfil_2; + break; + case Empresas.CODIGO_INDEX: + value = this.codigo; + break; + case Empresas.CAE_INDEX: + value = this.cae; + break; + case Empresas.CONTRIBUINTE_INDEX: + value = this.contribuinte; + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + value = this.seguranca_social; + break; + case Empresas.ACTIVIDADE_INDEX: + value = this.actividade; + break; + case Empresas.SERVICOS_INDEX: + value = this.servicos; + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + value = this.designacao_social; + break; + case Empresas.EMAIL_INDEX: + value = this.email; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + setId( ( Integer ) value ); + break; + case Empresas.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case Empresas.CODIGO_POSTAL_INDEX: + setCodigo_postal( ( String ) value ); + break; + case Empresas.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case Empresas.DISTRITO_INDEX: + setDistrito( ( String ) value ); + break; + case Empresas.CONCELHO_INDEX: + setConcelho( ( String ) value ); + break; + case Empresas.PERFIL_1_INDEX: + setPerfil_1( ( Integer ) value ); + break; + case Empresas.PERFIL_2_INDEX: + setPerfil_2( ( Integer ) value ); + break; + case Empresas.CODIGO_INDEX: + setCodigo( ( String ) value ); + break; + case Empresas.CAE_INDEX: + setCae( ( String ) value ); + break; + case Empresas.CONTRIBUINTE_INDEX: + setContribuinte( ( String ) value ); + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + setSeguranca_social( ( String ) value ); + break; + case Empresas.ACTIVIDADE_INDEX: + setActividade( ( String ) value ); + break; + case Empresas.SERVICOS_INDEX: + setServicos( ( Integer ) value ); + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + setDesignacao_social( ( String ) value ); + break; + case Empresas.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + this.id = ( Integer ) value; + break; + case Empresas.MORADA_INDEX: + this.morada = ( String ) value; + break; + case Empresas.CODIGO_POSTAL_INDEX: + this.codigo_postal = ( String ) value; + break; + case Empresas.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case Empresas.DISTRITO_INDEX: + this.distrito = ( String ) value; + break; + case Empresas.CONCELHO_INDEX: + this.concelho = ( String ) value; + break; + case Empresas.PERFIL_1_INDEX: + this.perfil_1 = ( Integer ) value; + break; + case Empresas.PERFIL_2_INDEX: + this.perfil_2 = ( Integer ) value; + break; + case Empresas.CODIGO_INDEX: + this.codigo = ( String ) value; + break; + case Empresas.CAE_INDEX: + this.cae = ( String ) value; + break; + case Empresas.CONTRIBUINTE_INDEX: + this.contribuinte = ( String ) value; + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + this.seguranca_social = ( String ) value; + break; + case Empresas.ACTIVIDADE_INDEX: + this.actividade = ( String ) value; + break; + case Empresas.SERVICOS_INDEX: + this.servicos = ( Integer ) value; + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + this.designacao_social = ( String ) value; + break; + case Empresas.EMAIL_INDEX: + this.email = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Empresas.ID_INDEX: + theClass = Integer.class; + break; + case Empresas.MORADA_INDEX: + theClass = String.class; + break; + case Empresas.CODIGO_POSTAL_INDEX: + theClass = String.class; + break; + case Empresas.LOCALIDADE_INDEX: + theClass = String.class; + break; + case Empresas.DISTRITO_INDEX: + theClass = String.class; + break; + case Empresas.CONCELHO_INDEX: + theClass = String.class; + break; + case Empresas.PERFIL_1_INDEX: + theClass = Integer.class; + break; + case Empresas.PERFIL_2_INDEX: + theClass = Integer.class; + break; + case Empresas.CODIGO_INDEX: + theClass = String.class; + break; + case Empresas.CAE_INDEX: + theClass = String.class; + break; + case Empresas.CONTRIBUINTE_INDEX: + theClass = String.class; + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + theClass = String.class; + break; + case Empresas.ACTIVIDADE_INDEX: + theClass = String.class; + break; + case Empresas.SERVICOS_INDEX: + theClass = Integer.class; + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + theClass = String.class; + break; + case Empresas.EMAIL_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Empresas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Empresas.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Errors.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Errors.java new file mode 100644 index 00000000..57d3a692 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Errors.java @@ -0,0 +1,425 @@ +/* +* Errors.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Errors extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Errors.ID, Errors.ID_INDEX ); + FIELD_INDEXES.put( Errors.ID_FULL, Errors.ID_INDEX ); + FIELD_INDEXES.put( Errors.DATE, Errors.DATE_INDEX ); + FIELD_INDEXES.put( Errors.DATE_FULL, Errors.DATE_INDEX ); + FIELD_INDEXES.put( Errors.TYPE, Errors.TYPE_INDEX ); + FIELD_INDEXES.put( Errors.TYPE_FULL, Errors.TYPE_INDEX ); + FIELD_INDEXES.put( Errors.ENVIRONMENT, Errors.ENVIRONMENT_INDEX ); + FIELD_INDEXES.put( Errors.ENVIRONMENT_FULL, Errors.ENVIRONMENT_INDEX ); + FIELD_INDEXES.put( Errors.DESCRIPTION, Errors.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( Errors.DESCRIPTION_FULL, Errors.DESCRIPTION_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "errors"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.errors"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "errors.id"; + public static final int ID_INDEX = 0; + public static final String DATE = "date"; + public static final String DATE_FULL = "errors.date"; + public static final int DATE_INDEX = 1; + public static final String TYPE = "type"; + public static final String TYPE_FULL = "errors.type"; + public static final int TYPE_INDEX = 2; + public static final String ENVIRONMENT = "environment"; + public static final String ENVIRONMENT_FULL = "errors.environment"; + public static final int ENVIRONMENT_INDEX = 3; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "errors.description"; + public static final int DESCRIPTION_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DATE, TYPE, ENVIRONMENT, DESCRIPTION, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATE, TABLENAME + "." + TYPE, TABLENAME + "." + ENVIRONMENT, TABLENAME + "." + DESCRIPTION, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATE, TYPE, ENVIRONMENT, DESCRIPTION, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATE, TYPE, ENVIRONMENT, DESCRIPTION, }; + + private Integer id; + private java.sql.Timestamp date; + private String type; + private String environment; + private String description; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Errors() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getDate() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.date; + } + + public void setDate( java.sql.Timestamp date ) + { + try + { + preProcess( DATE, date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.date = date; + LAZY_LOADED_OBJECTS.put( DATE, Boolean.TRUE ); + } + + public String getType() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TYPE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.type; + } + + public void setType( String type ) + { + try + { + preProcess( TYPE, type ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.type = type; + LAZY_LOADED_OBJECTS.put( TYPE, Boolean.TRUE ); + } + + public String getEnvironment() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ENVIRONMENT ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.environment; + } + + public void setEnvironment( String environment ) + { + try + { + preProcess( ENVIRONMENT, environment ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.environment = environment; + LAZY_LOADED_OBJECTS.put( ENVIRONMENT, Boolean.TRUE ); + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + value = getId(); + break; + case Errors.DATE_INDEX: + value = getDate(); + break; + case Errors.TYPE_INDEX: + value = getType(); + break; + case Errors.ENVIRONMENT_INDEX: + value = getEnvironment(); + break; + case Errors.DESCRIPTION_INDEX: + value = getDescription(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + value = this.id; + break; + case Errors.DATE_INDEX: + value = this.date; + break; + case Errors.TYPE_INDEX: + value = this.type; + break; + case Errors.ENVIRONMENT_INDEX: + value = this.environment; + break; + case Errors.DESCRIPTION_INDEX: + value = this.description; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + setId( ( Integer ) value ); + break; + case Errors.DATE_INDEX: + setDate( ( java.sql.Timestamp ) value ); + break; + case Errors.TYPE_INDEX: + setType( ( String ) value ); + break; + case Errors.ENVIRONMENT_INDEX: + setEnvironment( ( String ) value ); + break; + case Errors.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + this.id = ( Integer ) value; + break; + case Errors.DATE_INDEX: + this.date = ( java.sql.Timestamp ) value; + break; + case Errors.TYPE_INDEX: + this.type = ( String ) value; + break; + case Errors.ENVIRONMENT_INDEX: + this.environment = ( String ) value; + break; + case Errors.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Errors.ID_INDEX: + theClass = Integer.class; + break; + case Errors.DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Errors.TYPE_INDEX: + theClass = String.class; + break; + case Errors.ENVIRONMENT_INDEX: + theClass = String.class; + break; + case Errors.DESCRIPTION_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Errors._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Errors.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Estabelecimentos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Estabelecimentos.java new file mode 100644 index 00000000..976d100a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Estabelecimentos.java @@ -0,0 +1,775 @@ +/* +* Estabelecimentos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Estabelecimentos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Estabelecimentos.ID, Estabelecimentos.ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.ID_FULL, Estabelecimentos.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Estabelecimentos.CLASS_IDENTIFIER, Estabelecimentos.EMPRESA_ID, Estabelecimentos.TO_EMPRESA_ID ); + FIELD_INDEXES.put( Estabelecimentos.EMPRESA_ID, Estabelecimentos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.EMPRESA_ID_FULL, Estabelecimentos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.TO_EMPRESA_ID, Estabelecimentos.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MORADA, Estabelecimentos.MORADA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MORADA_FULL, Estabelecimentos.MORADA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CODIGO_POSTAL, Estabelecimentos.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CODIGO_POSTAL_FULL, Estabelecimentos.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.LOCALIDADE, Estabelecimentos.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.LOCALIDADE_FULL, Estabelecimentos.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.ULTIMA_VISITA, Estabelecimentos.ULTIMA_VISITA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.ULTIMA_VISITA_FULL, Estabelecimentos.ULTIMA_VISITA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.REALIZADA, Estabelecimentos.REALIZADA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.REALIZADA_FULL, Estabelecimentos.REALIZADA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.PROXIMA_VISITA, Estabelecimentos.PROXIMA_VISITA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.PROXIMA_VISITA_FULL, Estabelecimentos.PROXIMA_VISITA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.NOME, Estabelecimentos.NOME_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.NOME_FULL, Estabelecimentos.NOME_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MEDICO_ID, Estabelecimentos.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MEDICO_ID_FULL, Estabelecimentos.MEDICO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( Estabelecimentos.class, Estabelecimentos.EMPRESA_ID, db.data.siprp.outer.EmpresasData.class, db.data.siprp.outer.EmpresasData.ID ); + + public static final String TABLENAME = "estabelecimentos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.estabelecimentos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "estabelecimentos.id"; + public static final int ID_INDEX = 0; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "estabelecimentos.empresa_id"; + public static final int EMPRESA_ID_INDEX = 1; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "estabelecimentos.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 2; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "estabelecimentos.morada"; + public static final int MORADA_INDEX = 3; + public static final String CODIGO_POSTAL = "codigo_postal"; + public static final String CODIGO_POSTAL_FULL = "estabelecimentos.codigo_postal"; + public static final int CODIGO_POSTAL_INDEX = 4; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "estabelecimentos.localidade"; + public static final int LOCALIDADE_INDEX = 5; + public static final String ULTIMA_VISITA = "ultima_visita"; + public static final String ULTIMA_VISITA_FULL = "estabelecimentos.ultima_visita"; + public static final int ULTIMA_VISITA_INDEX = 6; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "estabelecimentos.realizada"; + public static final int REALIZADA_INDEX = 7; + public static final String PROXIMA_VISITA = "proxima_visita"; + public static final String PROXIMA_VISITA_FULL = "estabelecimentos.proxima_visita"; + public static final int PROXIMA_VISITA_INDEX = 8; + public static final String NOME = "nome"; + public static final String NOME_FULL = "estabelecimentos.nome"; + public static final int NOME_INDEX = 9; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "estabelecimentos.medico_id"; + public static final int MEDICO_ID_INDEX = 10; + + public static final String FIELD_NAMES[] = new String[]{ + EMPRESA_ID, TO_EMPRESA_ID, MORADA, CODIGO_POSTAL, LOCALIDADE, ULTIMA_VISITA, + REALIZADA, PROXIMA_VISITA, NOME, MEDICO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + MORADA, TABLENAME + "." + CODIGO_POSTAL, TABLENAME + "." + LOCALIDADE, TABLENAME + "." + ULTIMA_VISITA, + TABLENAME + "." + REALIZADA, TABLENAME + "." + PROXIMA_VISITA, TABLENAME + "." + NOME, TABLENAME + "." + MEDICO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, EMPRESA_ID, MORADA, CODIGO_POSTAL, LOCALIDADE, ULTIMA_VISITA, REALIZADA, + PROXIMA_VISITA, NOME, MEDICO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, EMPRESA_ID, MORADA, CODIGO_POSTAL, LOCALIDADE, ULTIMA_VISITA, REALIZADA, + PROXIMA_VISITA, NOME, MEDICO_ID, }; + + private Integer id; + private Integer empresa_id; + private db.data.siprp.outer.EmpresasData to_empresa_id; + private String morada; + private String codigo_postal; + private String localidade; + private java.util.Date ultima_visita; + private String realizada; + private java.util.Date proxima_visita; + private String nome; + private Integer medico_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Estabelecimentos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAvisos_estabelecimento_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AvisosData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromHistoricoEstabelecimento_estabelecimento_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.HistoricoEstabelecimentoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.HistoricoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromTrabalhadores_estabelecimento_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.TrabalhadoresData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.TrabalhadoresData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCodigo_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_postal; + } + + public void setCodigo_postal( String codigo_postal ) + { + try + { + preProcess( CODIGO_POSTAL, codigo_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_postal = codigo_postal; + LAZY_LOADED_OBJECTS.put( CODIGO_POSTAL, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public java.util.Date getUltima_visita() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ULTIMA_VISITA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ultima_visita; + } + + public void setUltima_visita( java.util.Date ultima_visita ) + { + try + { + preProcess( ULTIMA_VISITA, ultima_visita ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ultima_visita = ultima_visita; + LAZY_LOADED_OBJECTS.put( ULTIMA_VISITA, Boolean.TRUE ); + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public java.util.Date getProxima_visita() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROXIMA_VISITA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.proxima_visita; + } + + public void setProxima_visita( java.util.Date proxima_visita ) + { + try + { + preProcess( PROXIMA_VISITA, proxima_visita ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.proxima_visita = proxima_visita; + LAZY_LOADED_OBJECTS.put( PROXIMA_VISITA, Boolean.TRUE ); + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + value = getId(); + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case Estabelecimentos.MORADA_INDEX: + value = getMorada(); + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + value = getCodigo_postal(); + break; + case Estabelecimentos.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case Estabelecimentos.ULTIMA_VISITA_INDEX: + value = getUltima_visita(); + break; + case Estabelecimentos.REALIZADA_INDEX: + value = getRealizada(); + break; + case Estabelecimentos.PROXIMA_VISITA_INDEX: + value = getProxima_visita(); + break; + case Estabelecimentos.NOME_INDEX: + value = getNome(); + break; + case Estabelecimentos.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + value = this.id; + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case Estabelecimentos.MORADA_INDEX: + value = this.morada; + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + value = this.codigo_postal; + break; + case Estabelecimentos.LOCALIDADE_INDEX: + value = this.localidade; + break; + case Estabelecimentos.ULTIMA_VISITA_INDEX: + value = this.ultima_visita; + break; + case Estabelecimentos.REALIZADA_INDEX: + value = this.realizada; + break; + case Estabelecimentos.PROXIMA_VISITA_INDEX: + value = this.proxima_visita; + break; + case Estabelecimentos.NOME_INDEX: + value = this.nome; + break; + case Estabelecimentos.MEDICO_ID_INDEX: + value = this.medico_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp.outer.EmpresasData ) value ); + break; + case Estabelecimentos.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + setCodigo_postal( ( String ) value ); + break; + case Estabelecimentos.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case Estabelecimentos.ULTIMA_VISITA_INDEX: + setUltima_visita( ( java.util.Date ) value ); + break; + case Estabelecimentos.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + case Estabelecimentos.PROXIMA_VISITA_INDEX: + setProxima_visita( ( java.util.Date ) value ); + break; + case Estabelecimentos.NOME_INDEX: + setNome( ( String ) value ); + break; + case Estabelecimentos.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp.outer.EmpresasData ) value; + break; + case Estabelecimentos.MORADA_INDEX: + this.morada = ( String ) value; + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + this.codigo_postal = ( String ) value; + break; + case Estabelecimentos.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case Estabelecimentos.ULTIMA_VISITA_INDEX: + this.ultima_visita = ( java.util.Date ) value; + break; + case Estabelecimentos.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + case Estabelecimentos.PROXIMA_VISITA_INDEX: + this.proxima_visita = ( java.util.Date ) value; + break; + case Estabelecimentos.NOME_INDEX: + this.nome = ( String ) value; + break; + case Estabelecimentos.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Estabelecimentos.ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp.outer.EmpresasData.class; + break; + case Estabelecimentos.MORADA_INDEX: + theClass = String.class; + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + theClass = String.class; + break; + case Estabelecimentos.LOCALIDADE_INDEX: + theClass = String.class; + break; + case Estabelecimentos.ULTIMA_VISITA_INDEX: + theClass = java.util.Date.class; + break; + case Estabelecimentos.REALIZADA_INDEX: + theClass = String.class; + break; + case Estabelecimentos.PROXIMA_VISITA_INDEX: + theClass = java.util.Date.class; + break; + case Estabelecimentos.NOME_INDEX: + theClass = String.class; + break; + case Estabelecimentos.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Estabelecimentos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Estabelecimentos.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/EstadoMedidas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/EstadoMedidas.java new file mode 100644 index 00000000..bb0f5a02 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/EstadoMedidas.java @@ -0,0 +1,409 @@ +/* +* EstadoMedidas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class EstadoMedidas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EstadoMedidas.ID, EstadoMedidas.ID_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.ID_FULL, EstadoMedidas.ID_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.DESCRICAO, EstadoMedidas.DESCRICAO_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.DESCRICAO_FULL, EstadoMedidas.DESCRICAO_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.ORDEM, EstadoMedidas.ORDEM_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.ORDEM_FULL, EstadoMedidas.ORDEM_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.ACTIVO, EstadoMedidas.ACTIVO_INDEX ); + FIELD_INDEXES.put( EstadoMedidas.ACTIVO_FULL, EstadoMedidas.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "estado_medidas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.estado_medidas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "estado_medidas.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "estado_medidas.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "estado_medidas.ordem"; + public static final int ORDEM_INDEX = 2; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "estado_medidas.activo"; + public static final int ACTIVO_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, ORDEM, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + ORDEM, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, ORDEM, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, ORDEM, ACTIVO, }; + + private Integer id; + private String descricao; + private Integer ordem; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EstadoMedidas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPlanoMedidas_estado_medidas_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoMedidasData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanoMedidasData.class , getPrimaryKey().getMap().get("id"), "estado_medidas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EstadoMedidas.ID_INDEX: + value = getId(); + break; + case EstadoMedidas.DESCRICAO_INDEX: + value = getDescricao(); + break; + case EstadoMedidas.ORDEM_INDEX: + value = getOrdem(); + break; + case EstadoMedidas.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EstadoMedidas.ID_INDEX: + value = this.id; + break; + case EstadoMedidas.DESCRICAO_INDEX: + value = this.descricao; + break; + case EstadoMedidas.ORDEM_INDEX: + value = this.ordem; + break; + case EstadoMedidas.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EstadoMedidas.ID_INDEX: + setId( ( Integer ) value ); + break; + case EstadoMedidas.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case EstadoMedidas.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case EstadoMedidas.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EstadoMedidas.ID_INDEX: + this.id = ( Integer ) value; + break; + case EstadoMedidas.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case EstadoMedidas.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case EstadoMedidas.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EstadoMedidas.ID_INDEX: + theClass = Integer.class; + break; + case EstadoMedidas.DESCRICAO_INDEX: + theClass = String.class; + break; + case EstadoMedidas.ORDEM_INDEX: + theClass = Integer.class; + break; + case EstadoMedidas.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EstadoMedidas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EstadoMedidas.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Exames.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Exames.java new file mode 100644 index 00000000..c4a2a033 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Exames.java @@ -0,0 +1,1080 @@ +/* +* Exames.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Exames extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Exames.ID, Exames.ID_INDEX ); + FIELD_INDEXES.put( Exames.ID_FULL, Exames.ID_INDEX ); + FIELD_INDEXES.put( Exames.DATA, Exames.DATA_INDEX ); + FIELD_INDEXES.put( Exames.DATA_FULL, Exames.DATA_INDEX ); + FIELD_INDEXES.put( Exames.TIPO, Exames.TIPO_INDEX ); + FIELD_INDEXES.put( Exames.TIPO_FULL, Exames.TIPO_INDEX ); + FIELD_INDEXES.put( Exames.OCASIONAL, Exames.OCASIONAL_INDEX ); + FIELD_INDEXES.put( Exames.OCASIONAL_FULL, Exames.OCASIONAL_INDEX ); + FIELD_INDEXES.put( Exames.OUTRO_TIPO, Exames.OUTRO_TIPO_INDEX ); + FIELD_INDEXES.put( Exames.OUTRO_TIPO_FULL, Exames.OUTRO_TIPO_INDEX ); + FIELD_INDEXES.put( Exames.RESULTADO, Exames.RESULTADO_INDEX ); + FIELD_INDEXES.put( Exames.RESULTADO_FULL, Exames.RESULTADO_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_1, Exames.OUTRA_FUNCAO_1_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_1_FULL, Exames.OUTRA_FUNCAO_1_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_2, Exames.OUTRA_FUNCAO_2_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_2_FULL, Exames.OUTRA_FUNCAO_2_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_3, Exames.OUTRA_FUNCAO_3_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_3_FULL, Exames.OUTRA_FUNCAO_3_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_4, Exames.OUTRA_FUNCAO_4_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_4_FULL, Exames.OUTRA_FUNCAO_4_INDEX ); + FIELD_INDEXES.put( Exames.PROXIMO_EXAME, Exames.PROXIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Exames.PROXIMO_EXAME_FULL, Exames.PROXIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Exames.OUTRAS_RECOMENDACOES, Exames.OUTRAS_RECOMENDACOES_INDEX ); + FIELD_INDEXES.put( Exames.OUTRAS_RECOMENDACOES_FULL, Exames.OUTRAS_RECOMENDACOES_INDEX ); + FIELD_INDEXES.put( Exames.INACTIVO, Exames.INACTIVO_INDEX ); + FIELD_INDEXES.put( Exames.INACTIVO_FULL, Exames.INACTIVO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Exames.CLASS_IDENTIFIER, Exames.TRABALHADOR_ID, Exames.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( Exames.TRABALHADOR_ID, Exames.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Exames.TRABALHADOR_ID_FULL, Exames.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Exames.TO_TRABALHADOR_ID, Exames.TO_TRABALHADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Exames.CLASS_IDENTIFIER, Exames.MEDICO_ID, Exames.TO_MEDICO_ID ); + FIELD_INDEXES.put( Exames.MEDICO_ID, Exames.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Exames.MEDICO_ID_FULL, Exames.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Exames.TO_MEDICO_ID, Exames.TO_MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Exames.PDF, Exames.PDF_INDEX ); + FIELD_INDEXES.put( Exames.PDF_FULL, Exames.PDF_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( Exames.class, Exames.TRABALHADOR_ID, db.data.siprp.outer.TrabalhadoresData.class, db.data.siprp.outer.TrabalhadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymedico_idTomedicos = + new com.evolute.entity.ForeignKey( Exames.class, Exames.MEDICO_ID, db.data.siprp.outer.MedicosData.class, db.data.siprp.outer.MedicosData.ID ); + + public static final String TABLENAME = "exames"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.exames"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "exames.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "exames.data"; + public static final int DATA_INDEX = 1; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "exames.tipo"; + public static final int TIPO_INDEX = 2; + public static final String OCASIONAL = "ocasional"; + public static final String OCASIONAL_FULL = "exames.ocasional"; + public static final int OCASIONAL_INDEX = 3; + public static final String OUTRO_TIPO = "outro_tipo"; + public static final String OUTRO_TIPO_FULL = "exames.outro_tipo"; + public static final int OUTRO_TIPO_INDEX = 4; + public static final String RESULTADO = "resultado"; + public static final String RESULTADO_FULL = "exames.resultado"; + public static final int RESULTADO_INDEX = 5; + public static final String OUTRA_FUNCAO_1 = "outra_funcao_1"; + public static final String OUTRA_FUNCAO_1_FULL = "exames.outra_funcao_1"; + public static final int OUTRA_FUNCAO_1_INDEX = 6; + public static final String OUTRA_FUNCAO_2 = "outra_funcao_2"; + public static final String OUTRA_FUNCAO_2_FULL = "exames.outra_funcao_2"; + public static final int OUTRA_FUNCAO_2_INDEX = 7; + public static final String OUTRA_FUNCAO_3 = "outra_funcao_3"; + public static final String OUTRA_FUNCAO_3_FULL = "exames.outra_funcao_3"; + public static final int OUTRA_FUNCAO_3_INDEX = 8; + public static final String OUTRA_FUNCAO_4 = "outra_funcao_4"; + public static final String OUTRA_FUNCAO_4_FULL = "exames.outra_funcao_4"; + public static final int OUTRA_FUNCAO_4_INDEX = 9; + public static final String PROXIMO_EXAME = "proximo_exame"; + public static final String PROXIMO_EXAME_FULL = "exames.proximo_exame"; + public static final int PROXIMO_EXAME_INDEX = 10; + public static final String OUTRAS_RECOMENDACOES = "outras_recomendacoes"; + public static final String OUTRAS_RECOMENDACOES_FULL = "exames.outras_recomendacoes"; + public static final int OUTRAS_RECOMENDACOES_INDEX = 11; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "exames.inactivo"; + public static final int INACTIVO_INDEX = 12; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "exames.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 13; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "exames.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 14; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "exames.medico_id"; + public static final int MEDICO_ID_INDEX = 15; + public static final String TO_MEDICO_ID = "to_medico_id"; + public static final String TO_MEDICO_ID_FULL = "exames.to_medico_id"; + public static final int TO_MEDICO_ID_INDEX = 16; + public static final String PDF = "pdf"; + public static final String PDF_FULL = "exames.pdf"; + public static final int PDF_INDEX = 17; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2, + OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES, INACTIVO, + TRABALHADOR_ID, TO_TRABALHADOR_ID, MEDICO_ID, TO_MEDICO_ID, PDF, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + TIPO, TABLENAME + "." + OCASIONAL, TABLENAME + "." + OUTRO_TIPO, TABLENAME + "." + RESULTADO, TABLENAME + "." + OUTRA_FUNCAO_1, TABLENAME + "." + OUTRA_FUNCAO_2, + TABLENAME + "." + OUTRA_FUNCAO_3, TABLENAME + "." + OUTRA_FUNCAO_4, TABLENAME + "." + PROXIMO_EXAME, TABLENAME + "." + OUTRAS_RECOMENDACOES, TABLENAME + "." + INACTIVO, + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + MEDICO_ID, TABLENAME + "." + TO_MEDICO_ID, TABLENAME + "." + PDF, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2, + OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES, INACTIVO, + TRABALHADOR_ID, MEDICO_ID, PDF, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2, + OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES, INACTIVO, + TRABALHADOR_ID, MEDICO_ID, }; + + private Integer id; + private java.util.Date data; + private Integer tipo; + private Integer ocasional; + private String outro_tipo; + private Integer resultado; + private String outra_funcao_1; + private String outra_funcao_2; + private String outra_funcao_3; + private String outra_funcao_4; + private java.util.Date proximo_exame; + private String outras_recomendacoes; + private String inactivo; + private Integer trabalhador_id; + private db.data.siprp.outer.TrabalhadoresData to_trabalhador_id; + private Integer medico_id; + private db.data.siprp.outer.MedicosData to_medico_id; + private byte[] pdf; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Exames() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public Integer getOcasional() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OCASIONAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ocasional; + } + + public void setOcasional( Integer ocasional ) + { + try + { + preProcess( OCASIONAL, ocasional ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ocasional = ocasional; + LAZY_LOADED_OBJECTS.put( OCASIONAL, Boolean.TRUE ); + } + + public String getOutro_tipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRO_TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outro_tipo; + } + + public void setOutro_tipo( String outro_tipo ) + { + try + { + preProcess( OUTRO_TIPO, outro_tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outro_tipo = outro_tipo; + LAZY_LOADED_OBJECTS.put( OUTRO_TIPO, Boolean.TRUE ); + } + + public Integer getResultado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESULTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.resultado; + } + + public void setResultado( Integer resultado ) + { + try + { + preProcess( RESULTADO, resultado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.resultado = resultado; + LAZY_LOADED_OBJECTS.put( RESULTADO, Boolean.TRUE ); + } + + public String getOutra_funcao_1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_1; + } + + public void setOutra_funcao_1( String outra_funcao_1 ) + { + try + { + preProcess( OUTRA_FUNCAO_1, outra_funcao_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_1 = outra_funcao_1; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_1, Boolean.TRUE ); + } + + public String getOutra_funcao_2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_2; + } + + public void setOutra_funcao_2( String outra_funcao_2 ) + { + try + { + preProcess( OUTRA_FUNCAO_2, outra_funcao_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_2 = outra_funcao_2; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_2, Boolean.TRUE ); + } + + public String getOutra_funcao_3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_3; + } + + public void setOutra_funcao_3( String outra_funcao_3 ) + { + try + { + preProcess( OUTRA_FUNCAO_3, outra_funcao_3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_3 = outra_funcao_3; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_3, Boolean.TRUE ); + } + + public String getOutra_funcao_4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_4; + } + + public void setOutra_funcao_4( String outra_funcao_4 ) + { + try + { + preProcess( OUTRA_FUNCAO_4, outra_funcao_4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_4 = outra_funcao_4; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_4, Boolean.TRUE ); + } + + public java.util.Date getProximo_exame() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROXIMO_EXAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.proximo_exame; + } + + public void setProximo_exame( java.util.Date proximo_exame ) + { + try + { + preProcess( PROXIMO_EXAME, proximo_exame ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.proximo_exame = proximo_exame; + LAZY_LOADED_OBJECTS.put( PROXIMO_EXAME, Boolean.TRUE ); + } + + public String getOutras_recomendacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRAS_RECOMENDACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outras_recomendacoes; + } + + public void setOutras_recomendacoes( String outras_recomendacoes ) + { + try + { + preProcess( OUTRAS_RECOMENDACOES, outras_recomendacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outras_recomendacoes = outras_recomendacoes; + LAZY_LOADED_OBJECTS.put( OUTRAS_RECOMENDACOES, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.MedicosData toMedico_id() + { + try + { + prepare( TO_MEDICO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medico_id; + } + + public void setToMedico_id( db.data.siprp.outer.MedicosData to_medico_id ) + { + try + { + preProcess( TO_MEDICO_ID, to_medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medico_id = to_medico_id; + } + + public byte[] getPdf() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PDF ); + Boolean isLazyLoaded = isPropertyLoaded( PDF ); + if ( ! isLazyLoaded ) + { + this.pdf = ( byte[] ) getProvider().loadFieldFromDatabase( PDF, this ); + LAZY_LOADED_OBJECTS.put( PDF, Boolean.TRUE ); + } + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.pdf; + } + + public void setPdf( byte[] pdf ) + { + try + { + preProcess( PDF, pdf ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.pdf = pdf; + LAZY_LOADED_OBJECTS.put( PDF, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + value = getId(); + break; + case Exames.DATA_INDEX: + value = getData(); + break; + case Exames.TIPO_INDEX: + value = getTipo(); + break; + case Exames.OCASIONAL_INDEX: + value = getOcasional(); + break; + case Exames.OUTRO_TIPO_INDEX: + value = getOutro_tipo(); + break; + case Exames.RESULTADO_INDEX: + value = getResultado(); + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + value = getOutra_funcao_1(); + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + value = getOutra_funcao_2(); + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + value = getOutra_funcao_3(); + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + value = getOutra_funcao_4(); + break; + case Exames.PROXIMO_EXAME_INDEX: + value = getProximo_exame(); + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + value = getOutras_recomendacoes(); + break; + case Exames.INACTIVO_INDEX: + value = getInactivo(); + break; + case Exames.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case Exames.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + case Exames.TO_MEDICO_ID_INDEX: + value = toMedico_id(); + break; + case Exames.PDF_INDEX: + value = getPdf(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + value = this.id; + break; + case Exames.DATA_INDEX: + value = this.data; + break; + case Exames.TIPO_INDEX: + value = this.tipo; + break; + case Exames.OCASIONAL_INDEX: + value = this.ocasional; + break; + case Exames.OUTRO_TIPO_INDEX: + value = this.outro_tipo; + break; + case Exames.RESULTADO_INDEX: + value = this.resultado; + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + value = this.outra_funcao_1; + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + value = this.outra_funcao_2; + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + value = this.outra_funcao_3; + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + value = this.outra_funcao_4; + break; + case Exames.PROXIMO_EXAME_INDEX: + value = this.proximo_exame; + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + value = this.outras_recomendacoes; + break; + case Exames.INACTIVO_INDEX: + value = this.inactivo; + break; + case Exames.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case Exames.MEDICO_ID_INDEX: + value = this.medico_id; + break; + case Exames.TO_MEDICO_ID_INDEX: + value = this.to_medico_id; + break; + case Exames.PDF_INDEX: + value = this.pdf; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + setId( ( Integer ) value ); + break; + case Exames.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case Exames.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case Exames.OCASIONAL_INDEX: + setOcasional( ( Integer ) value ); + break; + case Exames.OUTRO_TIPO_INDEX: + setOutro_tipo( ( String ) value ); + break; + case Exames.RESULTADO_INDEX: + setResultado( ( Integer ) value ); + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + setOutra_funcao_1( ( String ) value ); + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + setOutra_funcao_2( ( String ) value ); + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + setOutra_funcao_3( ( String ) value ); + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + setOutra_funcao_4( ( String ) value ); + break; + case Exames.PROXIMO_EXAME_INDEX: + setProximo_exame( ( java.util.Date ) value ); + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + setOutras_recomendacoes( ( String ) value ); + break; + case Exames.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + case Exames.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp.outer.TrabalhadoresData ) value ); + break; + case Exames.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + case Exames.TO_MEDICO_ID_INDEX: + setToMedico_id( ( db.data.siprp.outer.MedicosData ) value ); + break; + case Exames.PDF_INDEX: + setPdf( ( byte[] ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + this.id = ( Integer ) value; + break; + case Exames.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case Exames.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case Exames.OCASIONAL_INDEX: + this.ocasional = ( Integer ) value; + break; + case Exames.OUTRO_TIPO_INDEX: + this.outro_tipo = ( String ) value; + break; + case Exames.RESULTADO_INDEX: + this.resultado = ( Integer ) value; + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + this.outra_funcao_1 = ( String ) value; + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + this.outra_funcao_2 = ( String ) value; + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + this.outra_funcao_3 = ( String ) value; + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + this.outra_funcao_4 = ( String ) value; + break; + case Exames.PROXIMO_EXAME_INDEX: + this.proximo_exame = ( java.util.Date ) value; + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + this.outras_recomendacoes = ( String ) value; + break; + case Exames.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + case Exames.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp.outer.TrabalhadoresData ) value; + break; + case Exames.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + case Exames.TO_MEDICO_ID_INDEX: + this.to_medico_id = ( db.data.siprp.outer.MedicosData ) value; + break; + case Exames.PDF_INDEX: + this.pdf = ( byte[] ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Exames.ID_INDEX: + theClass = Integer.class; + break; + case Exames.DATA_INDEX: + theClass = java.util.Date.class; + break; + case Exames.TIPO_INDEX: + theClass = Integer.class; + break; + case Exames.OCASIONAL_INDEX: + theClass = Integer.class; + break; + case Exames.OUTRO_TIPO_INDEX: + theClass = String.class; + break; + case Exames.RESULTADO_INDEX: + theClass = Integer.class; + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + theClass = String.class; + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + theClass = String.class; + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + theClass = String.class; + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + theClass = String.class; + break; + case Exames.PROXIMO_EXAME_INDEX: + theClass = java.util.Date.class; + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + theClass = String.class; + break; + case Exames.INACTIVO_INDEX: + theClass = String.class; + break; + case Exames.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp.outer.TrabalhadoresData.class; + break; + case Exames.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + case Exames.TO_MEDICO_ID_INDEX: + theClass = db.data.siprp.outer.MedicosData.class; + break; + case Exames.PDF_INDEX: + theClass = byte[].class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Exames._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Exames.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + LAZY_LOADED_OBJECTS.put( PDF, Boolean.FALSE ); + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/ExamesPerfis.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/ExamesPerfis.java new file mode 100644 index 00000000..94c4e427 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/ExamesPerfis.java @@ -0,0 +1,426 @@ +/* +* ExamesPerfis.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class ExamesPerfis extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( ExamesPerfis.ID, ExamesPerfis.ID_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.ID_FULL, ExamesPerfis.ID_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.PERFIL, ExamesPerfis.PERFIL_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.PERFIL_FULL, ExamesPerfis.PERFIL_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( ExamesPerfis.CLASS_IDENTIFIER, ExamesPerfis.TIPO, ExamesPerfis.TO_TIPO ); + FIELD_INDEXES.put( ExamesPerfis.TIPO, ExamesPerfis.TIPO_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.TIPO_FULL, ExamesPerfis.TIPO_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.TO_TIPO, ExamesPerfis.TO_TIPO_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.MULTIPLICADOR, ExamesPerfis.MULTIPLICADOR_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.MULTIPLICADOR_FULL, ExamesPerfis.MULTIPLICADOR_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytipoTotipos_exames_comp = + new com.evolute.entity.ForeignKey( ExamesPerfis.class, ExamesPerfis.TIPO, db.data.siprp.outer.TiposExamesCompData.class, db.data.siprp.outer.TiposExamesCompData.ID ); + + public static final String TABLENAME = "exames_perfis"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.exames_perfis"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "exames_perfis.id"; + public static final int ID_INDEX = 0; + public static final String PERFIL = "perfil"; + public static final String PERFIL_FULL = "exames_perfis.perfil"; + public static final int PERFIL_INDEX = 1; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "exames_perfis.tipo"; + public static final int TIPO_INDEX = 2; + public static final String TO_TIPO = "to_tipo"; + public static final String TO_TIPO_FULL = "exames_perfis.to_tipo"; + public static final int TO_TIPO_INDEX = 3; + public static final String MULTIPLICADOR = "multiplicador"; + public static final String MULTIPLICADOR_FULL = "exames_perfis.multiplicador"; + public static final int MULTIPLICADOR_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + PERFIL, TIPO, TO_TIPO, MULTIPLICADOR, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PERFIL, TABLENAME + "." + TIPO, TABLENAME + "." + TO_TIPO, TABLENAME + "." + MULTIPLICADOR, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PERFIL, TIPO, MULTIPLICADOR, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PERFIL, TIPO, MULTIPLICADOR, }; + + private Integer id; + private Integer perfil; + private Integer tipo; + private db.data.siprp.outer.TiposExamesCompData to_tipo; + private Integer multiplicador; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public ExamesPerfis() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getPerfil() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil; + } + + public void setPerfil( Integer perfil ) + { + try + { + preProcess( PERFIL, perfil ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil = perfil; + LAZY_LOADED_OBJECTS.put( PERFIL, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public db.data.siprp.outer.TiposExamesCompData toTipo() + { + try + { + prepare( TO_TIPO ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tipo; + } + + public void setToTipo( db.data.siprp.outer.TiposExamesCompData to_tipo ) + { + try + { + preProcess( TO_TIPO, to_tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tipo = to_tipo; + } + + public Integer getMultiplicador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MULTIPLICADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.multiplicador; + } + + public void setMultiplicador( Integer multiplicador ) + { + try + { + preProcess( MULTIPLICADOR, multiplicador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.multiplicador = multiplicador; + LAZY_LOADED_OBJECTS.put( MULTIPLICADOR, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + value = getId(); + break; + case ExamesPerfis.PERFIL_INDEX: + value = getPerfil(); + break; + case ExamesPerfis.TIPO_INDEX: + value = getTipo(); + break; + case ExamesPerfis.TO_TIPO_INDEX: + value = toTipo(); + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + value = getMultiplicador(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + value = this.id; + break; + case ExamesPerfis.PERFIL_INDEX: + value = this.perfil; + break; + case ExamesPerfis.TIPO_INDEX: + value = this.tipo; + break; + case ExamesPerfis.TO_TIPO_INDEX: + value = this.to_tipo; + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + value = this.multiplicador; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + setId( ( Integer ) value ); + break; + case ExamesPerfis.PERFIL_INDEX: + setPerfil( ( Integer ) value ); + break; + case ExamesPerfis.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case ExamesPerfis.TO_TIPO_INDEX: + setToTipo( ( db.data.siprp.outer.TiposExamesCompData ) value ); + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + setMultiplicador( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + this.id = ( Integer ) value; + break; + case ExamesPerfis.PERFIL_INDEX: + this.perfil = ( Integer ) value; + break; + case ExamesPerfis.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case ExamesPerfis.TO_TIPO_INDEX: + this.to_tipo = ( db.data.siprp.outer.TiposExamesCompData ) value; + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + this.multiplicador = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case ExamesPerfis.ID_INDEX: + theClass = Integer.class; + break; + case ExamesPerfis.PERFIL_INDEX: + theClass = Integer.class; + break; + case ExamesPerfis.TIPO_INDEX: + theClass = Integer.class; + break; + case ExamesPerfis.TO_TIPO_INDEX: + theClass = db.data.siprp.outer.TiposExamesCompData.class; + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : ExamesPerfis._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, ExamesPerfis.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/HistoricoEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/HistoricoEstabelecimento.java new file mode 100644 index 00000000..8693f87d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/HistoricoEstabelecimento.java @@ -0,0 +1,426 @@ +/* +* HistoricoEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class HistoricoEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HistoricoEstabelecimento.ID, HistoricoEstabelecimento.ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.ID_FULL, HistoricoEstabelecimento.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HistoricoEstabelecimento.CLASS_IDENTIFIER, HistoricoEstabelecimento.ESTABELECIMENTO_ID, HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( HistoricoEstabelecimento.ESTABELECIMENTO_ID, HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.ESTABELECIMENTO_ID_FULL, HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID, HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.DATA, HistoricoEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.DATA_FULL, HistoricoEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.TEXTO, HistoricoEstabelecimento.TEXTO_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.TEXTO_FULL, HistoricoEstabelecimento.TEXTO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( HistoricoEstabelecimento.class, HistoricoEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp.outer.EstabelecimentosData.class, db.data.siprp.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "historico_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.historico_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "historico_estabelecimento.id"; + public static final int ID_INDEX = 0; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "historico_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 1; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "historico_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 2; + public static final String DATA = "data"; + public static final String DATA_FULL = "historico_estabelecimento.data"; + public static final int DATA_INDEX = 3; + public static final String TEXTO = "texto"; + public static final String TEXTO_FULL = "historico_estabelecimento.texto"; + public static final int TEXTO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, DATA, TEXTO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, TABLENAME + "." + DATA, TABLENAME + "." + TEXTO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ESTABELECIMENTO_ID, DATA, TEXTO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ESTABELECIMENTO_ID, DATA, TEXTO, }; + + private Integer id; + private Integer estabelecimento_id; + private db.data.siprp.outer.EstabelecimentosData to_estabelecimento_id; + private java.util.Date data; + private String texto; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HistoricoEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getTexto() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TEXTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.texto; + } + + public void setTexto( String texto ) + { + try + { + preProcess( TEXTO, texto ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.texto = texto; + LAZY_LOADED_OBJECTS.put( TEXTO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + value = getId(); + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case HistoricoEstabelecimento.DATA_INDEX: + value = getData(); + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + value = getTexto(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + value = this.id; + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case HistoricoEstabelecimento.DATA_INDEX: + value = this.data; + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + value = this.texto; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + setId( ( Integer ) value ); + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp.outer.EstabelecimentosData ) value ); + break; + case HistoricoEstabelecimento.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + setTexto( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + this.id = ( Integer ) value; + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp.outer.EstabelecimentosData ) value; + break; + case HistoricoEstabelecimento.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + this.texto = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + theClass = Integer.class; + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp.outer.EstabelecimentosData.class; + break; + case HistoricoEstabelecimento.DATA_INDEX: + theClass = java.util.Date.class; + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HistoricoEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HistoricoEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesEmpresa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesEmpresa.java new file mode 100644 index 00000000..1920deb7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesEmpresa.java @@ -0,0 +1,475 @@ +/* +* MarcacoesEmpresa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class MarcacoesEmpresa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesEmpresa.ID, MarcacoesEmpresa.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.ID_FULL, MarcacoesEmpresa.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.DATA, MarcacoesEmpresa.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.DATA_FULL, MarcacoesEmpresa.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.TEXTO, MarcacoesEmpresa.TEXTO_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.TEXTO_FULL, MarcacoesEmpresa.TEXTO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesEmpresa.CLASS_IDENTIFIER, MarcacoesEmpresa.EMPRESA_ID, MarcacoesEmpresa.TO_EMPRESA_ID ); + FIELD_INDEXES.put( MarcacoesEmpresa.EMPRESA_ID, MarcacoesEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.EMPRESA_ID_FULL, MarcacoesEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.TO_EMPRESA_ID, MarcacoesEmpresa.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.REALIZADA, MarcacoesEmpresa.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.REALIZADA_FULL, MarcacoesEmpresa.REALIZADA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( MarcacoesEmpresa.class, MarcacoesEmpresa.EMPRESA_ID, db.data.siprp.outer.EmpresasData.class, db.data.siprp.outer.EmpresasData.ID ); + + public static final String TABLENAME = "marcacoes_empresa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.marcacoes_empresa"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_empresa.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_empresa.data"; + public static final int DATA_INDEX = 1; + public static final String TEXTO = "texto"; + public static final String TEXTO_FULL = "marcacoes_empresa.texto"; + public static final int TEXTO_INDEX = 2; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "marcacoes_empresa.empresa_id"; + public static final int EMPRESA_ID_INDEX = 3; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "marcacoes_empresa.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 4; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "marcacoes_empresa.realizada"; + public static final int REALIZADA_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, TEXTO, EMPRESA_ID, TO_EMPRESA_ID, REALIZADA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + TEXTO, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + REALIZADA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, TEXTO, EMPRESA_ID, REALIZADA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, TEXTO, EMPRESA_ID, REALIZADA, }; + + private Integer id; + private java.util.Date data; + private String texto; + private Integer empresa_id; + private db.data.siprp.outer.EmpresasData to_empresa_id; + private String realizada; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesEmpresa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getTexto() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TEXTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.texto; + } + + public void setTexto( String texto ) + { + try + { + preProcess( TEXTO, texto ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.texto = texto; + LAZY_LOADED_OBJECTS.put( TEXTO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + value = getId(); + break; + case MarcacoesEmpresa.DATA_INDEX: + value = getData(); + break; + case MarcacoesEmpresa.TEXTO_INDEX: + value = getTexto(); + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + value = getRealizada(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + value = this.id; + break; + case MarcacoesEmpresa.DATA_INDEX: + value = this.data; + break; + case MarcacoesEmpresa.TEXTO_INDEX: + value = this.texto; + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + value = this.realizada; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesEmpresa.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesEmpresa.TEXTO_INDEX: + setTexto( ( String ) value ); + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp.outer.EmpresasData ) value ); + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesEmpresa.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesEmpresa.TEXTO_INDEX: + this.texto = ( String ) value; + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp.outer.EmpresasData ) value; + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEmpresa.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEmpresa.TEXTO_INDEX: + theClass = String.class; + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp.outer.EmpresasData.class; + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesEmpresa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesEmpresa.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesEstabelecimento.java new file mode 100644 index 00000000..9bd9081e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesEstabelecimento.java @@ -0,0 +1,474 @@ +/* +* MarcacoesEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class MarcacoesEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesEstabelecimento.ID, MarcacoesEstabelecimento.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ID_FULL, MarcacoesEstabelecimento.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA, MarcacoesEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_FULL, MarcacoesEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.REALIZADA, MarcacoesEstabelecimento.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.REALIZADA_FULL, MarcacoesEstabelecimento.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_EMAIL, MarcacoesEstabelecimento.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_EMAIL_FULL, MarcacoesEstabelecimento.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_RELATORIO, MarcacoesEstabelecimento.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_RELATORIO_FULL, MarcacoesEstabelecimento.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ESTABELECIMENTO_ID, MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ESTABELECIMENTO_ID_FULL, MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "marcacoes_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.marcacoes_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_estabelecimento.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_estabelecimento.data"; + public static final int DATA_INDEX = 1; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "marcacoes_estabelecimento.realizada"; + public static final int REALIZADA_INDEX = 2; + public static final String DATA_EMAIL = "data_email"; + public static final String DATA_EMAIL_FULL = "marcacoes_estabelecimento.data_email"; + public static final int DATA_EMAIL_INDEX = 3; + public static final String DATA_RELATORIO = "data_relatorio"; + public static final String DATA_RELATORIO_FULL = "marcacoes_estabelecimento.data_relatorio"; + public static final int DATA_RELATORIO_INDEX = 4; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "marcacoes_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + REALIZADA, TABLENAME + "." + DATA_EMAIL, TABLENAME + "." + DATA_RELATORIO, TABLENAME + "." + ESTABELECIMENTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO_ID, }; + + private Integer id; + private java.util.Date data; + private String realizada; + private java.util.Date data_email; + private java.util.Date data_relatorio; + private Integer estabelecimento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public java.util.Date getData_email() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_email; + } + + public void setData_email( java.util.Date data_email ) + { + try + { + preProcess( DATA_EMAIL, data_email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_email = data_email; + LAZY_LOADED_OBJECTS.put( DATA_EMAIL, Boolean.TRUE ); + } + + public java.util.Date getData_relatorio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RELATORIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_relatorio; + } + + public void setData_relatorio( java.util.Date data_relatorio ) + { + try + { + preProcess( DATA_RELATORIO, data_relatorio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_relatorio = data_relatorio; + LAZY_LOADED_OBJECTS.put( DATA_RELATORIO, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + value = getId(); + break; + case MarcacoesEstabelecimento.DATA_INDEX: + value = getData(); + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + value = getRealizada(); + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + value = getData_email(); + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + value = getData_relatorio(); + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + value = this.id; + break; + case MarcacoesEstabelecimento.DATA_INDEX: + value = this.data; + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + value = this.realizada; + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + value = this.data_email; + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + value = this.data_relatorio; + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesEstabelecimento.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + setData_email( ( java.util.Date ) value ); + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + setData_relatorio( ( java.util.Date ) value ); + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesEstabelecimento.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + this.data_email = ( java.util.Date ) value; + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + this.data_relatorio = ( java.util.Date ) value; + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEstabelecimento.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + theClass = String.class; + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesTrabalhador.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesTrabalhador.java new file mode 100644 index 00000000..cc66e383 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/MarcacoesTrabalhador.java @@ -0,0 +1,575 @@ +/* +* MarcacoesTrabalhador.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class MarcacoesTrabalhador extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesTrabalhador.ID, MarcacoesTrabalhador.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.ID_FULL, MarcacoesTrabalhador.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA, MarcacoesTrabalhador.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_FULL, MarcacoesTrabalhador.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.REALIZADA, MarcacoesTrabalhador.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.REALIZADA_FULL, MarcacoesTrabalhador.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_EMAIL, MarcacoesTrabalhador.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_EMAIL_FULL, MarcacoesTrabalhador.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_RELATORIO, MarcacoesTrabalhador.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_RELATORIO_FULL, MarcacoesTrabalhador.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TIPO, MarcacoesTrabalhador.TIPO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TIPO_FULL, MarcacoesTrabalhador.TIPO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesTrabalhador.CLASS_IDENTIFIER, MarcacoesTrabalhador.TRABALHADOR_ID, MarcacoesTrabalhador.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TRABALHADOR_ID, MarcacoesTrabalhador.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TRABALHADOR_ID_FULL, MarcacoesTrabalhador.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TO_TRABALHADOR_ID, MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( MarcacoesTrabalhador.class, MarcacoesTrabalhador.TRABALHADOR_ID, db.data.siprp.outer.TrabalhadoresData.class, db.data.siprp.outer.TrabalhadoresData.ID ); + + public static final String TABLENAME = "marcacoes_trabalhador"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.marcacoes_trabalhador"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_trabalhador.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_trabalhador.data"; + public static final int DATA_INDEX = 1; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "marcacoes_trabalhador.realizada"; + public static final int REALIZADA_INDEX = 2; + public static final String DATA_EMAIL = "data_email"; + public static final String DATA_EMAIL_FULL = "marcacoes_trabalhador.data_email"; + public static final int DATA_EMAIL_INDEX = 3; + public static final String DATA_RELATORIO = "data_relatorio"; + public static final String DATA_RELATORIO_FULL = "marcacoes_trabalhador.data_relatorio"; + public static final int DATA_RELATORIO_INDEX = 4; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "marcacoes_trabalhador.tipo"; + public static final int TIPO_INDEX = 5; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "marcacoes_trabalhador.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 6; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "marcacoes_trabalhador.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR_ID, + TO_TRABALHADOR_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + REALIZADA, TABLENAME + "." + DATA_EMAIL, TABLENAME + "." + DATA_RELATORIO, TABLENAME + "." + TIPO, TABLENAME + "." + TRABALHADOR_ID, + TABLENAME + "." + TO_TRABALHADOR_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR_ID, }; + + private Integer id; + private java.util.Date data; + private String realizada; + private java.util.Date data_email; + private java.util.Date data_relatorio; + private Integer tipo; + private Integer trabalhador_id; + private db.data.siprp.outer.TrabalhadoresData to_trabalhador_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesTrabalhador() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public java.util.Date getData_email() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_email; + } + + public void setData_email( java.util.Date data_email ) + { + try + { + preProcess( DATA_EMAIL, data_email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_email = data_email; + LAZY_LOADED_OBJECTS.put( DATA_EMAIL, Boolean.TRUE ); + } + + public java.util.Date getData_relatorio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RELATORIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_relatorio; + } + + public void setData_relatorio( java.util.Date data_relatorio ) + { + try + { + preProcess( DATA_RELATORIO, data_relatorio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_relatorio = data_relatorio; + LAZY_LOADED_OBJECTS.put( DATA_RELATORIO, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + value = getId(); + break; + case MarcacoesTrabalhador.DATA_INDEX: + value = getData(); + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + value = getRealizada(); + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + value = getData_email(); + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + value = getData_relatorio(); + break; + case MarcacoesTrabalhador.TIPO_INDEX: + value = getTipo(); + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + value = this.id; + break; + case MarcacoesTrabalhador.DATA_INDEX: + value = this.data; + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + value = this.realizada; + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + value = this.data_email; + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + value = this.data_relatorio; + break; + case MarcacoesTrabalhador.TIPO_INDEX: + value = this.tipo; + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesTrabalhador.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + setData_email( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + setData_relatorio( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhador.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp.outer.TrabalhadoresData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesTrabalhador.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + this.data_email = ( java.util.Date ) value; + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + this.data_relatorio = ( java.util.Date ) value; + break; + case MarcacoesTrabalhador.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp.outer.TrabalhadoresData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + theClass = String.class; + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhador.TIPO_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp.outer.TrabalhadoresData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesTrabalhador._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesTrabalhador.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Medicos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Medicos.java new file mode 100644 index 00000000..20d84778 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Medicos.java @@ -0,0 +1,393 @@ +/* +* Medicos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Medicos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Medicos.ID, Medicos.ID_INDEX ); + FIELD_INDEXES.put( Medicos.ID_FULL, Medicos.ID_INDEX ); + FIELD_INDEXES.put( Medicos.NOME, Medicos.NOME_INDEX ); + FIELD_INDEXES.put( Medicos.NOME_FULL, Medicos.NOME_INDEX ); + FIELD_INDEXES.put( Medicos.NUMERO_CEDULA, Medicos.NUMERO_CEDULA_INDEX ); + FIELD_INDEXES.put( Medicos.NUMERO_CEDULA_FULL, Medicos.NUMERO_CEDULA_INDEX ); + FIELD_INDEXES.put( Medicos.INACTIVO, Medicos.INACTIVO_INDEX ); + FIELD_INDEXES.put( Medicos.INACTIVO_FULL, Medicos.INACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "medicos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.medicos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "medicos.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "medicos.nome"; + public static final int NOME_INDEX = 1; + public static final String NUMERO_CEDULA = "numero_cedula"; + public static final String NUMERO_CEDULA_FULL = "medicos.numero_cedula"; + public static final int NUMERO_CEDULA_INDEX = 2; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "medicos.inactivo"; + public static final int INACTIVO_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, NUMERO_CEDULA, INACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + NUMERO_CEDULA, TABLENAME + "." + INACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, NUMERO_CEDULA, INACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, NUMERO_CEDULA, INACTIVO, }; + + private Integer id; + private String nome; + private String numero_cedula; + private String inactivo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Medicos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromExames_medico_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.ExamesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "medico_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getNumero_cedula() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_CEDULA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_cedula; + } + + public void setNumero_cedula( String numero_cedula ) + { + try + { + preProcess( NUMERO_CEDULA, numero_cedula ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_cedula = numero_cedula; + LAZY_LOADED_OBJECTS.put( NUMERO_CEDULA, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + value = getId(); + break; + case Medicos.NOME_INDEX: + value = getNome(); + break; + case Medicos.NUMERO_CEDULA_INDEX: + value = getNumero_cedula(); + break; + case Medicos.INACTIVO_INDEX: + value = getInactivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + value = this.id; + break; + case Medicos.NOME_INDEX: + value = this.nome; + break; + case Medicos.NUMERO_CEDULA_INDEX: + value = this.numero_cedula; + break; + case Medicos.INACTIVO_INDEX: + value = this.inactivo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Medicos.NOME_INDEX: + setNome( ( String ) value ); + break; + case Medicos.NUMERO_CEDULA_INDEX: + setNumero_cedula( ( String ) value ); + break; + case Medicos.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Medicos.NOME_INDEX: + this.nome = ( String ) value; + break; + case Medicos.NUMERO_CEDULA_INDEX: + this.numero_cedula = ( String ) value; + break; + case Medicos.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Medicos.ID_INDEX: + theClass = Integer.class; + break; + case Medicos.NOME_INDEX: + theClass = String.class; + break; + case Medicos.NUMERO_CEDULA_INDEX: + theClass = String.class; + break; + case Medicos.INACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Medicos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Medicos.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Medidas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Medidas.java new file mode 100644 index 00000000..bf7b2454 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Medidas.java @@ -0,0 +1,393 @@ +/* +* Medidas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Medidas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Medidas.ID, Medidas.ID_INDEX ); + FIELD_INDEXES.put( Medidas.ID_FULL, Medidas.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Medidas.CLASS_IDENTIFIER, Medidas.ANALISE_ID, Medidas.TO_ANALISE_ID ); + FIELD_INDEXES.put( Medidas.ANALISE_ID, Medidas.ANALISE_ID_INDEX ); + FIELD_INDEXES.put( Medidas.ANALISE_ID_FULL, Medidas.ANALISE_ID_INDEX ); + FIELD_INDEXES.put( Medidas.TO_ANALISE_ID, Medidas.TO_ANALISE_ID_INDEX ); + FIELD_INDEXES.put( Medidas.MEDIDA, Medidas.MEDIDA_INDEX ); + FIELD_INDEXES.put( Medidas.MEDIDA_FULL, Medidas.MEDIDA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyanalise_idToanalises_acidentes = + new com.evolute.entity.ForeignKey( Medidas.class, Medidas.ANALISE_ID, db.data.siprp.outer.AnalisesAcidentesData.class, db.data.siprp.outer.AnalisesAcidentesData.ID ); + + public static final String TABLENAME = "medidas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.medidas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "medidas.id"; + public static final int ID_INDEX = 0; + public static final String ANALISE_ID = "analise_id"; + public static final String ANALISE_ID_FULL = "medidas.analise_id"; + public static final int ANALISE_ID_INDEX = 1; + public static final String TO_ANALISE_ID = "to_analise_id"; + public static final String TO_ANALISE_ID_FULL = "medidas.to_analise_id"; + public static final int TO_ANALISE_ID_INDEX = 2; + public static final String MEDIDA = "medida"; + public static final String MEDIDA_FULL = "medidas.medida"; + public static final int MEDIDA_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + ANALISE_ID, TO_ANALISE_ID, MEDIDA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ANALISE_ID, TABLENAME + "." + TO_ANALISE_ID, TABLENAME + "." + MEDIDA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ANALISE_ID, MEDIDA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ANALISE_ID, MEDIDA, }; + + private Integer id; + private Integer analise_id; + private db.data.siprp.outer.AnalisesAcidentesData to_analise_id; + private String medida; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Medidas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getAnalise_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analise_id; + } + + public void setAnalise_id( Integer analise_id ) + { + try + { + preProcess( ANALISE_ID, analise_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analise_id = analise_id; + LAZY_LOADED_OBJECTS.put( ANALISE_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.AnalisesAcidentesData toAnalise_id() + { + try + { + prepare( TO_ANALISE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_analise_id; + } + + public void setToAnalise_id( db.data.siprp.outer.AnalisesAcidentesData to_analise_id ) + { + try + { + preProcess( TO_ANALISE_ID, to_analise_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_analise_id = to_analise_id; + } + + public String getMedida() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDIDA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medida; + } + + public void setMedida( String medida ) + { + try + { + preProcess( MEDIDA, medida ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medida = medida; + LAZY_LOADED_OBJECTS.put( MEDIDA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medidas.ID_INDEX: + value = getId(); + break; + case Medidas.ANALISE_ID_INDEX: + value = getAnalise_id(); + break; + case Medidas.TO_ANALISE_ID_INDEX: + value = toAnalise_id(); + break; + case Medidas.MEDIDA_INDEX: + value = getMedida(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medidas.ID_INDEX: + value = this.id; + break; + case Medidas.ANALISE_ID_INDEX: + value = this.analise_id; + break; + case Medidas.TO_ANALISE_ID_INDEX: + value = this.to_analise_id; + break; + case Medidas.MEDIDA_INDEX: + value = this.medida; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medidas.ID_INDEX: + setId( ( Integer ) value ); + break; + case Medidas.ANALISE_ID_INDEX: + setAnalise_id( ( Integer ) value ); + break; + case Medidas.TO_ANALISE_ID_INDEX: + setToAnalise_id( ( db.data.siprp.outer.AnalisesAcidentesData ) value ); + break; + case Medidas.MEDIDA_INDEX: + setMedida( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medidas.ID_INDEX: + this.id = ( Integer ) value; + break; + case Medidas.ANALISE_ID_INDEX: + this.analise_id = ( Integer ) value; + break; + case Medidas.TO_ANALISE_ID_INDEX: + this.to_analise_id = ( db.data.siprp.outer.AnalisesAcidentesData ) value; + break; + case Medidas.MEDIDA_INDEX: + this.medida = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Medidas.ID_INDEX: + theClass = Integer.class; + break; + case Medidas.ANALISE_ID_INDEX: + theClass = Integer.class; + break; + case Medidas.TO_ANALISE_ID_INDEX: + theClass = db.data.siprp.outer.AnalisesAcidentesData.class; + break; + case Medidas.MEDIDA_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Medidas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Medidas.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/NotNoticias.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/NotNoticias.java new file mode 100644 index 00000000..141edde7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/NotNoticias.java @@ -0,0 +1,441 @@ +/* +* NotNoticias.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class NotNoticias extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( NotNoticias.ID, NotNoticias.ID_INDEX ); + FIELD_INDEXES.put( NotNoticias.ID_FULL, NotNoticias.ID_INDEX ); + FIELD_INDEXES.put( NotNoticias.DATA, NotNoticias.DATA_INDEX ); + FIELD_INDEXES.put( NotNoticias.DATA_FULL, NotNoticias.DATA_INDEX ); + FIELD_INDEXES.put( NotNoticias.STAMP, NotNoticias.STAMP_INDEX ); + FIELD_INDEXES.put( NotNoticias.STAMP_FULL, NotNoticias.STAMP_INDEX ); + FIELD_INDEXES.put( NotNoticias.UTILIZADOR, NotNoticias.UTILIZADOR_INDEX ); + FIELD_INDEXES.put( NotNoticias.UTILIZADOR_FULL, NotNoticias.UTILIZADOR_INDEX ); + FIELD_INDEXES.put( NotNoticias.NOTICIA, NotNoticias.NOTICIA_INDEX ); + FIELD_INDEXES.put( NotNoticias.NOTICIA_FULL, NotNoticias.NOTICIA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "not_noticias"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.not_noticias"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "not_noticias.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "not_noticias.data"; + public static final int DATA_INDEX = 1; + public static final String STAMP = "stamp"; + public static final String STAMP_FULL = "not_noticias.stamp"; + public static final int STAMP_INDEX = 2; + public static final String UTILIZADOR = "utilizador"; + public static final String UTILIZADOR_FULL = "not_noticias.utilizador"; + public static final int UTILIZADOR_INDEX = 3; + public static final String NOTICIA = "noticia"; + public static final String NOTICIA_FULL = "not_noticias.noticia"; + public static final int NOTICIA_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, STAMP, UTILIZADOR, NOTICIA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + STAMP, TABLENAME + "." + UTILIZADOR, TABLENAME + "." + NOTICIA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, STAMP, UTILIZADOR, NOTICIA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, STAMP, UTILIZADOR, NOTICIA, }; + + private Integer id; + private java.util.Date data; + private java.sql.Timestamp stamp; + private String utilizador; + private String noticia; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public NotNoticias() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public java.sql.Timestamp getStamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.stamp; + } + + public void setStamp( java.sql.Timestamp stamp ) + { + try + { + preProcess( STAMP, stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.stamp = stamp; + LAZY_LOADED_OBJECTS.put( STAMP, Boolean.TRUE ); + } + + public String getUtilizador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( UTILIZADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.utilizador; + } + + public void setUtilizador( String utilizador ) + { + try + { + preProcess( UTILIZADOR, utilizador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.utilizador = utilizador; + LAZY_LOADED_OBJECTS.put( UTILIZADOR, Boolean.TRUE ); + } + + public String getNoticia() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOTICIA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.noticia; + } + + public void setNoticia( String noticia ) + { + try + { + preProcess( NOTICIA, noticia ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.noticia = noticia; + LAZY_LOADED_OBJECTS.put( NOTICIA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case NotNoticias.ID_INDEX: + value = getId(); + break; + case NotNoticias.DATA_INDEX: + value = getData(); + break; + case NotNoticias.STAMP_INDEX: + value = getStamp(); + break; + case NotNoticias.UTILIZADOR_INDEX: + value = getUtilizador(); + break; + case NotNoticias.NOTICIA_INDEX: + value = getNoticia(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case NotNoticias.ID_INDEX: + value = this.id; + break; + case NotNoticias.DATA_INDEX: + value = this.data; + break; + case NotNoticias.STAMP_INDEX: + value = this.stamp; + break; + case NotNoticias.UTILIZADOR_INDEX: + value = this.utilizador; + break; + case NotNoticias.NOTICIA_INDEX: + value = this.noticia; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case NotNoticias.ID_INDEX: + setId( ( Integer ) value ); + break; + case NotNoticias.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case NotNoticias.STAMP_INDEX: + setStamp( ( java.sql.Timestamp ) value ); + break; + case NotNoticias.UTILIZADOR_INDEX: + setUtilizador( ( String ) value ); + break; + case NotNoticias.NOTICIA_INDEX: + setNoticia( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case NotNoticias.ID_INDEX: + this.id = ( Integer ) value; + break; + case NotNoticias.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case NotNoticias.STAMP_INDEX: + this.stamp = ( java.sql.Timestamp ) value; + break; + case NotNoticias.UTILIZADOR_INDEX: + this.utilizador = ( String ) value; + break; + case NotNoticias.NOTICIA_INDEX: + this.noticia = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case NotNoticias.ID_INDEX: + theClass = Integer.class; + break; + case NotNoticias.DATA_INDEX: + theClass = java.util.Date.class; + break; + case NotNoticias.STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case NotNoticias.UTILIZADOR_INDEX: + theClass = String.class; + break; + case NotNoticias.NOTICIA_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : NotNoticias._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, NotNoticias.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Permissoes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Permissoes.java new file mode 100644 index 00000000..594799c6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Permissoes.java @@ -0,0 +1,342 @@ +/* +* Permissoes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Permissoes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Permissoes.ID, Permissoes.ID_INDEX ); + FIELD_INDEXES.put( Permissoes.ID_FULL, Permissoes.ID_INDEX ); + FIELD_INDEXES.put( Permissoes.USER_ID, Permissoes.USER_ID_INDEX ); + FIELD_INDEXES.put( Permissoes.USER_ID_FULL, Permissoes.USER_ID_INDEX ); + FIELD_INDEXES.put( Permissoes.CODIGO_PERMISSAO, Permissoes.CODIGO_PERMISSAO_INDEX ); + FIELD_INDEXES.put( Permissoes.CODIGO_PERMISSAO_FULL, Permissoes.CODIGO_PERMISSAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "permissoes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.permissoes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "permissoes.id"; + public static final int ID_INDEX = 0; + public static final String USER_ID = "user_id"; + public static final String USER_ID_FULL = "permissoes.user_id"; + public static final int USER_ID_INDEX = 1; + public static final String CODIGO_PERMISSAO = "codigo_permissao"; + public static final String CODIGO_PERMISSAO_FULL = "permissoes.codigo_permissao"; + public static final int CODIGO_PERMISSAO_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + USER_ID, CODIGO_PERMISSAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + USER_ID, TABLENAME + "." + CODIGO_PERMISSAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, USER_ID, CODIGO_PERMISSAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, USER_ID, CODIGO_PERMISSAO, }; + + private Integer id; + private Integer user_id; + private Integer codigo_permissao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Permissoes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getUser_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_id; + } + + public void setUser_id( Integer user_id ) + { + try + { + preProcess( USER_ID, user_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_id = user_id; + LAZY_LOADED_OBJECTS.put( USER_ID, Boolean.TRUE ); + } + + public Integer getCodigo_permissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_PERMISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_permissao; + } + + public void setCodigo_permissao( Integer codigo_permissao ) + { + try + { + preProcess( CODIGO_PERMISSAO, codigo_permissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_permissao = codigo_permissao; + LAZY_LOADED_OBJECTS.put( CODIGO_PERMISSAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Permissoes.ID_INDEX: + value = getId(); + break; + case Permissoes.USER_ID_INDEX: + value = getUser_id(); + break; + case Permissoes.CODIGO_PERMISSAO_INDEX: + value = getCodigo_permissao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Permissoes.ID_INDEX: + value = this.id; + break; + case Permissoes.USER_ID_INDEX: + value = this.user_id; + break; + case Permissoes.CODIGO_PERMISSAO_INDEX: + value = this.codigo_permissao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Permissoes.ID_INDEX: + setId( ( Integer ) value ); + break; + case Permissoes.USER_ID_INDEX: + setUser_id( ( Integer ) value ); + break; + case Permissoes.CODIGO_PERMISSAO_INDEX: + setCodigo_permissao( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Permissoes.ID_INDEX: + this.id = ( Integer ) value; + break; + case Permissoes.USER_ID_INDEX: + this.user_id = ( Integer ) value; + break; + case Permissoes.CODIGO_PERMISSAO_INDEX: + this.codigo_permissao = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Permissoes.ID_INDEX: + theClass = Integer.class; + break; + case Permissoes.USER_ID_INDEX: + theClass = Integer.class; + break; + case Permissoes.CODIGO_PERMISSAO_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Permissoes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Permissoes.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoAreas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoAreas.java new file mode 100644 index 00000000..c7c35328 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoAreas.java @@ -0,0 +1,557 @@ +/* +* PlanoAreas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanoAreas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanoAreas.DESCRICAO, PlanoAreas.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoAreas.DESCRICAO_FULL, PlanoAreas.DESCRICAO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanoAreas.CLASS_IDENTIFIER, PlanoAreas.PLANO_ID, PlanoAreas.TO_PLANO_ID ); + FIELD_INDEXES.put( PlanoAreas.PLANO_ID, PlanoAreas.PLANO_ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.PLANO_ID_FULL, PlanoAreas.PLANO_ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.TO_PLANO_ID, PlanoAreas.TO_PLANO_ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.ID, PlanoAreas.ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.ID_FULL, PlanoAreas.ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.AREA_ID, PlanoAreas.AREA_ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.AREA_ID_FULL, PlanoAreas.AREA_ID_INDEX ); + FIELD_INDEXES.put( PlanoAreas.IS_PRINCIPAL, PlanoAreas.IS_PRINCIPAL_INDEX ); + FIELD_INDEXES.put( PlanoAreas.IS_PRINCIPAL_FULL, PlanoAreas.IS_PRINCIPAL_INDEX ); + FIELD_INDEXES.put( PlanoAreas.ORDEM, PlanoAreas.ORDEM_INDEX ); + FIELD_INDEXES.put( PlanoAreas.ORDEM_FULL, PlanoAreas.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyplano_idToplanos_actuacao = + new com.evolute.entity.ForeignKey( PlanoAreas.class, PlanoAreas.PLANO_ID, db.data.siprp.outer.PlanosActuacaoData.class, db.data.siprp.outer.PlanosActuacaoData.ID ); + + public static final String TABLENAME = "plano_areas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_areas"; + + public static final int _INVALID__INDEX = -1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "plano_areas.descricao"; + public static final int DESCRICAO_INDEX = 0; + public static final String PLANO_ID = "plano_id"; + public static final String PLANO_ID_FULL = "plano_areas.plano_id"; + public static final int PLANO_ID_INDEX = 1; + public static final String TO_PLANO_ID = "to_plano_id"; + public static final String TO_PLANO_ID_FULL = "plano_areas.to_plano_id"; + public static final int TO_PLANO_ID_INDEX = 2; + public static final String ID = "id"; + public static final String ID_FULL = "plano_areas.id"; + public static final int ID_INDEX = 3; + public static final String AREA_ID = "area_id"; + public static final String AREA_ID_FULL = "plano_areas.area_id"; + public static final int AREA_ID_INDEX = 4; + public static final String IS_PRINCIPAL = "is_principal"; + public static final String IS_PRINCIPAL_FULL = "plano_areas.is_principal"; + public static final int IS_PRINCIPAL_INDEX = 5; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "plano_areas.ordem"; + public static final int ORDEM_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, PLANO_ID, TO_PLANO_ID, AREA_ID, IS_PRINCIPAL, ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + PLANO_ID, TABLENAME + "." + TO_PLANO_ID, TABLENAME + "." + AREA_ID, TABLENAME + "." + IS_PRINCIPAL, TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + DESCRICAO, PLANO_ID, ID, AREA_ID, IS_PRINCIPAL, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + DESCRICAO, PLANO_ID, ID, AREA_ID, IS_PRINCIPAL, ORDEM, }; + + private String descricao; + private Integer plano_id; + private db.data.siprp.outer.PlanosActuacaoData to_plano_id; + private Integer id; + private Integer area_id; + private Boolean is_principal; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanoAreas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getPlano_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PLANO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.plano_id; + } + + public void setPlano_id( Integer plano_id ) + { + try + { + preProcess( PLANO_ID, plano_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.plano_id = plano_id; + LAZY_LOADED_OBJECTS.put( PLANO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.PlanosActuacaoData toPlano_id() + { + try + { + prepare( TO_PLANO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_plano_id; + } + + public void setToPlano_id( db.data.siprp.outer.PlanosActuacaoData to_plano_id ) + { + try + { + preProcess( TO_PLANO_ID, to_plano_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_plano_id = to_plano_id; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPlanoRiscos_area_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoRiscosData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanoRiscosData.class , getPrimaryKey().getMap().get("id"), "area_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public Integer getArea_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AREA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.area_id; + } + + public void setArea_id( Integer area_id ) + { + try + { + preProcess( AREA_ID, area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.area_id = area_id; + LAZY_LOADED_OBJECTS.put( AREA_ID, Boolean.TRUE ); + } + + public Boolean getIs_principal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PRINCIPAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_principal; + } + + public void setIs_principal( Boolean is_principal ) + { + try + { + preProcess( IS_PRINCIPAL, is_principal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_principal = is_principal; + LAZY_LOADED_OBJECTS.put( IS_PRINCIPAL, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoAreas.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PlanoAreas.PLANO_ID_INDEX: + value = getPlano_id(); + break; + case PlanoAreas.TO_PLANO_ID_INDEX: + value = toPlano_id(); + break; + case PlanoAreas.ID_INDEX: + value = getId(); + break; + case PlanoAreas.AREA_ID_INDEX: + value = getArea_id(); + break; + case PlanoAreas.IS_PRINCIPAL_INDEX: + value = getIs_principal(); + break; + case PlanoAreas.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoAreas.DESCRICAO_INDEX: + value = this.descricao; + break; + case PlanoAreas.PLANO_ID_INDEX: + value = this.plano_id; + break; + case PlanoAreas.TO_PLANO_ID_INDEX: + value = this.to_plano_id; + break; + case PlanoAreas.ID_INDEX: + value = this.id; + break; + case PlanoAreas.AREA_ID_INDEX: + value = this.area_id; + break; + case PlanoAreas.IS_PRINCIPAL_INDEX: + value = this.is_principal; + break; + case PlanoAreas.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoAreas.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PlanoAreas.PLANO_ID_INDEX: + setPlano_id( ( Integer ) value ); + break; + case PlanoAreas.TO_PLANO_ID_INDEX: + setToPlano_id( ( db.data.siprp.outer.PlanosActuacaoData ) value ); + break; + case PlanoAreas.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanoAreas.AREA_ID_INDEX: + setArea_id( ( Integer ) value ); + break; + case PlanoAreas.IS_PRINCIPAL_INDEX: + setIs_principal( ( Boolean ) value ); + break; + case PlanoAreas.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoAreas.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PlanoAreas.PLANO_ID_INDEX: + this.plano_id = ( Integer ) value; + break; + case PlanoAreas.TO_PLANO_ID_INDEX: + this.to_plano_id = ( db.data.siprp.outer.PlanosActuacaoData ) value; + break; + case PlanoAreas.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanoAreas.AREA_ID_INDEX: + this.area_id = ( Integer ) value; + break; + case PlanoAreas.IS_PRINCIPAL_INDEX: + this.is_principal = ( Boolean ) value; + break; + case PlanoAreas.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanoAreas.DESCRICAO_INDEX: + theClass = String.class; + break; + case PlanoAreas.PLANO_ID_INDEX: + theClass = Integer.class; + break; + case PlanoAreas.TO_PLANO_ID_INDEX: + theClass = db.data.siprp.outer.PlanosActuacaoData.class; + break; + case PlanoAreas.ID_INDEX: + theClass = Integer.class; + break; + case PlanoAreas.AREA_ID_INDEX: + theClass = Integer.class; + break; + case PlanoAreas.IS_PRINCIPAL_INDEX: + theClass = Boolean.class; + break; + case PlanoAreas.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanoAreas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanoAreas.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoMedidas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoMedidas.java new file mode 100644 index 00000000..9e96cba5 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoMedidas.java @@ -0,0 +1,560 @@ +/* +* PlanoMedidas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanoMedidas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanoMedidas.DESCRICAO, PlanoMedidas.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.DESCRICAO_FULL, PlanoMedidas.DESCRICAO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanoMedidas.CLASS_IDENTIFIER, PlanoMedidas.RISCO_ID, PlanoMedidas.TO_RISCO_ID ); + FIELD_INDEXES.put( PlanoMedidas.RISCO_ID, PlanoMedidas.RISCO_ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.RISCO_ID_FULL, PlanoMedidas.RISCO_ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.TO_RISCO_ID, PlanoMedidas.TO_RISCO_ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.ID, PlanoMedidas.ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.ID_FULL, PlanoMedidas.ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.MEDIDA_ID, PlanoMedidas.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.MEDIDA_ID_FULL, PlanoMedidas.MEDIDA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanoMedidas.CLASS_IDENTIFIER, PlanoMedidas.ESTADO_MEDIDAS_ID, PlanoMedidas.TO_ESTADO_MEDIDAS_ID ); + FIELD_INDEXES.put( PlanoMedidas.ESTADO_MEDIDAS_ID, PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.ESTADO_MEDIDAS_ID_FULL, PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX ); + FIELD_INDEXES.put( PlanoMedidas.TO_ESTADO_MEDIDAS_ID, PlanoMedidas.TO_ESTADO_MEDIDAS_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrisco_idToplano_riscos = + new com.evolute.entity.ForeignKey( PlanoMedidas.class, PlanoMedidas.RISCO_ID, db.data.siprp.outer.PlanoRiscosData.class, db.data.siprp.outer.PlanoRiscosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestado_medidas_idToestado_medidas = + new com.evolute.entity.ForeignKey( PlanoMedidas.class, PlanoMedidas.ESTADO_MEDIDAS_ID, db.data.siprp.outer.EstadoMedidasData.class, db.data.siprp.outer.EstadoMedidasData.ID ); + + public static final String TABLENAME = "plano_medidas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_medidas"; + + public static final int _INVALID__INDEX = -1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "plano_medidas.descricao"; + public static final int DESCRICAO_INDEX = 0; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "plano_medidas.risco_id"; + public static final int RISCO_ID_INDEX = 1; + public static final String TO_RISCO_ID = "to_risco_id"; + public static final String TO_RISCO_ID_FULL = "plano_medidas.to_risco_id"; + public static final int TO_RISCO_ID_INDEX = 2; + public static final String ID = "id"; + public static final String ID_FULL = "plano_medidas.id"; + public static final int ID_INDEX = 3; + public static final String MEDIDA_ID = "medida_id"; + public static final String MEDIDA_ID_FULL = "plano_medidas.medida_id"; + public static final int MEDIDA_ID_INDEX = 4; + public static final String ESTADO_MEDIDAS_ID = "estado_medidas_id"; + public static final String ESTADO_MEDIDAS_ID_FULL = "plano_medidas.estado_medidas_id"; + public static final int ESTADO_MEDIDAS_ID_INDEX = 5; + public static final String TO_ESTADO_MEDIDAS_ID = "to_estado_medidas_id"; + public static final String TO_ESTADO_MEDIDAS_ID_FULL = "plano_medidas.to_estado_medidas_id"; + public static final int TO_ESTADO_MEDIDAS_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, RISCO_ID, TO_RISCO_ID, MEDIDA_ID, ESTADO_MEDIDAS_ID, + TO_ESTADO_MEDIDAS_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + RISCO_ID, TABLENAME + "." + TO_RISCO_ID, TABLENAME + "." + MEDIDA_ID, TABLENAME + "." + ESTADO_MEDIDAS_ID, + TABLENAME + "." + TO_ESTADO_MEDIDAS_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + DESCRICAO, RISCO_ID, ID, MEDIDA_ID, ESTADO_MEDIDAS_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + DESCRICAO, RISCO_ID, ID, MEDIDA_ID, ESTADO_MEDIDAS_ID, }; + + private String descricao; + private Integer risco_id; + private db.data.siprp.outer.PlanoRiscosData to_risco_id; + private Integer id; + private Integer medida_id; + private Integer estado_medidas_id; + private db.data.siprp.outer.EstadoMedidasData to_estado_medidas_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanoMedidas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.PlanoRiscosData toRisco_id() + { + try + { + prepare( TO_RISCO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_risco_id; + } + + public void setToRisco_id( db.data.siprp.outer.PlanoRiscosData to_risco_id ) + { + try + { + preProcess( TO_RISCO_ID, to_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_risco_id = to_risco_id; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPlanoPostosTrabalho_medida_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoPostosTrabalhoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanoPostosTrabalhoData.class , getPrimaryKey().getMap().get("id"), "medida_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public Integer getMedida_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDIDA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medida_id; + } + + public void setMedida_id( Integer medida_id ) + { + try + { + preProcess( MEDIDA_ID, medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medida_id = medida_id; + LAZY_LOADED_OBJECTS.put( MEDIDA_ID, Boolean.TRUE ); + } + + public Integer getEstado_medidas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO_MEDIDAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado_medidas_id; + } + + public void setEstado_medidas_id( Integer estado_medidas_id ) + { + try + { + preProcess( ESTADO_MEDIDAS_ID, estado_medidas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado_medidas_id = estado_medidas_id; + LAZY_LOADED_OBJECTS.put( ESTADO_MEDIDAS_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EstadoMedidasData toEstado_medidas_id() + { + try + { + prepare( TO_ESTADO_MEDIDAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estado_medidas_id; + } + + public void setToEstado_medidas_id( db.data.siprp.outer.EstadoMedidasData to_estado_medidas_id ) + { + try + { + preProcess( TO_ESTADO_MEDIDAS_ID, to_estado_medidas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estado_medidas_id = to_estado_medidas_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoMedidas.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PlanoMedidas.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case PlanoMedidas.TO_RISCO_ID_INDEX: + value = toRisco_id(); + break; + case PlanoMedidas.ID_INDEX: + value = getId(); + break; + case PlanoMedidas.MEDIDA_ID_INDEX: + value = getMedida_id(); + break; + case PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX: + value = getEstado_medidas_id(); + break; + case PlanoMedidas.TO_ESTADO_MEDIDAS_ID_INDEX: + value = toEstado_medidas_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoMedidas.DESCRICAO_INDEX: + value = this.descricao; + break; + case PlanoMedidas.RISCO_ID_INDEX: + value = this.risco_id; + break; + case PlanoMedidas.TO_RISCO_ID_INDEX: + value = this.to_risco_id; + break; + case PlanoMedidas.ID_INDEX: + value = this.id; + break; + case PlanoMedidas.MEDIDA_ID_INDEX: + value = this.medida_id; + break; + case PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX: + value = this.estado_medidas_id; + break; + case PlanoMedidas.TO_ESTADO_MEDIDAS_ID_INDEX: + value = this.to_estado_medidas_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoMedidas.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PlanoMedidas.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case PlanoMedidas.TO_RISCO_ID_INDEX: + setToRisco_id( ( db.data.siprp.outer.PlanoRiscosData ) value ); + break; + case PlanoMedidas.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanoMedidas.MEDIDA_ID_INDEX: + setMedida_id( ( Integer ) value ); + break; + case PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX: + setEstado_medidas_id( ( Integer ) value ); + break; + case PlanoMedidas.TO_ESTADO_MEDIDAS_ID_INDEX: + setToEstado_medidas_id( ( db.data.siprp.outer.EstadoMedidasData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoMedidas.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PlanoMedidas.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case PlanoMedidas.TO_RISCO_ID_INDEX: + this.to_risco_id = ( db.data.siprp.outer.PlanoRiscosData ) value; + break; + case PlanoMedidas.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanoMedidas.MEDIDA_ID_INDEX: + this.medida_id = ( Integer ) value; + break; + case PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX: + this.estado_medidas_id = ( Integer ) value; + break; + case PlanoMedidas.TO_ESTADO_MEDIDAS_ID_INDEX: + this.to_estado_medidas_id = ( db.data.siprp.outer.EstadoMedidasData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanoMedidas.DESCRICAO_INDEX: + theClass = String.class; + break; + case PlanoMedidas.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case PlanoMedidas.TO_RISCO_ID_INDEX: + theClass = db.data.siprp.outer.PlanoRiscosData.class; + break; + case PlanoMedidas.ID_INDEX: + theClass = Integer.class; + break; + case PlanoMedidas.MEDIDA_ID_INDEX: + theClass = Integer.class; + break; + case PlanoMedidas.ESTADO_MEDIDAS_ID_INDEX: + theClass = Integer.class; + break; + case PlanoMedidas.TO_ESTADO_MEDIDAS_ID_INDEX: + theClass = db.data.siprp.outer.EstadoMedidasData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanoMedidas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanoMedidas.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoPostosTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoPostosTrabalho.java new file mode 100644 index 00000000..c7582a19 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoPostosTrabalho.java @@ -0,0 +1,491 @@ +/* +* PlanoPostosTrabalho.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanoPostosTrabalho extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanoPostosTrabalho.DESCRICAO, PlanoPostosTrabalho.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.DESCRICAO_FULL, PlanoPostosTrabalho.DESCRICAO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanoPostosTrabalho.CLASS_IDENTIFIER, PlanoPostosTrabalho.MEDIDA_ID, PlanoPostosTrabalho.TO_MEDIDA_ID ); + FIELD_INDEXES.put( PlanoPostosTrabalho.MEDIDA_ID, PlanoPostosTrabalho.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.MEDIDA_ID_FULL, PlanoPostosTrabalho.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.TO_MEDIDA_ID, PlanoPostosTrabalho.TO_MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.ID, PlanoPostosTrabalho.ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.ID_FULL, PlanoPostosTrabalho.ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.POSTO_ID, PlanoPostosTrabalho.POSTO_ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.POSTO_ID_FULL, PlanoPostosTrabalho.POSTO_ID_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.IS_PRINCIPAL, PlanoPostosTrabalho.IS_PRINCIPAL_INDEX ); + FIELD_INDEXES.put( PlanoPostosTrabalho.IS_PRINCIPAL_FULL, PlanoPostosTrabalho.IS_PRINCIPAL_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeymedida_idToplano_medidas = + new com.evolute.entity.ForeignKey( PlanoPostosTrabalho.class, PlanoPostosTrabalho.MEDIDA_ID, db.data.siprp.outer.PlanoMedidasData.class, db.data.siprp.outer.PlanoMedidasData.ID ); + + public static final String TABLENAME = "plano_postos_trabalho"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_postos_trabalho"; + + public static final int _INVALID__INDEX = -1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "plano_postos_trabalho.descricao"; + public static final int DESCRICAO_INDEX = 0; + public static final String MEDIDA_ID = "medida_id"; + public static final String MEDIDA_ID_FULL = "plano_postos_trabalho.medida_id"; + public static final int MEDIDA_ID_INDEX = 1; + public static final String TO_MEDIDA_ID = "to_medida_id"; + public static final String TO_MEDIDA_ID_FULL = "plano_postos_trabalho.to_medida_id"; + public static final int TO_MEDIDA_ID_INDEX = 2; + public static final String ID = "id"; + public static final String ID_FULL = "plano_postos_trabalho.id"; + public static final int ID_INDEX = 3; + public static final String POSTO_ID = "posto_id"; + public static final String POSTO_ID_FULL = "plano_postos_trabalho.posto_id"; + public static final int POSTO_ID_INDEX = 4; + public static final String IS_PRINCIPAL = "is_principal"; + public static final String IS_PRINCIPAL_FULL = "plano_postos_trabalho.is_principal"; + public static final int IS_PRINCIPAL_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, MEDIDA_ID, TO_MEDIDA_ID, POSTO_ID, IS_PRINCIPAL, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + MEDIDA_ID, TABLENAME + "." + TO_MEDIDA_ID, TABLENAME + "." + POSTO_ID, TABLENAME + "." + IS_PRINCIPAL, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + DESCRICAO, MEDIDA_ID, ID, POSTO_ID, IS_PRINCIPAL, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + DESCRICAO, MEDIDA_ID, ID, POSTO_ID, IS_PRINCIPAL, }; + + private String descricao; + private Integer medida_id; + private db.data.siprp.outer.PlanoMedidasData to_medida_id; + private Integer id; + private Integer posto_id; + private Boolean is_principal; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanoPostosTrabalho() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getMedida_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDIDA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medida_id; + } + + public void setMedida_id( Integer medida_id ) + { + try + { + preProcess( MEDIDA_ID, medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medida_id = medida_id; + LAZY_LOADED_OBJECTS.put( MEDIDA_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.PlanoMedidasData toMedida_id() + { + try + { + prepare( TO_MEDIDA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medida_id; + } + + public void setToMedida_id( db.data.siprp.outer.PlanoMedidasData to_medida_id ) + { + try + { + preProcess( TO_MEDIDA_ID, to_medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medida_id = to_medida_id; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getPosto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.posto_id; + } + + public void setPosto_id( Integer posto_id ) + { + try + { + preProcess( POSTO_ID, posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.posto_id = posto_id; + LAZY_LOADED_OBJECTS.put( POSTO_ID, Boolean.TRUE ); + } + + public Boolean getIs_principal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PRINCIPAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_principal; + } + + public void setIs_principal( Boolean is_principal ) + { + try + { + preProcess( IS_PRINCIPAL, is_principal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_principal = is_principal; + LAZY_LOADED_OBJECTS.put( IS_PRINCIPAL, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoPostosTrabalho.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PlanoPostosTrabalho.MEDIDA_ID_INDEX: + value = getMedida_id(); + break; + case PlanoPostosTrabalho.TO_MEDIDA_ID_INDEX: + value = toMedida_id(); + break; + case PlanoPostosTrabalho.ID_INDEX: + value = getId(); + break; + case PlanoPostosTrabalho.POSTO_ID_INDEX: + value = getPosto_id(); + break; + case PlanoPostosTrabalho.IS_PRINCIPAL_INDEX: + value = getIs_principal(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoPostosTrabalho.DESCRICAO_INDEX: + value = this.descricao; + break; + case PlanoPostosTrabalho.MEDIDA_ID_INDEX: + value = this.medida_id; + break; + case PlanoPostosTrabalho.TO_MEDIDA_ID_INDEX: + value = this.to_medida_id; + break; + case PlanoPostosTrabalho.ID_INDEX: + value = this.id; + break; + case PlanoPostosTrabalho.POSTO_ID_INDEX: + value = this.posto_id; + break; + case PlanoPostosTrabalho.IS_PRINCIPAL_INDEX: + value = this.is_principal; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoPostosTrabalho.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PlanoPostosTrabalho.MEDIDA_ID_INDEX: + setMedida_id( ( Integer ) value ); + break; + case PlanoPostosTrabalho.TO_MEDIDA_ID_INDEX: + setToMedida_id( ( db.data.siprp.outer.PlanoMedidasData ) value ); + break; + case PlanoPostosTrabalho.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanoPostosTrabalho.POSTO_ID_INDEX: + setPosto_id( ( Integer ) value ); + break; + case PlanoPostosTrabalho.IS_PRINCIPAL_INDEX: + setIs_principal( ( Boolean ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoPostosTrabalho.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PlanoPostosTrabalho.MEDIDA_ID_INDEX: + this.medida_id = ( Integer ) value; + break; + case PlanoPostosTrabalho.TO_MEDIDA_ID_INDEX: + this.to_medida_id = ( db.data.siprp.outer.PlanoMedidasData ) value; + break; + case PlanoPostosTrabalho.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanoPostosTrabalho.POSTO_ID_INDEX: + this.posto_id = ( Integer ) value; + break; + case PlanoPostosTrabalho.IS_PRINCIPAL_INDEX: + this.is_principal = ( Boolean ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanoPostosTrabalho.DESCRICAO_INDEX: + theClass = String.class; + break; + case PlanoPostosTrabalho.MEDIDA_ID_INDEX: + theClass = Integer.class; + break; + case PlanoPostosTrabalho.TO_MEDIDA_ID_INDEX: + theClass = db.data.siprp.outer.PlanoMedidasData.class; + break; + case PlanoPostosTrabalho.ID_INDEX: + theClass = Integer.class; + break; + case PlanoPostosTrabalho.POSTO_ID_INDEX: + theClass = Integer.class; + break; + case PlanoPostosTrabalho.IS_PRINCIPAL_INDEX: + theClass = Boolean.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanoPostosTrabalho._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanoPostosTrabalho.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoRiscos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoRiscos.java new file mode 100644 index 00000000..6ef7a0f7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoRiscos.java @@ -0,0 +1,1056 @@ +/* +* PlanoRiscos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanoRiscos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanoRiscos.DESCRICAO, PlanoRiscos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.DESCRICAO_FULL, PlanoRiscos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.ACTIVO, PlanoRiscos.ACTIVO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.ACTIVO_FULL, PlanoRiscos.ACTIVO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanoRiscos.CLASS_IDENTIFIER, PlanoRiscos.AREA_ID, PlanoRiscos.TO_AREA_ID ); + FIELD_INDEXES.put( PlanoRiscos.AREA_ID, PlanoRiscos.AREA_ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.AREA_ID_FULL, PlanoRiscos.AREA_ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.TO_AREA_ID, PlanoRiscos.TO_AREA_ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.ID, PlanoRiscos.ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.ID_FULL, PlanoRiscos.ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.VALOR, PlanoRiscos.VALOR_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.VALOR_FULL, PlanoRiscos.VALOR_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.RESPONSAVEL_EXECUCAO, PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.RESPONSAVEL_EXECUCAO_FULL, PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.RECURSOS_NECESSARIOS, PlanoRiscos.RECURSOS_NECESSARIOS_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.RECURSOS_NECESSARIOS_FULL, PlanoRiscos.RECURSOS_NECESSARIOS_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.DATA_INICIO, PlanoRiscos.DATA_INICIO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.DATA_INICIO_FULL, PlanoRiscos.DATA_INICIO_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.DATA_FIM, PlanoRiscos.DATA_FIM_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.DATA_FIM_FULL, PlanoRiscos.DATA_FIM_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.PARECER_DL, PlanoRiscos.PARECER_DL_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.PARECER_DL_FULL, PlanoRiscos.PARECER_DL_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.PARECER_DNS, PlanoRiscos.PARECER_DNS_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.PARECER_DNS_FULL, PlanoRiscos.PARECER_DNS_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.VERIFICACAO_SIPRP, PlanoRiscos.VERIFICACAO_SIPRP_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.VERIFICACAO_SIPRP_FULL, PlanoRiscos.VERIFICACAO_SIPRP_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.RISCO_ID, PlanoRiscos.RISCO_ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.RISCO_ID_FULL, PlanoRiscos.RISCO_ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.POR, PlanoRiscos.POR_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.POR_FULL, PlanoRiscos.POR_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.IS_PATRIMONIAL, PlanoRiscos.IS_PATRIMONIAL_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.IS_PATRIMONIAL_FULL, PlanoRiscos.IS_PATRIMONIAL_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.VALOR_QUALITATIVO_ID, PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX ); + FIELD_INDEXES.put( PlanoRiscos.VALOR_QUALITATIVO_ID_FULL, PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyarea_idToplano_areas = + new com.evolute.entity.ForeignKey( PlanoRiscos.class, PlanoRiscos.AREA_ID, db.data.siprp.outer.PlanoAreasData.class, db.data.siprp.outer.PlanoAreasData.ID ); + + public static final String TABLENAME = "plano_riscos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_riscos"; + + public static final int _INVALID__INDEX = -1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "plano_riscos.descricao"; + public static final int DESCRICAO_INDEX = 0; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "plano_riscos.activo"; + public static final int ACTIVO_INDEX = 1; + public static final String AREA_ID = "area_id"; + public static final String AREA_ID_FULL = "plano_riscos.area_id"; + public static final int AREA_ID_INDEX = 2; + public static final String TO_AREA_ID = "to_area_id"; + public static final String TO_AREA_ID_FULL = "plano_riscos.to_area_id"; + public static final int TO_AREA_ID_INDEX = 3; + public static final String ID = "id"; + public static final String ID_FULL = "plano_riscos.id"; + public static final int ID_INDEX = 4; + public static final String VALOR = "valor"; + public static final String VALOR_FULL = "plano_riscos.valor"; + public static final int VALOR_INDEX = 5; + public static final String RESPONSAVEL_EXECUCAO = "responsavel_execucao"; + public static final String RESPONSAVEL_EXECUCAO_FULL = "plano_riscos.responsavel_execucao"; + public static final int RESPONSAVEL_EXECUCAO_INDEX = 6; + public static final String RECURSOS_NECESSARIOS = "recursos_necessarios"; + public static final String RECURSOS_NECESSARIOS_FULL = "plano_riscos.recursos_necessarios"; + public static final int RECURSOS_NECESSARIOS_INDEX = 7; + public static final String DATA_INICIO = "data_inicio"; + public static final String DATA_INICIO_FULL = "plano_riscos.data_inicio"; + public static final int DATA_INICIO_INDEX = 8; + public static final String DATA_FIM = "data_fim"; + public static final String DATA_FIM_FULL = "plano_riscos.data_fim"; + public static final int DATA_FIM_INDEX = 9; + public static final String PARECER_DL = "parecer_dl"; + public static final String PARECER_DL_FULL = "plano_riscos.parecer_dl"; + public static final int PARECER_DL_INDEX = 10; + public static final String PARECER_DNS = "parecer_dns"; + public static final String PARECER_DNS_FULL = "plano_riscos.parecer_dns"; + public static final int PARECER_DNS_INDEX = 11; + public static final String VERIFICACAO_SIPRP = "verificacao_siprp"; + public static final String VERIFICACAO_SIPRP_FULL = "plano_riscos.verificacao_siprp"; + public static final int VERIFICACAO_SIPRP_INDEX = 12; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "plano_riscos.risco_id"; + public static final int RISCO_ID_INDEX = 13; + public static final String POR = "por"; + public static final String POR_FULL = "plano_riscos.por"; + public static final int POR_INDEX = 14; + public static final String IS_PATRIMONIAL = "is_patrimonial"; + public static final String IS_PATRIMONIAL_FULL = "plano_riscos.is_patrimonial"; + public static final int IS_PATRIMONIAL_INDEX = 15; + public static final String VALOR_QUALITATIVO_ID = "valor_qualitativo_id"; + public static final String VALOR_QUALITATIVO_ID_FULL = "plano_riscos.valor_qualitativo_id"; + public static final int VALOR_QUALITATIVO_ID_INDEX = 16; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, ACTIVO, AREA_ID, TO_AREA_ID, VALOR, RESPONSAVEL_EXECUCAO, + RECURSOS_NECESSARIOS, DATA_INICIO, DATA_FIM, PARECER_DL, PARECER_DNS, + VERIFICACAO_SIPRP, RISCO_ID, POR, IS_PATRIMONIAL, VALOR_QUALITATIVO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + ACTIVO, TABLENAME + "." + AREA_ID, TABLENAME + "." + TO_AREA_ID, TABLENAME + "." + VALOR, TABLENAME + "." + RESPONSAVEL_EXECUCAO, + TABLENAME + "." + RECURSOS_NECESSARIOS, TABLENAME + "." + DATA_INICIO, TABLENAME + "." + DATA_FIM, TABLENAME + "." + PARECER_DL, TABLENAME + "." + PARECER_DNS, + TABLENAME + "." + VERIFICACAO_SIPRP, TABLENAME + "." + RISCO_ID, TABLENAME + "." + POR, TABLENAME + "." + IS_PATRIMONIAL, TABLENAME + "." + VALOR_QUALITATIVO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + DESCRICAO, ACTIVO, AREA_ID, ID, VALOR, RESPONSAVEL_EXECUCAO, RECURSOS_NECESSARIOS, + DATA_INICIO, DATA_FIM, PARECER_DL, PARECER_DNS, VERIFICACAO_SIPRP, RISCO_ID, POR, + IS_PATRIMONIAL, VALOR_QUALITATIVO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + DESCRICAO, ACTIVO, AREA_ID, ID, VALOR, RESPONSAVEL_EXECUCAO, RECURSOS_NECESSARIOS, + DATA_INICIO, DATA_FIM, PARECER_DL, PARECER_DNS, VERIFICACAO_SIPRP, RISCO_ID, POR, + IS_PATRIMONIAL, VALOR_QUALITATIVO_ID, }; + + private String descricao; + private String activo; + private Integer area_id; + private db.data.siprp.outer.PlanoAreasData to_area_id; + private Integer id; + private Integer valor; + private String responsavel_execucao; + private String recursos_necessarios; + private java.util.Date data_inicio; + private java.util.Date data_fim; + private String parecer_dl; + private String parecer_dns; + private String verificacao_siprp; + private Integer risco_id; + private String por; + private Boolean is_patrimonial; + private Integer valor_qualitativo_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanoRiscos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false, false, false, false, + false, false, false, false, false, false }; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Integer getArea_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AREA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.area_id; + } + + public void setArea_id( Integer area_id ) + { + try + { + preProcess( AREA_ID, area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.area_id = area_id; + LAZY_LOADED_OBJECTS.put( AREA_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.PlanoAreasData toArea_id() + { + try + { + prepare( TO_AREA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_area_id; + } + + public void setToArea_id( db.data.siprp.outer.PlanoAreasData to_area_id ) + { + try + { + preProcess( TO_AREA_ID, to_area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_area_id = to_area_id; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPlanoMedidas_risco_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoMedidasData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanoMedidasData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public Integer getValor() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor; + } + + public void setValor( Integer valor ) + { + try + { + preProcess( VALOR, valor ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor = valor; + LAZY_LOADED_OBJECTS.put( VALOR, Boolean.TRUE ); + } + + public String getResponsavel_execucao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESPONSAVEL_EXECUCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.responsavel_execucao; + } + + public void setResponsavel_execucao( String responsavel_execucao ) + { + try + { + preProcess( RESPONSAVEL_EXECUCAO, responsavel_execucao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.responsavel_execucao = responsavel_execucao; + LAZY_LOADED_OBJECTS.put( RESPONSAVEL_EXECUCAO, Boolean.TRUE ); + } + + public String getRecursos_necessarios() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RECURSOS_NECESSARIOS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.recursos_necessarios; + } + + public void setRecursos_necessarios( String recursos_necessarios ) + { + try + { + preProcess( RECURSOS_NECESSARIOS, recursos_necessarios ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.recursos_necessarios = recursos_necessarios; + LAZY_LOADED_OBJECTS.put( RECURSOS_NECESSARIOS, Boolean.TRUE ); + } + + public java.util.Date getData_inicio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_INICIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_inicio; + } + + public void setData_inicio( java.util.Date data_inicio ) + { + try + { + preProcess( DATA_INICIO, data_inicio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_inicio = data_inicio; + LAZY_LOADED_OBJECTS.put( DATA_INICIO, Boolean.TRUE ); + } + + public java.util.Date getData_fim() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_FIM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_fim; + } + + public void setData_fim( java.util.Date data_fim ) + { + try + { + preProcess( DATA_FIM, data_fim ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_fim = data_fim; + LAZY_LOADED_OBJECTS.put( DATA_FIM, Boolean.TRUE ); + } + + public String getParecer_dl() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PARECER_DL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.parecer_dl; + } + + public void setParecer_dl( String parecer_dl ) + { + try + { + preProcess( PARECER_DL, parecer_dl ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.parecer_dl = parecer_dl; + LAZY_LOADED_OBJECTS.put( PARECER_DL, Boolean.TRUE ); + } + + public String getParecer_dns() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PARECER_DNS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.parecer_dns; + } + + public void setParecer_dns( String parecer_dns ) + { + try + { + preProcess( PARECER_DNS, parecer_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.parecer_dns = parecer_dns; + LAZY_LOADED_OBJECTS.put( PARECER_DNS, Boolean.TRUE ); + } + + public String getVerificacao_siprp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VERIFICACAO_SIPRP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.verificacao_siprp; + } + + public void setVerificacao_siprp( String verificacao_siprp ) + { + try + { + preProcess( VERIFICACAO_SIPRP, verificacao_siprp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.verificacao_siprp = verificacao_siprp; + LAZY_LOADED_OBJECTS.put( VERIFICACAO_SIPRP, Boolean.TRUE ); + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public String getPor() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.por; + } + + public void setPor( String por ) + { + try + { + preProcess( POR, por ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.por = por; + LAZY_LOADED_OBJECTS.put( POR, Boolean.TRUE ); + } + + public Boolean getIs_patrimonial() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PATRIMONIAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_patrimonial; + } + + public void setIs_patrimonial( Boolean is_patrimonial ) + { + try + { + preProcess( IS_PATRIMONIAL, is_patrimonial ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_patrimonial = is_patrimonial; + LAZY_LOADED_OBJECTS.put( IS_PATRIMONIAL, Boolean.TRUE ); + } + + public Integer getValor_qualitativo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR_QUALITATIVO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor_qualitativo_id; + } + + public void setValor_qualitativo_id( Integer valor_qualitativo_id ) + { + try + { + preProcess( VALOR_QUALITATIVO_ID, valor_qualitativo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor_qualitativo_id = valor_qualitativo_id; + LAZY_LOADED_OBJECTS.put( VALOR_QUALITATIVO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoRiscos.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PlanoRiscos.ACTIVO_INDEX: + value = getActivo(); + break; + case PlanoRiscos.AREA_ID_INDEX: + value = getArea_id(); + break; + case PlanoRiscos.TO_AREA_ID_INDEX: + value = toArea_id(); + break; + case PlanoRiscos.ID_INDEX: + value = getId(); + break; + case PlanoRiscos.VALOR_INDEX: + value = getValor(); + break; + case PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX: + value = getResponsavel_execucao(); + break; + case PlanoRiscos.RECURSOS_NECESSARIOS_INDEX: + value = getRecursos_necessarios(); + break; + case PlanoRiscos.DATA_INICIO_INDEX: + value = getData_inicio(); + break; + case PlanoRiscos.DATA_FIM_INDEX: + value = getData_fim(); + break; + case PlanoRiscos.PARECER_DL_INDEX: + value = getParecer_dl(); + break; + case PlanoRiscos.PARECER_DNS_INDEX: + value = getParecer_dns(); + break; + case PlanoRiscos.VERIFICACAO_SIPRP_INDEX: + value = getVerificacao_siprp(); + break; + case PlanoRiscos.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case PlanoRiscos.POR_INDEX: + value = getPor(); + break; + case PlanoRiscos.IS_PATRIMONIAL_INDEX: + value = getIs_patrimonial(); + break; + case PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX: + value = getValor_qualitativo_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoRiscos.DESCRICAO_INDEX: + value = this.descricao; + break; + case PlanoRiscos.ACTIVO_INDEX: + value = this.activo; + break; + case PlanoRiscos.AREA_ID_INDEX: + value = this.area_id; + break; + case PlanoRiscos.TO_AREA_ID_INDEX: + value = this.to_area_id; + break; + case PlanoRiscos.ID_INDEX: + value = this.id; + break; + case PlanoRiscos.VALOR_INDEX: + value = this.valor; + break; + case PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX: + value = this.responsavel_execucao; + break; + case PlanoRiscos.RECURSOS_NECESSARIOS_INDEX: + value = this.recursos_necessarios; + break; + case PlanoRiscos.DATA_INICIO_INDEX: + value = this.data_inicio; + break; + case PlanoRiscos.DATA_FIM_INDEX: + value = this.data_fim; + break; + case PlanoRiscos.PARECER_DL_INDEX: + value = this.parecer_dl; + break; + case PlanoRiscos.PARECER_DNS_INDEX: + value = this.parecer_dns; + break; + case PlanoRiscos.VERIFICACAO_SIPRP_INDEX: + value = this.verificacao_siprp; + break; + case PlanoRiscos.RISCO_ID_INDEX: + value = this.risco_id; + break; + case PlanoRiscos.POR_INDEX: + value = this.por; + break; + case PlanoRiscos.IS_PATRIMONIAL_INDEX: + value = this.is_patrimonial; + break; + case PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX: + value = this.valor_qualitativo_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoRiscos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PlanoRiscos.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + case PlanoRiscos.AREA_ID_INDEX: + setArea_id( ( Integer ) value ); + break; + case PlanoRiscos.TO_AREA_ID_INDEX: + setToArea_id( ( db.data.siprp.outer.PlanoAreasData ) value ); + break; + case PlanoRiscos.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanoRiscos.VALOR_INDEX: + setValor( ( Integer ) value ); + break; + case PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX: + setResponsavel_execucao( ( String ) value ); + break; + case PlanoRiscos.RECURSOS_NECESSARIOS_INDEX: + setRecursos_necessarios( ( String ) value ); + break; + case PlanoRiscos.DATA_INICIO_INDEX: + setData_inicio( ( java.util.Date ) value ); + break; + case PlanoRiscos.DATA_FIM_INDEX: + setData_fim( ( java.util.Date ) value ); + break; + case PlanoRiscos.PARECER_DL_INDEX: + setParecer_dl( ( String ) value ); + break; + case PlanoRiscos.PARECER_DNS_INDEX: + setParecer_dns( ( String ) value ); + break; + case PlanoRiscos.VERIFICACAO_SIPRP_INDEX: + setVerificacao_siprp( ( String ) value ); + break; + case PlanoRiscos.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case PlanoRiscos.POR_INDEX: + setPor( ( String ) value ); + break; + case PlanoRiscos.IS_PATRIMONIAL_INDEX: + setIs_patrimonial( ( Boolean ) value ); + break; + case PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX: + setValor_qualitativo_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoRiscos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PlanoRiscos.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + case PlanoRiscos.AREA_ID_INDEX: + this.area_id = ( Integer ) value; + break; + case PlanoRiscos.TO_AREA_ID_INDEX: + this.to_area_id = ( db.data.siprp.outer.PlanoAreasData ) value; + break; + case PlanoRiscos.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanoRiscos.VALOR_INDEX: + this.valor = ( Integer ) value; + break; + case PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX: + this.responsavel_execucao = ( String ) value; + break; + case PlanoRiscos.RECURSOS_NECESSARIOS_INDEX: + this.recursos_necessarios = ( String ) value; + break; + case PlanoRiscos.DATA_INICIO_INDEX: + this.data_inicio = ( java.util.Date ) value; + break; + case PlanoRiscos.DATA_FIM_INDEX: + this.data_fim = ( java.util.Date ) value; + break; + case PlanoRiscos.PARECER_DL_INDEX: + this.parecer_dl = ( String ) value; + break; + case PlanoRiscos.PARECER_DNS_INDEX: + this.parecer_dns = ( String ) value; + break; + case PlanoRiscos.VERIFICACAO_SIPRP_INDEX: + this.verificacao_siprp = ( String ) value; + break; + case PlanoRiscos.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case PlanoRiscos.POR_INDEX: + this.por = ( String ) value; + break; + case PlanoRiscos.IS_PATRIMONIAL_INDEX: + this.is_patrimonial = ( Boolean ) value; + break; + case PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX: + this.valor_qualitativo_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanoRiscos.DESCRICAO_INDEX: + theClass = String.class; + break; + case PlanoRiscos.ACTIVO_INDEX: + theClass = String.class; + break; + case PlanoRiscos.AREA_ID_INDEX: + theClass = Integer.class; + break; + case PlanoRiscos.TO_AREA_ID_INDEX: + theClass = db.data.siprp.outer.PlanoAreasData.class; + break; + case PlanoRiscos.ID_INDEX: + theClass = Integer.class; + break; + case PlanoRiscos.VALOR_INDEX: + theClass = Integer.class; + break; + case PlanoRiscos.RESPONSAVEL_EXECUCAO_INDEX: + theClass = String.class; + break; + case PlanoRiscos.RECURSOS_NECESSARIOS_INDEX: + theClass = String.class; + break; + case PlanoRiscos.DATA_INICIO_INDEX: + theClass = java.util.Date.class; + break; + case PlanoRiscos.DATA_FIM_INDEX: + theClass = java.util.Date.class; + break; + case PlanoRiscos.PARECER_DL_INDEX: + theClass = String.class; + break; + case PlanoRiscos.PARECER_DNS_INDEX: + theClass = String.class; + break; + case PlanoRiscos.VERIFICACAO_SIPRP_INDEX: + theClass = String.class; + break; + case PlanoRiscos.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case PlanoRiscos.POR_INDEX: + theClass = String.class; + break; + case PlanoRiscos.IS_PATRIMONIAL_INDEX: + theClass = Boolean.class; + break; + case PlanoRiscos.VALOR_QUALITATIVO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanoRiscos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanoRiscos.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoValoresQualitativos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoValoresQualitativos.java new file mode 100644 index 00000000..6ac78d20 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanoValoresQualitativos.java @@ -0,0 +1,326 @@ +/* +* PlanoValoresQualitativos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanoValoresQualitativos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanoValoresQualitativos.ID, PlanoValoresQualitativos.ID_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.ID_FULL, PlanoValoresQualitativos.ID_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DESCRICAO, PlanoValoresQualitativos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DESCRICAO_FULL, PlanoValoresQualitativos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DELETED_STAMP, PlanoValoresQualitativos.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( PlanoValoresQualitativos.DELETED_STAMP_FULL, PlanoValoresQualitativos.DELETED_STAMP_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "plano_valores_qualitativos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.plano_valores_qualitativos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "plano_valores_qualitativos.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "plano_valores_qualitativos.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "plano_valores_qualitativos.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DELETED_STAMP, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DELETED_STAMP, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DELETED_STAMP, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DELETED_STAMP, }; + + private Integer id; + private String descricao; + private java.sql.Timestamp deleted_stamp; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanoValoresQualitativos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + value = getId(); + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + value = this.id; + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + value = this.descricao; + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanoValoresQualitativos.ID_INDEX: + theClass = Integer.class; + break; + case PlanoValoresQualitativos.DESCRICAO_INDEX: + theClass = String.class; + break; + case PlanoValoresQualitativos.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanoValoresQualitativos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanoValoresQualitativos.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanosActuacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanosActuacao.java new file mode 100644 index 00000000..24e80e7c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/PlanosActuacao.java @@ -0,0 +1,2214 @@ +/* +* PlanosActuacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class PlanosActuacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PlanosActuacao.ESTABELECIMENTO_ID, PlanosActuacao.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.ESTABELECIMENTO_ID_FULL, PlanosActuacao.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.FASE, PlanosActuacao.FASE_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.FASE_FULL, PlanosActuacao.FASE_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VISITA, PlanosActuacao.DATA_VISITA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VISITA_FULL, PlanosActuacao.DATA_VISITA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.NOME_ESTABELECIMENTO, PlanosActuacao.NOME_ESTABELECIMENTO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.NOME_ESTABELECIMENTO_FULL, PlanosActuacao.NOME_ESTABELECIMENTO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VALIDACAO_DIRECTOR_LOJA, PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_FULL, PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VALIDACAO_DNS, PlanosActuacao.VALIDACAO_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VALIDACAO_DNS_FULL, PlanosActuacao.VALIDACAO_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VALIDACAO_HS, PlanosActuacao.VALIDACAO_HS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VALIDACAO_HS_FULL, PlanosActuacao.VALIDACAO_HS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.PARECER_DNS, PlanosActuacao.PARECER_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.PARECER_DNS_FULL, PlanosActuacao.PARECER_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.OBS_CORRECAO, PlanosActuacao.OBS_CORRECAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.OBS_CORRECAO_FULL, PlanosActuacao.OBS_CORRECAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_DIR_LOJA, PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_FULL, PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanosActuacao.CLASS_IDENTIFIER, PlanosActuacao.USER_DIR_LOJA, PlanosActuacao.TO_USER_DIR_LOJA ); + FIELD_INDEXES.put( PlanosActuacao.USER_DIR_LOJA, PlanosActuacao.USER_DIR_LOJA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.USER_DIR_LOJA_FULL, PlanosActuacao.USER_DIR_LOJA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TO_USER_DIR_LOJA, PlanosActuacao.TO_USER_DIR_LOJA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_DNS, PlanosActuacao.DATA_VALIDACAO_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_DNS_FULL, PlanosActuacao.DATA_VALIDACAO_DNS_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanosActuacao.CLASS_IDENTIFIER, PlanosActuacao.USER_DNS, PlanosActuacao.TO_USER_DNS ); + FIELD_INDEXES.put( PlanosActuacao.USER_DNS, PlanosActuacao.USER_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.USER_DNS_FULL, PlanosActuacao.USER_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TO_USER_DNS, PlanosActuacao.TO_USER_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_HS, PlanosActuacao.DATA_VALIDACAO_HS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_HS_FULL, PlanosActuacao.DATA_VALIDACAO_HS_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PlanosActuacao.CLASS_IDENTIFIER, PlanosActuacao.USER_HS, PlanosActuacao.TO_USER_HS ); + FIELD_INDEXES.put( PlanosActuacao.USER_HS, PlanosActuacao.USER_HS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.USER_HS_FULL, PlanosActuacao.USER_HS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TO_USER_HS, PlanosActuacao.TO_USER_HS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.FASE_ANTES_CORRECAO, PlanosActuacao.FASE_ANTES_CORRECAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.FASE_ANTES_CORRECAO_FULL, PlanosActuacao.FASE_ANTES_CORRECAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.CORRECAO, PlanosActuacao.CORRECAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.CORRECAO_FULL, PlanosActuacao.CORRECAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.OBSERVACOES_DL, PlanosActuacao.OBSERVACOES_DL_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.OBSERVACOES_DL_FULL, PlanosActuacao.OBSERVACOES_DL_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.OBSERVACOES_DNS, PlanosActuacao.OBSERVACOES_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.OBSERVACOES_DNS_FULL, PlanosActuacao.OBSERVACOES_DNS_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VERIFICACAO_SIPRP, PlanosActuacao.VERIFICACAO_SIPRP_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.VERIFICACAO_SIPRP_FULL, PlanosActuacao.VERIFICACAO_SIPRP_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_CONTROLO, PlanosActuacao.DATA_CONTROLO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_CONTROLO_FULL, PlanosActuacao.DATA_CONTROLO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_EMAIL_CONTROLO, PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_EMAIL_CONTROLO_FULL, PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.EMPRESA_ID, PlanosActuacao.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.EMPRESA_ID_FULL, PlanosActuacao.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.NOME_EMPRESA, PlanosActuacao.NOME_EMPRESA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.NOME_EMPRESA_FULL, PlanosActuacao.NOME_EMPRESA_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_HS_ID, PlanosActuacao.TECNICO_HS_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_HS_ID_FULL, PlanosActuacao.TECNICO_HS_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_HS_NOME, PlanosActuacao.TECNICO_HS_NOME_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_HS_NOME_FULL, PlanosActuacao.TECNICO_HS_NOME_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.ID, PlanosActuacao.ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.ID_FULL, PlanosActuacao.ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_RELATORIO, PlanosActuacao.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_RELATORIO_FULL, PlanosActuacao.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DELETED_DATE, PlanosActuacao.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DELETED_DATE_FULL, PlanosActuacao.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO, PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_FULL, PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_SUPERIOR_HS_ID, PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_SUPERIOR_HS_ID_FULL, PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_SUPERIOR_HS_NOME, PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_FULL, PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_DESACTIVACAO, PlanosActuacao.DATA_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_DESACTIVACAO_FULL, PlanosActuacao.DATA_DESACTIVACAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_DISPONIBILIZACAO, PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_DISPONIBILIZACAO_FULL, PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_SEG, PlanosActuacao.DATA_VALIDACAO_SEG_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.DATA_VALIDACAO_SEG_FULL, PlanosActuacao.DATA_VALIDACAO_SEG_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.USER_SEG, PlanosActuacao.USER_SEG_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.USER_SEG_FULL, PlanosActuacao.USER_SEG_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.HS_RELATORIO_ID, PlanosActuacao.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( PlanosActuacao.HS_RELATORIO_ID_FULL, PlanosActuacao.HS_RELATORIO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyuser_dir_lojaToutilizadores = + new com.evolute.entity.ForeignKey( PlanosActuacao.class, PlanosActuacao.USER_DIR_LOJA, db.data.siprp.outer.UtilizadoresData.class, db.data.siprp.outer.UtilizadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyuser_dnsToutilizadores = + new com.evolute.entity.ForeignKey( PlanosActuacao.class, PlanosActuacao.USER_DNS, db.data.siprp.outer.UtilizadoresData.class, db.data.siprp.outer.UtilizadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyuser_hsToutilizadores = + new com.evolute.entity.ForeignKey( PlanosActuacao.class, PlanosActuacao.USER_HS, db.data.siprp.outer.UtilizadoresData.class, db.data.siprp.outer.UtilizadoresData.ID ); + + public static final String TABLENAME = "planos_actuacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.planos_actuacao"; + + public static final int _INVALID__INDEX = -1; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "planos_actuacao.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 0; + public static final String FASE = "fase"; + public static final String FASE_FULL = "planos_actuacao.fase"; + public static final int FASE_INDEX = 1; + public static final String DATA_VISITA = "data_visita"; + public static final String DATA_VISITA_FULL = "planos_actuacao.data_visita"; + public static final int DATA_VISITA_INDEX = 2; + public static final String NOME_ESTABELECIMENTO = "nome_estabelecimento"; + public static final String NOME_ESTABELECIMENTO_FULL = "planos_actuacao.nome_estabelecimento"; + public static final int NOME_ESTABELECIMENTO_INDEX = 3; + public static final String VALIDACAO_DIRECTOR_LOJA = "validacao_director_loja"; + public static final String VALIDACAO_DIRECTOR_LOJA_FULL = "planos_actuacao.validacao_director_loja"; + public static final int VALIDACAO_DIRECTOR_LOJA_INDEX = 4; + public static final String VALIDACAO_DNS = "validacao_dns"; + public static final String VALIDACAO_DNS_FULL = "planos_actuacao.validacao_dns"; + public static final int VALIDACAO_DNS_INDEX = 5; + public static final String VALIDACAO_HS = "validacao_hs"; + public static final String VALIDACAO_HS_FULL = "planos_actuacao.validacao_hs"; + public static final int VALIDACAO_HS_INDEX = 6; + public static final String PARECER_DNS = "parecer_dns"; + public static final String PARECER_DNS_FULL = "planos_actuacao.parecer_dns"; + public static final int PARECER_DNS_INDEX = 7; + public static final String OBS_CORRECAO = "obs_correcao"; + public static final String OBS_CORRECAO_FULL = "planos_actuacao.obs_correcao"; + public static final int OBS_CORRECAO_INDEX = 8; + public static final String DATA_VALIDACAO_DIR_LOJA = "data_validacao_dir_loja"; + public static final String DATA_VALIDACAO_DIR_LOJA_FULL = "planos_actuacao.data_validacao_dir_loja"; + public static final int DATA_VALIDACAO_DIR_LOJA_INDEX = 9; + public static final String USER_DIR_LOJA = "user_dir_loja"; + public static final String USER_DIR_LOJA_FULL = "planos_actuacao.user_dir_loja"; + public static final int USER_DIR_LOJA_INDEX = 10; + public static final String TO_USER_DIR_LOJA = "to_user_dir_loja"; + public static final String TO_USER_DIR_LOJA_FULL = "planos_actuacao.to_user_dir_loja"; + public static final int TO_USER_DIR_LOJA_INDEX = 11; + public static final String DATA_VALIDACAO_DNS = "data_validacao_dns"; + public static final String DATA_VALIDACAO_DNS_FULL = "planos_actuacao.data_validacao_dns"; + public static final int DATA_VALIDACAO_DNS_INDEX = 12; + public static final String USER_DNS = "user_dns"; + public static final String USER_DNS_FULL = "planos_actuacao.user_dns"; + public static final int USER_DNS_INDEX = 13; + public static final String TO_USER_DNS = "to_user_dns"; + public static final String TO_USER_DNS_FULL = "planos_actuacao.to_user_dns"; + public static final int TO_USER_DNS_INDEX = 14; + public static final String DATA_VALIDACAO_HS = "data_validacao_hs"; + public static final String DATA_VALIDACAO_HS_FULL = "planos_actuacao.data_validacao_hs"; + public static final int DATA_VALIDACAO_HS_INDEX = 15; + public static final String USER_HS = "user_hs"; + public static final String USER_HS_FULL = "planos_actuacao.user_hs"; + public static final int USER_HS_INDEX = 16; + public static final String TO_USER_HS = "to_user_hs"; + public static final String TO_USER_HS_FULL = "planos_actuacao.to_user_hs"; + public static final int TO_USER_HS_INDEX = 17; + public static final String FASE_ANTES_CORRECAO = "fase_antes_correcao"; + public static final String FASE_ANTES_CORRECAO_FULL = "planos_actuacao.fase_antes_correcao"; + public static final int FASE_ANTES_CORRECAO_INDEX = 18; + public static final String CORRECAO = "correcao"; + public static final String CORRECAO_FULL = "planos_actuacao.correcao"; + public static final int CORRECAO_INDEX = 19; + public static final String OBSERVACOES_DL = "observacoes_dl"; + public static final String OBSERVACOES_DL_FULL = "planos_actuacao.observacoes_dl"; + public static final int OBSERVACOES_DL_INDEX = 20; + public static final String OBSERVACOES_DNS = "observacoes_dns"; + public static final String OBSERVACOES_DNS_FULL = "planos_actuacao.observacoes_dns"; + public static final int OBSERVACOES_DNS_INDEX = 21; + public static final String VERIFICACAO_SIPRP = "verificacao_siprp"; + public static final String VERIFICACAO_SIPRP_FULL = "planos_actuacao.verificacao_siprp"; + public static final int VERIFICACAO_SIPRP_INDEX = 22; + public static final String DATA_CONTROLO = "data_controlo"; + public static final String DATA_CONTROLO_FULL = "planos_actuacao.data_controlo"; + public static final int DATA_CONTROLO_INDEX = 23; + public static final String DATA_EMAIL_CONTROLO = "data_email_controlo"; + public static final String DATA_EMAIL_CONTROLO_FULL = "planos_actuacao.data_email_controlo"; + public static final int DATA_EMAIL_CONTROLO_INDEX = 24; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "planos_actuacao.empresa_id"; + public static final int EMPRESA_ID_INDEX = 25; + public static final String NOME_EMPRESA = "nome_empresa"; + public static final String NOME_EMPRESA_FULL = "planos_actuacao.nome_empresa"; + public static final int NOME_EMPRESA_INDEX = 26; + public static final String TECNICO_HS_ID = "tecnico_hs_id"; + public static final String TECNICO_HS_ID_FULL = "planos_actuacao.tecnico_hs_id"; + public static final int TECNICO_HS_ID_INDEX = 27; + public static final String TECNICO_HS_NOME = "tecnico_hs_nome"; + public static final String TECNICO_HS_NOME_FULL = "planos_actuacao.tecnico_hs_nome"; + public static final int TECNICO_HS_NOME_INDEX = 28; + public static final String ID = "id"; + public static final String ID_FULL = "planos_actuacao.id"; + public static final int ID_INDEX = 29; + public static final String DATA_RELATORIO = "data_relatorio"; + public static final String DATA_RELATORIO_FULL = "planos_actuacao.data_relatorio"; + public static final int DATA_RELATORIO_INDEX = 30; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "planos_actuacao.deleted_date"; + public static final int DELETED_DATE_INDEX = 31; + public static final String CONCLUIDO_POR_DESACTIVACAO = "concluido_por_desactivacao"; + public static final String CONCLUIDO_POR_DESACTIVACAO_FULL = "planos_actuacao.concluido_por_desactivacao"; + public static final int CONCLUIDO_POR_DESACTIVACAO_INDEX = 32; + public static final String TECNICO_SUPERIOR_HS_ID = "tecnico_superior_hs_id"; + public static final String TECNICO_SUPERIOR_HS_ID_FULL = "planos_actuacao.tecnico_superior_hs_id"; + public static final int TECNICO_SUPERIOR_HS_ID_INDEX = 33; + public static final String TECNICO_SUPERIOR_HS_NOME = "tecnico_superior_hs_nome"; + public static final String TECNICO_SUPERIOR_HS_NOME_FULL = "planos_actuacao.tecnico_superior_hs_nome"; + public static final int TECNICO_SUPERIOR_HS_NOME_INDEX = 34; + public static final String DATA_DESACTIVACAO = "data_desactivacao"; + public static final String DATA_DESACTIVACAO_FULL = "planos_actuacao.data_desactivacao"; + public static final int DATA_DESACTIVACAO_INDEX = 35; + public static final String DATA_DISPONIBILIZACAO = "data_disponibilizacao"; + public static final String DATA_DISPONIBILIZACAO_FULL = "planos_actuacao.data_disponibilizacao"; + public static final int DATA_DISPONIBILIZACAO_INDEX = 36; + public static final String DATA_VALIDACAO_SEG = "data_validacao_seg"; + public static final String DATA_VALIDACAO_SEG_FULL = "planos_actuacao.data_validacao_seg"; + public static final int DATA_VALIDACAO_SEG_INDEX = 37; + public static final String USER_SEG = "user_seg"; + public static final String USER_SEG_FULL = "planos_actuacao.user_seg"; + public static final int USER_SEG_INDEX = 38; + public static final String HS_RELATORIO_ID = "hs_relatorio_id"; + public static final String HS_RELATORIO_ID_FULL = "planos_actuacao.hs_relatorio_id"; + public static final int HS_RELATORIO_ID_INDEX = 39; + + public static final String FIELD_NAMES[] = new String[]{ + ESTABELECIMENTO_ID, FASE, DATA_VISITA, NOME_ESTABELECIMENTO, + VALIDACAO_DIRECTOR_LOJA, VALIDACAO_DNS, VALIDACAO_HS, PARECER_DNS, + OBS_CORRECAO, DATA_VALIDACAO_DIR_LOJA, USER_DIR_LOJA, TO_USER_DIR_LOJA, + DATA_VALIDACAO_DNS, USER_DNS, TO_USER_DNS, DATA_VALIDACAO_HS, USER_HS, + TO_USER_HS, FASE_ANTES_CORRECAO, CORRECAO, OBSERVACOES_DL, OBSERVACOES_DNS, + VERIFICACAO_SIPRP, DATA_CONTROLO, DATA_EMAIL_CONTROLO, EMPRESA_ID, + NOME_EMPRESA, TECNICO_HS_ID, TECNICO_HS_NOME, DATA_RELATORIO, DELETED_DATE, + CONCLUIDO_POR_DESACTIVACAO, TECNICO_SUPERIOR_HS_ID, + TECNICO_SUPERIOR_HS_NOME, DATA_DESACTIVACAO, DATA_DISPONIBILIZACAO, + DATA_VALIDACAO_SEG, USER_SEG, HS_RELATORIO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + FASE, TABLENAME + "." + DATA_VISITA, TABLENAME + "." + NOME_ESTABELECIMENTO, + TABLENAME + "." + VALIDACAO_DIRECTOR_LOJA, TABLENAME + "." + VALIDACAO_DNS, TABLENAME + "." + VALIDACAO_HS, TABLENAME + "." + PARECER_DNS, + TABLENAME + "." + OBS_CORRECAO, TABLENAME + "." + DATA_VALIDACAO_DIR_LOJA, TABLENAME + "." + USER_DIR_LOJA, TABLENAME + "." + TO_USER_DIR_LOJA, + TABLENAME + "." + DATA_VALIDACAO_DNS, TABLENAME + "." + USER_DNS, TABLENAME + "." + TO_USER_DNS, TABLENAME + "." + DATA_VALIDACAO_HS, TABLENAME + "." + USER_HS, + TABLENAME + "." + TO_USER_HS, TABLENAME + "." + FASE_ANTES_CORRECAO, TABLENAME + "." + CORRECAO, TABLENAME + "." + OBSERVACOES_DL, TABLENAME + "." + OBSERVACOES_DNS, + TABLENAME + "." + VERIFICACAO_SIPRP, TABLENAME + "." + DATA_CONTROLO, TABLENAME + "." + DATA_EMAIL_CONTROLO, TABLENAME + "." + EMPRESA_ID, + TABLENAME + "." + NOME_EMPRESA, TABLENAME + "." + TECNICO_HS_ID, TABLENAME + "." + TECNICO_HS_NOME, TABLENAME + "." + DATA_RELATORIO, TABLENAME + "." + DELETED_DATE, + TABLENAME + "." + CONCLUIDO_POR_DESACTIVACAO, TABLENAME + "." + TECNICO_SUPERIOR_HS_ID, + TABLENAME + "." + TECNICO_SUPERIOR_HS_NOME, TABLENAME + "." + DATA_DESACTIVACAO, TABLENAME + "." + DATA_DISPONIBILIZACAO, + TABLENAME + "." + DATA_VALIDACAO_SEG, TABLENAME + "." + USER_SEG, TABLENAME + "." + HS_RELATORIO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ESTABELECIMENTO_ID, FASE, DATA_VISITA, NOME_ESTABELECIMENTO, + VALIDACAO_DIRECTOR_LOJA, VALIDACAO_DNS, VALIDACAO_HS, PARECER_DNS, + OBS_CORRECAO, DATA_VALIDACAO_DIR_LOJA, USER_DIR_LOJA, DATA_VALIDACAO_DNS, + USER_DNS, DATA_VALIDACAO_HS, USER_HS, FASE_ANTES_CORRECAO, CORRECAO, + OBSERVACOES_DL, OBSERVACOES_DNS, VERIFICACAO_SIPRP, DATA_CONTROLO, + DATA_EMAIL_CONTROLO, EMPRESA_ID, NOME_EMPRESA, TECNICO_HS_ID, TECNICO_HS_NOME, + ID, DATA_RELATORIO, DELETED_DATE, CONCLUIDO_POR_DESACTIVACAO, + TECNICO_SUPERIOR_HS_ID, TECNICO_SUPERIOR_HS_NOME, DATA_DESACTIVACAO, + DATA_DISPONIBILIZACAO, DATA_VALIDACAO_SEG, USER_SEG, HS_RELATORIO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ESTABELECIMENTO_ID, FASE, DATA_VISITA, NOME_ESTABELECIMENTO, + VALIDACAO_DIRECTOR_LOJA, VALIDACAO_DNS, VALIDACAO_HS, PARECER_DNS, + OBS_CORRECAO, DATA_VALIDACAO_DIR_LOJA, USER_DIR_LOJA, DATA_VALIDACAO_DNS, + USER_DNS, DATA_VALIDACAO_HS, USER_HS, FASE_ANTES_CORRECAO, CORRECAO, + OBSERVACOES_DL, OBSERVACOES_DNS, VERIFICACAO_SIPRP, DATA_CONTROLO, + DATA_EMAIL_CONTROLO, EMPRESA_ID, NOME_EMPRESA, TECNICO_HS_ID, TECNICO_HS_NOME, + ID, DATA_RELATORIO, DELETED_DATE, CONCLUIDO_POR_DESACTIVACAO, + TECNICO_SUPERIOR_HS_ID, TECNICO_SUPERIOR_HS_NOME, DATA_DESACTIVACAO, + DATA_DISPONIBILIZACAO, DATA_VALIDACAO_SEG, USER_SEG, HS_RELATORIO_ID, }; + + private Integer estabelecimento_id; + private Integer fase; + private java.util.Date data_visita; + private String nome_estabelecimento; + private Boolean validacao_director_loja; + private Boolean validacao_dns; + private Boolean validacao_hs; + private String parecer_dns; + private String obs_correcao; + private java.util.Date data_validacao_dir_loja; + private Integer user_dir_loja; + private db.data.siprp.outer.UtilizadoresData to_user_dir_loja; + private java.util.Date data_validacao_dns; + private Integer user_dns; + private db.data.siprp.outer.UtilizadoresData to_user_dns; + private java.util.Date data_validacao_hs; + private Integer user_hs; + private db.data.siprp.outer.UtilizadoresData to_user_hs; + private Integer fase_antes_correcao; + private String correcao; + private String observacoes_dl; + private String observacoes_dns; + private String verificacao_siprp; + private java.util.Date data_controlo; + private java.util.Date data_email_controlo; + private Integer empresa_id; + private String nome_empresa; + private Integer tecnico_hs_id; + private String tecnico_hs_nome; + private Integer id; + private java.util.Date data_relatorio; + private java.sql.Timestamp deleted_date; + private Boolean concluido_por_desactivacao; + private Integer tecnico_superior_hs_id; + private String tecnico_superior_hs_nome; + private java.util.Date data_desactivacao; + private java.util.Date data_disponibilizacao; + private java.util.Date data_validacao_seg; + private Integer user_seg; + private Integer hs_relatorio_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PlanosActuacao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false + , false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false }; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public Integer getFase() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FASE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fase; + } + + public void setFase( Integer fase ) + { + try + { + preProcess( FASE, fase ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fase = fase; + LAZY_LOADED_OBJECTS.put( FASE, Boolean.TRUE ); + } + + public java.util.Date getData_visita() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_VISITA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_visita; + } + + public void setData_visita( java.util.Date data_visita ) + { + try + { + preProcess( DATA_VISITA, data_visita ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_visita = data_visita; + LAZY_LOADED_OBJECTS.put( DATA_VISITA, Boolean.TRUE ); + } + + public String getNome_estabelecimento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_ESTABELECIMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_estabelecimento; + } + + public void setNome_estabelecimento( String nome_estabelecimento ) + { + try + { + preProcess( NOME_ESTABELECIMENTO, nome_estabelecimento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_estabelecimento = nome_estabelecimento; + LAZY_LOADED_OBJECTS.put( NOME_ESTABELECIMENTO, Boolean.TRUE ); + } + + public Boolean getValidacao_director_loja() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALIDACAO_DIRECTOR_LOJA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.validacao_director_loja; + } + + public void setValidacao_director_loja( Boolean validacao_director_loja ) + { + try + { + preProcess( VALIDACAO_DIRECTOR_LOJA, validacao_director_loja ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.validacao_director_loja = validacao_director_loja; + LAZY_LOADED_OBJECTS.put( VALIDACAO_DIRECTOR_LOJA, Boolean.TRUE ); + } + + public Boolean getValidacao_dns() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALIDACAO_DNS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.validacao_dns; + } + + public void setValidacao_dns( Boolean validacao_dns ) + { + try + { + preProcess( VALIDACAO_DNS, validacao_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.validacao_dns = validacao_dns; + LAZY_LOADED_OBJECTS.put( VALIDACAO_DNS, Boolean.TRUE ); + } + + public Boolean getValidacao_hs() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALIDACAO_HS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.validacao_hs; + } + + public void setValidacao_hs( Boolean validacao_hs ) + { + try + { + preProcess( VALIDACAO_HS, validacao_hs ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.validacao_hs = validacao_hs; + LAZY_LOADED_OBJECTS.put( VALIDACAO_HS, Boolean.TRUE ); + } + + public String getParecer_dns() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PARECER_DNS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.parecer_dns; + } + + public void setParecer_dns( String parecer_dns ) + { + try + { + preProcess( PARECER_DNS, parecer_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.parecer_dns = parecer_dns; + LAZY_LOADED_OBJECTS.put( PARECER_DNS, Boolean.TRUE ); + } + + public String getObs_correcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBS_CORRECAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.obs_correcao; + } + + public void setObs_correcao( String obs_correcao ) + { + try + { + preProcess( OBS_CORRECAO, obs_correcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.obs_correcao = obs_correcao; + LAZY_LOADED_OBJECTS.put( OBS_CORRECAO, Boolean.TRUE ); + } + + public java.util.Date getData_validacao_dir_loja() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_VALIDACAO_DIR_LOJA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_validacao_dir_loja; + } + + public void setData_validacao_dir_loja( java.util.Date data_validacao_dir_loja ) + { + try + { + preProcess( DATA_VALIDACAO_DIR_LOJA, data_validacao_dir_loja ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_validacao_dir_loja = data_validacao_dir_loja; + LAZY_LOADED_OBJECTS.put( DATA_VALIDACAO_DIR_LOJA, Boolean.TRUE ); + } + + public Integer getUser_dir_loja() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_DIR_LOJA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_dir_loja; + } + + public void setUser_dir_loja( Integer user_dir_loja ) + { + try + { + preProcess( USER_DIR_LOJA, user_dir_loja ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_dir_loja = user_dir_loja; + LAZY_LOADED_OBJECTS.put( USER_DIR_LOJA, Boolean.TRUE ); + } + + public db.data.siprp.outer.UtilizadoresData toUser_dir_loja() + { + try + { + prepare( TO_USER_DIR_LOJA ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_user_dir_loja; + } + + public void setToUser_dir_loja( db.data.siprp.outer.UtilizadoresData to_user_dir_loja ) + { + try + { + preProcess( TO_USER_DIR_LOJA, to_user_dir_loja ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_user_dir_loja = to_user_dir_loja; + } + + public java.util.Date getData_validacao_dns() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_VALIDACAO_DNS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_validacao_dns; + } + + public void setData_validacao_dns( java.util.Date data_validacao_dns ) + { + try + { + preProcess( DATA_VALIDACAO_DNS, data_validacao_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_validacao_dns = data_validacao_dns; + LAZY_LOADED_OBJECTS.put( DATA_VALIDACAO_DNS, Boolean.TRUE ); + } + + public Integer getUser_dns() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_DNS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_dns; + } + + public void setUser_dns( Integer user_dns ) + { + try + { + preProcess( USER_DNS, user_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_dns = user_dns; + LAZY_LOADED_OBJECTS.put( USER_DNS, Boolean.TRUE ); + } + + public db.data.siprp.outer.UtilizadoresData toUser_dns() + { + try + { + prepare( TO_USER_DNS ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_user_dns; + } + + public void setToUser_dns( db.data.siprp.outer.UtilizadoresData to_user_dns ) + { + try + { + preProcess( TO_USER_DNS, to_user_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_user_dns = to_user_dns; + } + + public java.util.Date getData_validacao_hs() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_VALIDACAO_HS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_validacao_hs; + } + + public void setData_validacao_hs( java.util.Date data_validacao_hs ) + { + try + { + preProcess( DATA_VALIDACAO_HS, data_validacao_hs ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_validacao_hs = data_validacao_hs; + LAZY_LOADED_OBJECTS.put( DATA_VALIDACAO_HS, Boolean.TRUE ); + } + + public Integer getUser_hs() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_HS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_hs; + } + + public void setUser_hs( Integer user_hs ) + { + try + { + preProcess( USER_HS, user_hs ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_hs = user_hs; + LAZY_LOADED_OBJECTS.put( USER_HS, Boolean.TRUE ); + } + + public db.data.siprp.outer.UtilizadoresData toUser_hs() + { + try + { + prepare( TO_USER_HS ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_user_hs; + } + + public void setToUser_hs( db.data.siprp.outer.UtilizadoresData to_user_hs ) + { + try + { + preProcess( TO_USER_HS, to_user_hs ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_user_hs = to_user_hs; + } + + public Integer getFase_antes_correcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FASE_ANTES_CORRECAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fase_antes_correcao; + } + + public void setFase_antes_correcao( Integer fase_antes_correcao ) + { + try + { + preProcess( FASE_ANTES_CORRECAO, fase_antes_correcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fase_antes_correcao = fase_antes_correcao; + LAZY_LOADED_OBJECTS.put( FASE_ANTES_CORRECAO, Boolean.TRUE ); + } + + public String getCorrecao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CORRECAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.correcao; + } + + public void setCorrecao( String correcao ) + { + try + { + preProcess( CORRECAO, correcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.correcao = correcao; + LAZY_LOADED_OBJECTS.put( CORRECAO, Boolean.TRUE ); + } + + public String getObservacoes_dl() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES_DL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes_dl; + } + + public void setObservacoes_dl( String observacoes_dl ) + { + try + { + preProcess( OBSERVACOES_DL, observacoes_dl ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes_dl = observacoes_dl; + LAZY_LOADED_OBJECTS.put( OBSERVACOES_DL, Boolean.TRUE ); + } + + public String getObservacoes_dns() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES_DNS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes_dns; + } + + public void setObservacoes_dns( String observacoes_dns ) + { + try + { + preProcess( OBSERVACOES_DNS, observacoes_dns ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes_dns = observacoes_dns; + LAZY_LOADED_OBJECTS.put( OBSERVACOES_DNS, Boolean.TRUE ); + } + + public String getVerificacao_siprp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VERIFICACAO_SIPRP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.verificacao_siprp; + } + + public void setVerificacao_siprp( String verificacao_siprp ) + { + try + { + preProcess( VERIFICACAO_SIPRP, verificacao_siprp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.verificacao_siprp = verificacao_siprp; + LAZY_LOADED_OBJECTS.put( VERIFICACAO_SIPRP, Boolean.TRUE ); + } + + public java.util.Date getData_controlo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_CONTROLO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_controlo; + } + + public void setData_controlo( java.util.Date data_controlo ) + { + try + { + preProcess( DATA_CONTROLO, data_controlo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_controlo = data_controlo; + LAZY_LOADED_OBJECTS.put( DATA_CONTROLO, Boolean.TRUE ); + } + + public java.util.Date getData_email_controlo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMAIL_CONTROLO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_email_controlo; + } + + public void setData_email_controlo( java.util.Date data_email_controlo ) + { + try + { + preProcess( DATA_EMAIL_CONTROLO, data_email_controlo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_email_controlo = data_email_controlo; + LAZY_LOADED_OBJECTS.put( DATA_EMAIL_CONTROLO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public String getNome_empresa() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_EMPRESA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_empresa; + } + + public void setNome_empresa( String nome_empresa ) + { + try + { + preProcess( NOME_EMPRESA, nome_empresa ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_empresa = nome_empresa; + LAZY_LOADED_OBJECTS.put( NOME_EMPRESA, Boolean.TRUE ); + } + + public Integer getTecnico_hs_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_HS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_hs_id; + } + + public void setTecnico_hs_id( Integer tecnico_hs_id ) + { + try + { + preProcess( TECNICO_HS_ID, tecnico_hs_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_hs_id = tecnico_hs_id; + LAZY_LOADED_OBJECTS.put( TECNICO_HS_ID, Boolean.TRUE ); + } + + public String getTecnico_hs_nome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_HS_NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_hs_nome; + } + + public void setTecnico_hs_nome( String tecnico_hs_nome ) + { + try + { + preProcess( TECNICO_HS_NOME, tecnico_hs_nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_hs_nome = tecnico_hs_nome; + LAZY_LOADED_OBJECTS.put( TECNICO_HS_NOME, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPlanoAreas_plano_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanoAreasData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanoAreasData.class , getPrimaryKey().getMap().get("id"), "plano_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.Date getData_relatorio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RELATORIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_relatorio; + } + + public void setData_relatorio( java.util.Date data_relatorio ) + { + try + { + preProcess( DATA_RELATORIO, data_relatorio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_relatorio = data_relatorio; + LAZY_LOADED_OBJECTS.put( DATA_RELATORIO, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Boolean getConcluido_por_desactivacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONCLUIDO_POR_DESACTIVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.concluido_por_desactivacao; + } + + public void setConcluido_por_desactivacao( Boolean concluido_por_desactivacao ) + { + try + { + preProcess( CONCLUIDO_POR_DESACTIVACAO, concluido_por_desactivacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.concluido_por_desactivacao = concluido_por_desactivacao; + LAZY_LOADED_OBJECTS.put( CONCLUIDO_POR_DESACTIVACAO, Boolean.TRUE ); + } + + public Integer getTecnico_superior_hs_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_SUPERIOR_HS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_superior_hs_id; + } + + public void setTecnico_superior_hs_id( Integer tecnico_superior_hs_id ) + { + try + { + preProcess( TECNICO_SUPERIOR_HS_ID, tecnico_superior_hs_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_superior_hs_id = tecnico_superior_hs_id; + LAZY_LOADED_OBJECTS.put( TECNICO_SUPERIOR_HS_ID, Boolean.TRUE ); + } + + public String getTecnico_superior_hs_nome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_SUPERIOR_HS_NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_superior_hs_nome; + } + + public void setTecnico_superior_hs_nome( String tecnico_superior_hs_nome ) + { + try + { + preProcess( TECNICO_SUPERIOR_HS_NOME, tecnico_superior_hs_nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_superior_hs_nome = tecnico_superior_hs_nome; + LAZY_LOADED_OBJECTS.put( TECNICO_SUPERIOR_HS_NOME, Boolean.TRUE ); + } + + public java.util.Date getData_desactivacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_DESACTIVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_desactivacao; + } + + public void setData_desactivacao( java.util.Date data_desactivacao ) + { + try + { + preProcess( DATA_DESACTIVACAO, data_desactivacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_desactivacao = data_desactivacao; + LAZY_LOADED_OBJECTS.put( DATA_DESACTIVACAO, Boolean.TRUE ); + } + + public java.util.Date getData_disponibilizacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_DISPONIBILIZACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_disponibilizacao; + } + + public void setData_disponibilizacao( java.util.Date data_disponibilizacao ) + { + try + { + preProcess( DATA_DISPONIBILIZACAO, data_disponibilizacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_disponibilizacao = data_disponibilizacao; + LAZY_LOADED_OBJECTS.put( DATA_DISPONIBILIZACAO, Boolean.TRUE ); + } + + public java.util.Date getData_validacao_seg() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_VALIDACAO_SEG ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_validacao_seg; + } + + public void setData_validacao_seg( java.util.Date data_validacao_seg ) + { + try + { + preProcess( DATA_VALIDACAO_SEG, data_validacao_seg ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_validacao_seg = data_validacao_seg; + LAZY_LOADED_OBJECTS.put( DATA_VALIDACAO_SEG, Boolean.TRUE ); + } + + public Integer getUser_seg() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_SEG ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_seg; + } + + public void setUser_seg( Integer user_seg ) + { + try + { + preProcess( USER_SEG, user_seg ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_seg = user_seg; + LAZY_LOADED_OBJECTS.put( USER_SEG, Boolean.TRUE ); + } + + public Integer getHs_relatorio_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_RELATORIO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_relatorio_id; + } + + public void setHs_relatorio_id( Integer hs_relatorio_id ) + { + try + { + preProcess( HS_RELATORIO_ID, hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_relatorio_id = hs_relatorio_id; + LAZY_LOADED_OBJECTS.put( HS_RELATORIO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanosActuacao.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case PlanosActuacao.FASE_INDEX: + value = getFase(); + break; + case PlanosActuacao.DATA_VISITA_INDEX: + value = getData_visita(); + break; + case PlanosActuacao.NOME_ESTABELECIMENTO_INDEX: + value = getNome_estabelecimento(); + break; + case PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX: + value = getValidacao_director_loja(); + break; + case PlanosActuacao.VALIDACAO_DNS_INDEX: + value = getValidacao_dns(); + break; + case PlanosActuacao.VALIDACAO_HS_INDEX: + value = getValidacao_hs(); + break; + case PlanosActuacao.PARECER_DNS_INDEX: + value = getParecer_dns(); + break; + case PlanosActuacao.OBS_CORRECAO_INDEX: + value = getObs_correcao(); + break; + case PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX: + value = getData_validacao_dir_loja(); + break; + case PlanosActuacao.USER_DIR_LOJA_INDEX: + value = getUser_dir_loja(); + break; + case PlanosActuacao.TO_USER_DIR_LOJA_INDEX: + value = toUser_dir_loja(); + break; + case PlanosActuacao.DATA_VALIDACAO_DNS_INDEX: + value = getData_validacao_dns(); + break; + case PlanosActuacao.USER_DNS_INDEX: + value = getUser_dns(); + break; + case PlanosActuacao.TO_USER_DNS_INDEX: + value = toUser_dns(); + break; + case PlanosActuacao.DATA_VALIDACAO_HS_INDEX: + value = getData_validacao_hs(); + break; + case PlanosActuacao.USER_HS_INDEX: + value = getUser_hs(); + break; + case PlanosActuacao.TO_USER_HS_INDEX: + value = toUser_hs(); + break; + case PlanosActuacao.FASE_ANTES_CORRECAO_INDEX: + value = getFase_antes_correcao(); + break; + case PlanosActuacao.CORRECAO_INDEX: + value = getCorrecao(); + break; + case PlanosActuacao.OBSERVACOES_DL_INDEX: + value = getObservacoes_dl(); + break; + case PlanosActuacao.OBSERVACOES_DNS_INDEX: + value = getObservacoes_dns(); + break; + case PlanosActuacao.VERIFICACAO_SIPRP_INDEX: + value = getVerificacao_siprp(); + break; + case PlanosActuacao.DATA_CONTROLO_INDEX: + value = getData_controlo(); + break; + case PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX: + value = getData_email_controlo(); + break; + case PlanosActuacao.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case PlanosActuacao.NOME_EMPRESA_INDEX: + value = getNome_empresa(); + break; + case PlanosActuacao.TECNICO_HS_ID_INDEX: + value = getTecnico_hs_id(); + break; + case PlanosActuacao.TECNICO_HS_NOME_INDEX: + value = getTecnico_hs_nome(); + break; + case PlanosActuacao.ID_INDEX: + value = getId(); + break; + case PlanosActuacao.DATA_RELATORIO_INDEX: + value = getData_relatorio(); + break; + case PlanosActuacao.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX: + value = getConcluido_por_desactivacao(); + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX: + value = getTecnico_superior_hs_id(); + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX: + value = getTecnico_superior_hs_nome(); + break; + case PlanosActuacao.DATA_DESACTIVACAO_INDEX: + value = getData_desactivacao(); + break; + case PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX: + value = getData_disponibilizacao(); + break; + case PlanosActuacao.DATA_VALIDACAO_SEG_INDEX: + value = getData_validacao_seg(); + break; + case PlanosActuacao.USER_SEG_INDEX: + value = getUser_seg(); + break; + case PlanosActuacao.HS_RELATORIO_ID_INDEX: + value = getHs_relatorio_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanosActuacao.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case PlanosActuacao.FASE_INDEX: + value = this.fase; + break; + case PlanosActuacao.DATA_VISITA_INDEX: + value = this.data_visita; + break; + case PlanosActuacao.NOME_ESTABELECIMENTO_INDEX: + value = this.nome_estabelecimento; + break; + case PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX: + value = this.validacao_director_loja; + break; + case PlanosActuacao.VALIDACAO_DNS_INDEX: + value = this.validacao_dns; + break; + case PlanosActuacao.VALIDACAO_HS_INDEX: + value = this.validacao_hs; + break; + case PlanosActuacao.PARECER_DNS_INDEX: + value = this.parecer_dns; + break; + case PlanosActuacao.OBS_CORRECAO_INDEX: + value = this.obs_correcao; + break; + case PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX: + value = this.data_validacao_dir_loja; + break; + case PlanosActuacao.USER_DIR_LOJA_INDEX: + value = this.user_dir_loja; + break; + case PlanosActuacao.TO_USER_DIR_LOJA_INDEX: + value = this.to_user_dir_loja; + break; + case PlanosActuacao.DATA_VALIDACAO_DNS_INDEX: + value = this.data_validacao_dns; + break; + case PlanosActuacao.USER_DNS_INDEX: + value = this.user_dns; + break; + case PlanosActuacao.TO_USER_DNS_INDEX: + value = this.to_user_dns; + break; + case PlanosActuacao.DATA_VALIDACAO_HS_INDEX: + value = this.data_validacao_hs; + break; + case PlanosActuacao.USER_HS_INDEX: + value = this.user_hs; + break; + case PlanosActuacao.TO_USER_HS_INDEX: + value = this.to_user_hs; + break; + case PlanosActuacao.FASE_ANTES_CORRECAO_INDEX: + value = this.fase_antes_correcao; + break; + case PlanosActuacao.CORRECAO_INDEX: + value = this.correcao; + break; + case PlanosActuacao.OBSERVACOES_DL_INDEX: + value = this.observacoes_dl; + break; + case PlanosActuacao.OBSERVACOES_DNS_INDEX: + value = this.observacoes_dns; + break; + case PlanosActuacao.VERIFICACAO_SIPRP_INDEX: + value = this.verificacao_siprp; + break; + case PlanosActuacao.DATA_CONTROLO_INDEX: + value = this.data_controlo; + break; + case PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX: + value = this.data_email_controlo; + break; + case PlanosActuacao.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case PlanosActuacao.NOME_EMPRESA_INDEX: + value = this.nome_empresa; + break; + case PlanosActuacao.TECNICO_HS_ID_INDEX: + value = this.tecnico_hs_id; + break; + case PlanosActuacao.TECNICO_HS_NOME_INDEX: + value = this.tecnico_hs_nome; + break; + case PlanosActuacao.ID_INDEX: + value = this.id; + break; + case PlanosActuacao.DATA_RELATORIO_INDEX: + value = this.data_relatorio; + break; + case PlanosActuacao.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX: + value = this.concluido_por_desactivacao; + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX: + value = this.tecnico_superior_hs_id; + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX: + value = this.tecnico_superior_hs_nome; + break; + case PlanosActuacao.DATA_DESACTIVACAO_INDEX: + value = this.data_desactivacao; + break; + case PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX: + value = this.data_disponibilizacao; + break; + case PlanosActuacao.DATA_VALIDACAO_SEG_INDEX: + value = this.data_validacao_seg; + break; + case PlanosActuacao.USER_SEG_INDEX: + value = this.user_seg; + break; + case PlanosActuacao.HS_RELATORIO_ID_INDEX: + value = this.hs_relatorio_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanosActuacao.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case PlanosActuacao.FASE_INDEX: + setFase( ( Integer ) value ); + break; + case PlanosActuacao.DATA_VISITA_INDEX: + setData_visita( ( java.util.Date ) value ); + break; + case PlanosActuacao.NOME_ESTABELECIMENTO_INDEX: + setNome_estabelecimento( ( String ) value ); + break; + case PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX: + setValidacao_director_loja( ( Boolean ) value ); + break; + case PlanosActuacao.VALIDACAO_DNS_INDEX: + setValidacao_dns( ( Boolean ) value ); + break; + case PlanosActuacao.VALIDACAO_HS_INDEX: + setValidacao_hs( ( Boolean ) value ); + break; + case PlanosActuacao.PARECER_DNS_INDEX: + setParecer_dns( ( String ) value ); + break; + case PlanosActuacao.OBS_CORRECAO_INDEX: + setObs_correcao( ( String ) value ); + break; + case PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX: + setData_validacao_dir_loja( ( java.util.Date ) value ); + break; + case PlanosActuacao.USER_DIR_LOJA_INDEX: + setUser_dir_loja( ( Integer ) value ); + break; + case PlanosActuacao.TO_USER_DIR_LOJA_INDEX: + setToUser_dir_loja( ( db.data.siprp.outer.UtilizadoresData ) value ); + break; + case PlanosActuacao.DATA_VALIDACAO_DNS_INDEX: + setData_validacao_dns( ( java.util.Date ) value ); + break; + case PlanosActuacao.USER_DNS_INDEX: + setUser_dns( ( Integer ) value ); + break; + case PlanosActuacao.TO_USER_DNS_INDEX: + setToUser_dns( ( db.data.siprp.outer.UtilizadoresData ) value ); + break; + case PlanosActuacao.DATA_VALIDACAO_HS_INDEX: + setData_validacao_hs( ( java.util.Date ) value ); + break; + case PlanosActuacao.USER_HS_INDEX: + setUser_hs( ( Integer ) value ); + break; + case PlanosActuacao.TO_USER_HS_INDEX: + setToUser_hs( ( db.data.siprp.outer.UtilizadoresData ) value ); + break; + case PlanosActuacao.FASE_ANTES_CORRECAO_INDEX: + setFase_antes_correcao( ( Integer ) value ); + break; + case PlanosActuacao.CORRECAO_INDEX: + setCorrecao( ( String ) value ); + break; + case PlanosActuacao.OBSERVACOES_DL_INDEX: + setObservacoes_dl( ( String ) value ); + break; + case PlanosActuacao.OBSERVACOES_DNS_INDEX: + setObservacoes_dns( ( String ) value ); + break; + case PlanosActuacao.VERIFICACAO_SIPRP_INDEX: + setVerificacao_siprp( ( String ) value ); + break; + case PlanosActuacao.DATA_CONTROLO_INDEX: + setData_controlo( ( java.util.Date ) value ); + break; + case PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX: + setData_email_controlo( ( java.util.Date ) value ); + break; + case PlanosActuacao.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case PlanosActuacao.NOME_EMPRESA_INDEX: + setNome_empresa( ( String ) value ); + break; + case PlanosActuacao.TECNICO_HS_ID_INDEX: + setTecnico_hs_id( ( Integer ) value ); + break; + case PlanosActuacao.TECNICO_HS_NOME_INDEX: + setTecnico_hs_nome( ( String ) value ); + break; + case PlanosActuacao.ID_INDEX: + setId( ( Integer ) value ); + break; + case PlanosActuacao.DATA_RELATORIO_INDEX: + setData_relatorio( ( java.util.Date ) value ); + break; + case PlanosActuacao.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX: + setConcluido_por_desactivacao( ( Boolean ) value ); + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX: + setTecnico_superior_hs_id( ( Integer ) value ); + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX: + setTecnico_superior_hs_nome( ( String ) value ); + break; + case PlanosActuacao.DATA_DESACTIVACAO_INDEX: + setData_desactivacao( ( java.util.Date ) value ); + break; + case PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX: + setData_disponibilizacao( ( java.util.Date ) value ); + break; + case PlanosActuacao.DATA_VALIDACAO_SEG_INDEX: + setData_validacao_seg( ( java.util.Date ) value ); + break; + case PlanosActuacao.USER_SEG_INDEX: + setUser_seg( ( Integer ) value ); + break; + case PlanosActuacao.HS_RELATORIO_ID_INDEX: + setHs_relatorio_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PlanosActuacao.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case PlanosActuacao.FASE_INDEX: + this.fase = ( Integer ) value; + break; + case PlanosActuacao.DATA_VISITA_INDEX: + this.data_visita = ( java.util.Date ) value; + break; + case PlanosActuacao.NOME_ESTABELECIMENTO_INDEX: + this.nome_estabelecimento = ( String ) value; + break; + case PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX: + this.validacao_director_loja = ( Boolean ) value; + break; + case PlanosActuacao.VALIDACAO_DNS_INDEX: + this.validacao_dns = ( Boolean ) value; + break; + case PlanosActuacao.VALIDACAO_HS_INDEX: + this.validacao_hs = ( Boolean ) value; + break; + case PlanosActuacao.PARECER_DNS_INDEX: + this.parecer_dns = ( String ) value; + break; + case PlanosActuacao.OBS_CORRECAO_INDEX: + this.obs_correcao = ( String ) value; + break; + case PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX: + this.data_validacao_dir_loja = ( java.util.Date ) value; + break; + case PlanosActuacao.USER_DIR_LOJA_INDEX: + this.user_dir_loja = ( Integer ) value; + break; + case PlanosActuacao.TO_USER_DIR_LOJA_INDEX: + this.to_user_dir_loja = ( db.data.siprp.outer.UtilizadoresData ) value; + break; + case PlanosActuacao.DATA_VALIDACAO_DNS_INDEX: + this.data_validacao_dns = ( java.util.Date ) value; + break; + case PlanosActuacao.USER_DNS_INDEX: + this.user_dns = ( Integer ) value; + break; + case PlanosActuacao.TO_USER_DNS_INDEX: + this.to_user_dns = ( db.data.siprp.outer.UtilizadoresData ) value; + break; + case PlanosActuacao.DATA_VALIDACAO_HS_INDEX: + this.data_validacao_hs = ( java.util.Date ) value; + break; + case PlanosActuacao.USER_HS_INDEX: + this.user_hs = ( Integer ) value; + break; + case PlanosActuacao.TO_USER_HS_INDEX: + this.to_user_hs = ( db.data.siprp.outer.UtilizadoresData ) value; + break; + case PlanosActuacao.FASE_ANTES_CORRECAO_INDEX: + this.fase_antes_correcao = ( Integer ) value; + break; + case PlanosActuacao.CORRECAO_INDEX: + this.correcao = ( String ) value; + break; + case PlanosActuacao.OBSERVACOES_DL_INDEX: + this.observacoes_dl = ( String ) value; + break; + case PlanosActuacao.OBSERVACOES_DNS_INDEX: + this.observacoes_dns = ( String ) value; + break; + case PlanosActuacao.VERIFICACAO_SIPRP_INDEX: + this.verificacao_siprp = ( String ) value; + break; + case PlanosActuacao.DATA_CONTROLO_INDEX: + this.data_controlo = ( java.util.Date ) value; + break; + case PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX: + this.data_email_controlo = ( java.util.Date ) value; + break; + case PlanosActuacao.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case PlanosActuacao.NOME_EMPRESA_INDEX: + this.nome_empresa = ( String ) value; + break; + case PlanosActuacao.TECNICO_HS_ID_INDEX: + this.tecnico_hs_id = ( Integer ) value; + break; + case PlanosActuacao.TECNICO_HS_NOME_INDEX: + this.tecnico_hs_nome = ( String ) value; + break; + case PlanosActuacao.ID_INDEX: + this.id = ( Integer ) value; + break; + case PlanosActuacao.DATA_RELATORIO_INDEX: + this.data_relatorio = ( java.util.Date ) value; + break; + case PlanosActuacao.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX: + this.concluido_por_desactivacao = ( Boolean ) value; + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX: + this.tecnico_superior_hs_id = ( Integer ) value; + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX: + this.tecnico_superior_hs_nome = ( String ) value; + break; + case PlanosActuacao.DATA_DESACTIVACAO_INDEX: + this.data_desactivacao = ( java.util.Date ) value; + break; + case PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX: + this.data_disponibilizacao = ( java.util.Date ) value; + break; + case PlanosActuacao.DATA_VALIDACAO_SEG_INDEX: + this.data_validacao_seg = ( java.util.Date ) value; + break; + case PlanosActuacao.USER_SEG_INDEX: + this.user_seg = ( Integer ) value; + break; + case PlanosActuacao.HS_RELATORIO_ID_INDEX: + this.hs_relatorio_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PlanosActuacao.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.FASE_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.DATA_VISITA_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.NOME_ESTABELECIMENTO_INDEX: + theClass = String.class; + break; + case PlanosActuacao.VALIDACAO_DIRECTOR_LOJA_INDEX: + theClass = Boolean.class; + break; + case PlanosActuacao.VALIDACAO_DNS_INDEX: + theClass = Boolean.class; + break; + case PlanosActuacao.VALIDACAO_HS_INDEX: + theClass = Boolean.class; + break; + case PlanosActuacao.PARECER_DNS_INDEX: + theClass = String.class; + break; + case PlanosActuacao.OBS_CORRECAO_INDEX: + theClass = String.class; + break; + case PlanosActuacao.DATA_VALIDACAO_DIR_LOJA_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.USER_DIR_LOJA_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.TO_USER_DIR_LOJA_INDEX: + theClass = db.data.siprp.outer.UtilizadoresData.class; + break; + case PlanosActuacao.DATA_VALIDACAO_DNS_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.USER_DNS_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.TO_USER_DNS_INDEX: + theClass = db.data.siprp.outer.UtilizadoresData.class; + break; + case PlanosActuacao.DATA_VALIDACAO_HS_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.USER_HS_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.TO_USER_HS_INDEX: + theClass = db.data.siprp.outer.UtilizadoresData.class; + break; + case PlanosActuacao.FASE_ANTES_CORRECAO_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.CORRECAO_INDEX: + theClass = String.class; + break; + case PlanosActuacao.OBSERVACOES_DL_INDEX: + theClass = String.class; + break; + case PlanosActuacao.OBSERVACOES_DNS_INDEX: + theClass = String.class; + break; + case PlanosActuacao.VERIFICACAO_SIPRP_INDEX: + theClass = String.class; + break; + case PlanosActuacao.DATA_CONTROLO_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.DATA_EMAIL_CONTROLO_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.NOME_EMPRESA_INDEX: + theClass = String.class; + break; + case PlanosActuacao.TECNICO_HS_ID_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.TECNICO_HS_NOME_INDEX: + theClass = String.class; + break; + case PlanosActuacao.ID_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.DATA_RELATORIO_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case PlanosActuacao.CONCLUIDO_POR_DESACTIVACAO_INDEX: + theClass = Boolean.class; + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_ID_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.TECNICO_SUPERIOR_HS_NOME_INDEX: + theClass = String.class; + break; + case PlanosActuacao.DATA_DESACTIVACAO_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.DATA_DISPONIBILIZACAO_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.DATA_VALIDACAO_SEG_INDEX: + theClass = java.util.Date.class; + break; + case PlanosActuacao.USER_SEG_INDEX: + theClass = Integer.class; + break; + case PlanosActuacao.HS_RELATORIO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PlanosActuacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PlanosActuacao.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Properties.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Properties.java new file mode 100644 index 00000000..987f8cf7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Properties.java @@ -0,0 +1,178 @@ +/* +* Properties.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Properties extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "properties"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.properties"; + + public static final int _INVALID__INDEX = -1; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + }; + + + protected com.evolute.entity.utils.ObjectPrimaryKey primaryKey; + + public Properties() + { + super(); + dirtyProperties = new boolean[]{ }; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on Properties is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Properties._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.ObjectPrimaryKey( TABLENAME, Properties.PK_FIELD_NAMES ); + } + } + + @Override + public com.evolute.entity.utils.ObjectPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Recomendacoes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Recomendacoes.java new file mode 100644 index 00000000..1c741b1c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Recomendacoes.java @@ -0,0 +1,393 @@ +/* +* Recomendacoes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Recomendacoes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Recomendacoes.ID, Recomendacoes.ID_INDEX ); + FIELD_INDEXES.put( Recomendacoes.ID_FULL, Recomendacoes.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Recomendacoes.CLASS_IDENTIFIER, Recomendacoes.ANALISE_ID, Recomendacoes.TO_ANALISE_ID ); + FIELD_INDEXES.put( Recomendacoes.ANALISE_ID, Recomendacoes.ANALISE_ID_INDEX ); + FIELD_INDEXES.put( Recomendacoes.ANALISE_ID_FULL, Recomendacoes.ANALISE_ID_INDEX ); + FIELD_INDEXES.put( Recomendacoes.TO_ANALISE_ID, Recomendacoes.TO_ANALISE_ID_INDEX ); + FIELD_INDEXES.put( Recomendacoes.RECOMENDACAO, Recomendacoes.RECOMENDACAO_INDEX ); + FIELD_INDEXES.put( Recomendacoes.RECOMENDACAO_FULL, Recomendacoes.RECOMENDACAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyanalise_idToanalises_acidentes = + new com.evolute.entity.ForeignKey( Recomendacoes.class, Recomendacoes.ANALISE_ID, db.data.siprp.outer.AnalisesAcidentesData.class, db.data.siprp.outer.AnalisesAcidentesData.ID ); + + public static final String TABLENAME = "recomendacoes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.recomendacoes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "recomendacoes.id"; + public static final int ID_INDEX = 0; + public static final String ANALISE_ID = "analise_id"; + public static final String ANALISE_ID_FULL = "recomendacoes.analise_id"; + public static final int ANALISE_ID_INDEX = 1; + public static final String TO_ANALISE_ID = "to_analise_id"; + public static final String TO_ANALISE_ID_FULL = "recomendacoes.to_analise_id"; + public static final int TO_ANALISE_ID_INDEX = 2; + public static final String RECOMENDACAO = "recomendacao"; + public static final String RECOMENDACAO_FULL = "recomendacoes.recomendacao"; + public static final int RECOMENDACAO_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + ANALISE_ID, TO_ANALISE_ID, RECOMENDACAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ANALISE_ID, TABLENAME + "." + TO_ANALISE_ID, TABLENAME + "." + RECOMENDACAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ANALISE_ID, RECOMENDACAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ANALISE_ID, RECOMENDACAO, }; + + private Integer id; + private Integer analise_id; + private db.data.siprp.outer.AnalisesAcidentesData to_analise_id; + private String recomendacao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Recomendacoes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getAnalise_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analise_id; + } + + public void setAnalise_id( Integer analise_id ) + { + try + { + preProcess( ANALISE_ID, analise_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analise_id = analise_id; + LAZY_LOADED_OBJECTS.put( ANALISE_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.AnalisesAcidentesData toAnalise_id() + { + try + { + prepare( TO_ANALISE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_analise_id; + } + + public void setToAnalise_id( db.data.siprp.outer.AnalisesAcidentesData to_analise_id ) + { + try + { + preProcess( TO_ANALISE_ID, to_analise_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_analise_id = to_analise_id; + } + + public String getRecomendacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RECOMENDACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.recomendacao; + } + + public void setRecomendacao( String recomendacao ) + { + try + { + preProcess( RECOMENDACAO, recomendacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.recomendacao = recomendacao; + LAZY_LOADED_OBJECTS.put( RECOMENDACAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Recomendacoes.ID_INDEX: + value = getId(); + break; + case Recomendacoes.ANALISE_ID_INDEX: + value = getAnalise_id(); + break; + case Recomendacoes.TO_ANALISE_ID_INDEX: + value = toAnalise_id(); + break; + case Recomendacoes.RECOMENDACAO_INDEX: + value = getRecomendacao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Recomendacoes.ID_INDEX: + value = this.id; + break; + case Recomendacoes.ANALISE_ID_INDEX: + value = this.analise_id; + break; + case Recomendacoes.TO_ANALISE_ID_INDEX: + value = this.to_analise_id; + break; + case Recomendacoes.RECOMENDACAO_INDEX: + value = this.recomendacao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Recomendacoes.ID_INDEX: + setId( ( Integer ) value ); + break; + case Recomendacoes.ANALISE_ID_INDEX: + setAnalise_id( ( Integer ) value ); + break; + case Recomendacoes.TO_ANALISE_ID_INDEX: + setToAnalise_id( ( db.data.siprp.outer.AnalisesAcidentesData ) value ); + break; + case Recomendacoes.RECOMENDACAO_INDEX: + setRecomendacao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Recomendacoes.ID_INDEX: + this.id = ( Integer ) value; + break; + case Recomendacoes.ANALISE_ID_INDEX: + this.analise_id = ( Integer ) value; + break; + case Recomendacoes.TO_ANALISE_ID_INDEX: + this.to_analise_id = ( db.data.siprp.outer.AnalisesAcidentesData ) value; + break; + case Recomendacoes.RECOMENDACAO_INDEX: + this.recomendacao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Recomendacoes.ID_INDEX: + theClass = Integer.class; + break; + case Recomendacoes.ANALISE_ID_INDEX: + theClass = Integer.class; + break; + case Recomendacoes.TO_ANALISE_ID_INDEX: + theClass = db.data.siprp.outer.AnalisesAcidentesData.class; + break; + case Recomendacoes.RECOMENDACAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Recomendacoes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Recomendacoes.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/RiscoValoresTemp.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/RiscoValoresTemp.java new file mode 100644 index 00000000..8bf76521 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/RiscoValoresTemp.java @@ -0,0 +1,178 @@ +/* +* RiscoValoresTemp.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class RiscoValoresTemp extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "risco_valores_temp"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.risco_valores_temp"; + + public static final int _INVALID__INDEX = -1; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + }; + + + protected com.evolute.entity.utils.ObjectPrimaryKey primaryKey; + + public RiscoValoresTemp() + { + super(); + dirtyProperties = new boolean[]{ }; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on RiscoValoresTemp is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : RiscoValoresTemp._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.ObjectPrimaryKey( TABLENAME, RiscoValoresTemp.PK_FIELD_NAMES ); + } + } + + @Override + public com.evolute.entity.utils.ObjectPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Roles.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Roles.java new file mode 100644 index 00000000..ac757915 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Roles.java @@ -0,0 +1,178 @@ +/* +* Roles.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Roles extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "roles"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.roles"; + + public static final int _INVALID__INDEX = -1; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + }; + + + protected com.evolute.entity.utils.ObjectPrimaryKey primaryKey; + + public Roles() + { + super(); + dirtyProperties = new boolean[]{ }; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on Roles is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Roles._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.ObjectPrimaryKey( TABLENAME, Roles.PK_FIELD_NAMES ); + } + } + + @Override + public com.evolute.entity.utils.ObjectPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Seccoes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Seccoes.java new file mode 100644 index 00000000..e8e86bac --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Seccoes.java @@ -0,0 +1,459 @@ +/* +* Seccoes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Seccoes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Seccoes.ID, Seccoes.ID_INDEX ); + FIELD_INDEXES.put( Seccoes.ID_FULL, Seccoes.ID_INDEX ); + FIELD_INDEXES.put( Seccoes.DESCRICAO, Seccoes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Seccoes.DESCRICAO_FULL, Seccoes.DESCRICAO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Seccoes.CLASS_IDENTIFIER, Seccoes.DEPARTAMENTO_ID, Seccoes.TO_DEPARTAMENTO_ID ); + FIELD_INDEXES.put( Seccoes.DEPARTAMENTO_ID, Seccoes.DEPARTAMENTO_ID_INDEX ); + FIELD_INDEXES.put( Seccoes.DEPARTAMENTO_ID_FULL, Seccoes.DEPARTAMENTO_ID_INDEX ); + FIELD_INDEXES.put( Seccoes.TO_DEPARTAMENTO_ID, Seccoes.TO_DEPARTAMENTO_ID_INDEX ); + FIELD_INDEXES.put( Seccoes.ACTIVO, Seccoes.ACTIVO_INDEX ); + FIELD_INDEXES.put( Seccoes.ACTIVO_FULL, Seccoes.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeydepartamento_idTodepartamentos = + new com.evolute.entity.ForeignKey( Seccoes.class, Seccoes.DEPARTAMENTO_ID, db.data.siprp.outer.DepartamentosData.class, db.data.siprp.outer.DepartamentosData.ID ); + + public static final String TABLENAME = "seccoes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.seccoes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "seccoes.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "seccoes.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DEPARTAMENTO_ID = "departamento_id"; + public static final String DEPARTAMENTO_ID_FULL = "seccoes.departamento_id"; + public static final int DEPARTAMENTO_ID_INDEX = 2; + public static final String TO_DEPARTAMENTO_ID = "to_departamento_id"; + public static final String TO_DEPARTAMENTO_ID_FULL = "seccoes.to_departamento_id"; + public static final int TO_DEPARTAMENTO_ID_INDEX = 3; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "seccoes.activo"; + public static final int ACTIVO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DEPARTAMENTO_ID, TO_DEPARTAMENTO_ID, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DEPARTAMENTO_ID, TABLENAME + "." + TO_DEPARTAMENTO_ID, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DEPARTAMENTO_ID, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DEPARTAMENTO_ID, ACTIVO, }; + + private Integer id; + private String descricao; + private Integer departamento_id; + private db.data.siprp.outer.DepartamentosData to_departamento_id; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Seccoes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAnalisesAcidentes_seccao_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AnalisesAcidentesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AnalisesAcidentesData.class , getPrimaryKey().getMap().get("id"), "seccao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getDepartamento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DEPARTAMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.departamento_id; + } + + public void setDepartamento_id( Integer departamento_id ) + { + try + { + preProcess( DEPARTAMENTO_ID, departamento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.departamento_id = departamento_id; + LAZY_LOADED_OBJECTS.put( DEPARTAMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.DepartamentosData toDepartamento_id() + { + try + { + prepare( TO_DEPARTAMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_departamento_id; + } + + public void setToDepartamento_id( db.data.siprp.outer.DepartamentosData to_departamento_id ) + { + try + { + preProcess( TO_DEPARTAMENTO_ID, to_departamento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_departamento_id = to_departamento_id; + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Seccoes.ID_INDEX: + value = getId(); + break; + case Seccoes.DESCRICAO_INDEX: + value = getDescricao(); + break; + case Seccoes.DEPARTAMENTO_ID_INDEX: + value = getDepartamento_id(); + break; + case Seccoes.TO_DEPARTAMENTO_ID_INDEX: + value = toDepartamento_id(); + break; + case Seccoes.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Seccoes.ID_INDEX: + value = this.id; + break; + case Seccoes.DESCRICAO_INDEX: + value = this.descricao; + break; + case Seccoes.DEPARTAMENTO_ID_INDEX: + value = this.departamento_id; + break; + case Seccoes.TO_DEPARTAMENTO_ID_INDEX: + value = this.to_departamento_id; + break; + case Seccoes.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Seccoes.ID_INDEX: + setId( ( Integer ) value ); + break; + case Seccoes.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case Seccoes.DEPARTAMENTO_ID_INDEX: + setDepartamento_id( ( Integer ) value ); + break; + case Seccoes.TO_DEPARTAMENTO_ID_INDEX: + setToDepartamento_id( ( db.data.siprp.outer.DepartamentosData ) value ); + break; + case Seccoes.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Seccoes.ID_INDEX: + this.id = ( Integer ) value; + break; + case Seccoes.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case Seccoes.DEPARTAMENTO_ID_INDEX: + this.departamento_id = ( Integer ) value; + break; + case Seccoes.TO_DEPARTAMENTO_ID_INDEX: + this.to_departamento_id = ( db.data.siprp.outer.DepartamentosData ) value; + break; + case Seccoes.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Seccoes.ID_INDEX: + theClass = Integer.class; + break; + case Seccoes.DESCRICAO_INDEX: + theClass = String.class; + break; + case Seccoes.DEPARTAMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Seccoes.TO_DEPARTAMENTO_ID_INDEX: + theClass = db.data.siprp.outer.DepartamentosData.class; + break; + case Seccoes.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Seccoes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Seccoes.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/TiposExamesComp.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/TiposExamesComp.java new file mode 100644 index 00000000..240b9162 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/TiposExamesComp.java @@ -0,0 +1,343 @@ +/* +* TiposExamesComp.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class TiposExamesComp extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TiposExamesComp.ID, TiposExamesComp.ID_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.ID_FULL, TiposExamesComp.ID_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.ORDEM, TiposExamesComp.ORDEM_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.ORDEM_FULL, TiposExamesComp.ORDEM_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.DESCRICAO, TiposExamesComp.DESCRICAO_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.DESCRICAO_FULL, TiposExamesComp.DESCRICAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "tipos_exames_comp"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.tipos_exames_comp"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "tipos_exames_comp.id"; + public static final int ID_INDEX = 0; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "tipos_exames_comp.ordem"; + public static final int ORDEM_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "tipos_exames_comp.descricao"; + public static final int DESCRICAO_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + ORDEM, DESCRICAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ORDEM, TABLENAME + "." + DESCRICAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ORDEM, DESCRICAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ORDEM, DESCRICAO, }; + + private Integer id; + private Integer ordem; + private String descricao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TiposExamesComp() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromExamesPerfis_tipo() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.ExamesPerfisData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.ExamesPerfisData.class , getPrimaryKey().getMap().get("id"), "tipo" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + value = getId(); + break; + case TiposExamesComp.ORDEM_INDEX: + value = getOrdem(); + break; + case TiposExamesComp.DESCRICAO_INDEX: + value = getDescricao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + value = this.id; + break; + case TiposExamesComp.ORDEM_INDEX: + value = this.ordem; + break; + case TiposExamesComp.DESCRICAO_INDEX: + value = this.descricao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + setId( ( Integer ) value ); + break; + case TiposExamesComp.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case TiposExamesComp.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + this.id = ( Integer ) value; + break; + case TiposExamesComp.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case TiposExamesComp.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TiposExamesComp.ID_INDEX: + theClass = Integer.class; + break; + case TiposExamesComp.ORDEM_INDEX: + theClass = Integer.class; + break; + case TiposExamesComp.DESCRICAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TiposExamesComp._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TiposExamesComp.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/TiposUtilizadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/TiposUtilizadores.java new file mode 100644 index 00000000..d12a1152 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/TiposUtilizadores.java @@ -0,0 +1,441 @@ +/* +* TiposUtilizadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class TiposUtilizadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TiposUtilizadores.ID, TiposUtilizadores.ID_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.ID_FULL, TiposUtilizadores.ID_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.TIPO, TiposUtilizadores.TIPO_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.TIPO_FULL, TiposUtilizadores.TIPO_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.DESCRICAO, TiposUtilizadores.DESCRICAO_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.DESCRICAO_FULL, TiposUtilizadores.DESCRICAO_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.ACTIVO, TiposUtilizadores.ACTIVO_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.ACTIVO_FULL, TiposUtilizadores.ACTIVO_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.ORDEM, TiposUtilizadores.ORDEM_INDEX ); + FIELD_INDEXES.put( TiposUtilizadores.ORDEM_FULL, TiposUtilizadores.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "tipos_utilizadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.tipos_utilizadores"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "tipos_utilizadores.id"; + public static final int ID_INDEX = 0; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "tipos_utilizadores.tipo"; + public static final int TIPO_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "tipos_utilizadores.descricao"; + public static final int DESCRICAO_INDEX = 2; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "tipos_utilizadores.activo"; + public static final int ACTIVO_INDEX = 3; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "tipos_utilizadores.ordem"; + public static final int ORDEM_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO, DESCRICAO, ACTIVO, ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO, TABLENAME + "." + DESCRICAO, TABLENAME + "." + ACTIVO, TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO, DESCRICAO, ACTIVO, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO, DESCRICAO, ACTIVO, ORDEM, }; + + private Integer id; + private Integer tipo; + private String descricao; + private String activo; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TiposUtilizadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposUtilizadores.ID_INDEX: + value = getId(); + break; + case TiposUtilizadores.TIPO_INDEX: + value = getTipo(); + break; + case TiposUtilizadores.DESCRICAO_INDEX: + value = getDescricao(); + break; + case TiposUtilizadores.ACTIVO_INDEX: + value = getActivo(); + break; + case TiposUtilizadores.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposUtilizadores.ID_INDEX: + value = this.id; + break; + case TiposUtilizadores.TIPO_INDEX: + value = this.tipo; + break; + case TiposUtilizadores.DESCRICAO_INDEX: + value = this.descricao; + break; + case TiposUtilizadores.ACTIVO_INDEX: + value = this.activo; + break; + case TiposUtilizadores.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposUtilizadores.ID_INDEX: + setId( ( Integer ) value ); + break; + case TiposUtilizadores.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case TiposUtilizadores.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case TiposUtilizadores.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + case TiposUtilizadores.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposUtilizadores.ID_INDEX: + this.id = ( Integer ) value; + break; + case TiposUtilizadores.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case TiposUtilizadores.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case TiposUtilizadores.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + case TiposUtilizadores.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TiposUtilizadores.ID_INDEX: + theClass = Integer.class; + break; + case TiposUtilizadores.TIPO_INDEX: + theClass = Integer.class; + break; + case TiposUtilizadores.DESCRICAO_INDEX: + theClass = String.class; + break; + case TiposUtilizadores.ACTIVO_INDEX: + theClass = String.class; + break; + case TiposUtilizadores.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TiposUtilizadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TiposUtilizadores.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Trabalhadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Trabalhadores.java new file mode 100644 index 00000000..de91e254 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Trabalhadores.java @@ -0,0 +1,1076 @@ +/* +* Trabalhadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Trabalhadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Trabalhadores.ID, Trabalhadores.ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ID_FULL, Trabalhadores.ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.SEXO, Trabalhadores.SEXO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.SEXO_FULL, Trabalhadores.SEXO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_NASCIMENTO, Trabalhadores.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_NASCIMENTO_FULL, Trabalhadores.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NUMERO_MECANOGRAFICO, Trabalhadores.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NUMERO_MECANOGRAFICO_FULL, Trabalhadores.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.CATEGORIA, Trabalhadores.CATEGORIA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.CATEGORIA_FULL, Trabalhadores.CATEGORIA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ULTIMO_EXAME, Trabalhadores.ULTIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ULTIMO_EXAME_FULL, Trabalhadores.ULTIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.REALIZADO, Trabalhadores.REALIZADO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.REALIZADO_FULL, Trabalhadores.REALIZADO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PROXIMO_EXAME, Trabalhadores.PROXIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PROXIMO_EXAME_FULL, Trabalhadores.PROXIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ULTIMA_CONSULTA, Trabalhadores.ULTIMA_CONSULTA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ULTIMA_CONSULTA_FULL, Trabalhadores.ULTIMA_CONSULTA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.REALIZADA, Trabalhadores.REALIZADA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.REALIZADA_FULL, Trabalhadores.REALIZADA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PROXIMA_CONSULTA, Trabalhadores.PROXIMA_CONSULTA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PROXIMA_CONSULTA_FULL, Trabalhadores.PROXIMA_CONSULTA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NOME, Trabalhadores.NOME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NOME_FULL, Trabalhadores.NOME_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Trabalhadores.CLASS_IDENTIFIER, Trabalhadores.ESTABELECIMENTO_ID, Trabalhadores.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( Trabalhadores.ESTABELECIMENTO_ID, Trabalhadores.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ESTABELECIMENTO_ID_FULL, Trabalhadores.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.TO_ESTABELECIMENTO_ID, Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.RESULTADO, Trabalhadores.RESULTADO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.RESULTADO_FULL, Trabalhadores.RESULTADO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_ESPERADA, Trabalhadores.DATA_ESPERADA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_ESPERADA_FULL, Trabalhadores.DATA_ESPERADA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_FICHA, Trabalhadores.DATA_FICHA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_FICHA_FULL, Trabalhadores.DATA_FICHA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( Trabalhadores.class, Trabalhadores.ESTABELECIMENTO_ID, db.data.siprp.outer.EstabelecimentosData.class, db.data.siprp.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "trabalhadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.trabalhadores"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores.id"; + public static final int ID_INDEX = 0; + public static final String SEXO = "sexo"; + public static final String SEXO_FULL = "trabalhadores.sexo"; + public static final int SEXO_INDEX = 1; + public static final String DATA_NASCIMENTO = "data_nascimento"; + public static final String DATA_NASCIMENTO_FULL = "trabalhadores.data_nascimento"; + public static final int DATA_NASCIMENTO_INDEX = 2; + public static final String NUMERO_MECANOGRAFICO = "numero_mecanografico"; + public static final String NUMERO_MECANOGRAFICO_FULL = "trabalhadores.numero_mecanografico"; + public static final int NUMERO_MECANOGRAFICO_INDEX = 3; + public static final String CATEGORIA = "categoria"; + public static final String CATEGORIA_FULL = "trabalhadores.categoria"; + public static final int CATEGORIA_INDEX = 4; + public static final String ULTIMO_EXAME = "ultimo_exame"; + public static final String ULTIMO_EXAME_FULL = "trabalhadores.ultimo_exame"; + public static final int ULTIMO_EXAME_INDEX = 5; + public static final String REALIZADO = "realizado"; + public static final String REALIZADO_FULL = "trabalhadores.realizado"; + public static final int REALIZADO_INDEX = 6; + public static final String PROXIMO_EXAME = "proximo_exame"; + public static final String PROXIMO_EXAME_FULL = "trabalhadores.proximo_exame"; + public static final int PROXIMO_EXAME_INDEX = 7; + public static final String ULTIMA_CONSULTA = "ultima_consulta"; + public static final String ULTIMA_CONSULTA_FULL = "trabalhadores.ultima_consulta"; + public static final int ULTIMA_CONSULTA_INDEX = 8; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "trabalhadores.realizada"; + public static final int REALIZADA_INDEX = 9; + public static final String PROXIMA_CONSULTA = "proxima_consulta"; + public static final String PROXIMA_CONSULTA_FULL = "trabalhadores.proxima_consulta"; + public static final int PROXIMA_CONSULTA_INDEX = 10; + public static final String NOME = "nome"; + public static final String NOME_FULL = "trabalhadores.nome"; + public static final int NOME_INDEX = 11; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "trabalhadores.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 12; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "trabalhadores.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 13; + public static final String RESULTADO = "resultado"; + public static final String RESULTADO_FULL = "trabalhadores.resultado"; + public static final int RESULTADO_INDEX = 14; + public static final String DATA_ESPERADA = "data_esperada"; + public static final String DATA_ESPERADA_FULL = "trabalhadores.data_esperada"; + public static final int DATA_ESPERADA_INDEX = 15; + public static final String DATA_FICHA = "data_ficha"; + public static final String DATA_FICHA_FULL = "trabalhadores.data_ficha"; + public static final int DATA_FICHA_INDEX = 16; + + public static final String FIELD_NAMES[] = new String[]{ + SEXO, DATA_NASCIMENTO, NUMERO_MECANOGRAFICO, CATEGORIA, ULTIMO_EXAME, REALIZADO, + PROXIMO_EXAME, ULTIMA_CONSULTA, REALIZADA, PROXIMA_CONSULTA, NOME, + ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, RESULTADO, DATA_ESPERADA, + DATA_FICHA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + SEXO, TABLENAME + "." + DATA_NASCIMENTO, TABLENAME + "." + NUMERO_MECANOGRAFICO, TABLENAME + "." + CATEGORIA, TABLENAME + "." + ULTIMO_EXAME, TABLENAME + "." + REALIZADO, + TABLENAME + "." + PROXIMO_EXAME, TABLENAME + "." + ULTIMA_CONSULTA, TABLENAME + "." + REALIZADA, TABLENAME + "." + PROXIMA_CONSULTA, TABLENAME + "." + NOME, + TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, TABLENAME + "." + RESULTADO, TABLENAME + "." + DATA_ESPERADA, + TABLENAME + "." + DATA_FICHA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, SEXO, DATA_NASCIMENTO, NUMERO_MECANOGRAFICO, CATEGORIA, ULTIMO_EXAME, + REALIZADO, PROXIMO_EXAME, ULTIMA_CONSULTA, REALIZADA, PROXIMA_CONSULTA, NOME, + ESTABELECIMENTO_ID, RESULTADO, DATA_ESPERADA, DATA_FICHA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, SEXO, DATA_NASCIMENTO, NUMERO_MECANOGRAFICO, CATEGORIA, ULTIMO_EXAME, + REALIZADO, PROXIMO_EXAME, ULTIMA_CONSULTA, REALIZADA, PROXIMA_CONSULTA, NOME, + ESTABELECIMENTO_ID, RESULTADO, DATA_ESPERADA, DATA_FICHA, }; + + private Integer id; + private String sexo; + private java.util.Date data_nascimento; + private String numero_mecanografico; + private String categoria; + private java.util.Date ultimo_exame; + private String realizado; + private java.util.Date proximo_exame; + private java.util.Date ultima_consulta; + private String realizada; + private java.util.Date proxima_consulta; + private String nome; + private Integer estabelecimento_id; + private db.data.siprp.outer.EstabelecimentosData to_estabelecimento_id; + private String resultado; + private java.util.Date data_esperada; + private java.util.Date data_ficha; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Trabalhadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAvisos_trabalhador_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.AvisosData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromExames_trabalhador_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.ExamesData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromMarcacoesTrabalhador_trabalhador_id() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.MarcacoesTrabalhadorData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.MarcacoesTrabalhadorData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getSexo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEXO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.sexo; + } + + public void setSexo( String sexo ) + { + try + { + preProcess( SEXO, sexo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.sexo = sexo; + LAZY_LOADED_OBJECTS.put( SEXO, Boolean.TRUE ); + } + + public java.util.Date getData_nascimento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_NASCIMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_nascimento; + } + + public void setData_nascimento( java.util.Date data_nascimento ) + { + try + { + preProcess( DATA_NASCIMENTO, data_nascimento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_nascimento = data_nascimento; + LAZY_LOADED_OBJECTS.put( DATA_NASCIMENTO, Boolean.TRUE ); + } + + public String getNumero_mecanografico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_MECANOGRAFICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_mecanografico; + } + + public void setNumero_mecanografico( String numero_mecanografico ) + { + try + { + preProcess( NUMERO_MECANOGRAFICO, numero_mecanografico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_mecanografico = numero_mecanografico; + LAZY_LOADED_OBJECTS.put( NUMERO_MECANOGRAFICO, Boolean.TRUE ); + } + + public String getCategoria() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CATEGORIA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.categoria; + } + + public void setCategoria( String categoria ) + { + try + { + preProcess( CATEGORIA, categoria ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.categoria = categoria; + LAZY_LOADED_OBJECTS.put( CATEGORIA, Boolean.TRUE ); + } + + public java.util.Date getUltimo_exame() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ULTIMO_EXAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ultimo_exame; + } + + public void setUltimo_exame( java.util.Date ultimo_exame ) + { + try + { + preProcess( ULTIMO_EXAME, ultimo_exame ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ultimo_exame = ultimo_exame; + LAZY_LOADED_OBJECTS.put( ULTIMO_EXAME, Boolean.TRUE ); + } + + public String getRealizado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizado; + } + + public void setRealizado( String realizado ) + { + try + { + preProcess( REALIZADO, realizado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizado = realizado; + LAZY_LOADED_OBJECTS.put( REALIZADO, Boolean.TRUE ); + } + + public java.util.Date getProximo_exame() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROXIMO_EXAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.proximo_exame; + } + + public void setProximo_exame( java.util.Date proximo_exame ) + { + try + { + preProcess( PROXIMO_EXAME, proximo_exame ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.proximo_exame = proximo_exame; + LAZY_LOADED_OBJECTS.put( PROXIMO_EXAME, Boolean.TRUE ); + } + + public java.util.Date getUltima_consulta() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ULTIMA_CONSULTA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ultima_consulta; + } + + public void setUltima_consulta( java.util.Date ultima_consulta ) + { + try + { + preProcess( ULTIMA_CONSULTA, ultima_consulta ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ultima_consulta = ultima_consulta; + LAZY_LOADED_OBJECTS.put( ULTIMA_CONSULTA, Boolean.TRUE ); + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public java.util.Date getProxima_consulta() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROXIMA_CONSULTA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.proxima_consulta; + } + + public void setProxima_consulta( java.util.Date proxima_consulta ) + { + try + { + preProcess( PROXIMA_CONSULTA, proxima_consulta ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.proxima_consulta = proxima_consulta; + LAZY_LOADED_OBJECTS.put( PROXIMA_CONSULTA, Boolean.TRUE ); + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public String getResultado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESULTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.resultado; + } + + public void setResultado( String resultado ) + { + try + { + preProcess( RESULTADO, resultado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.resultado = resultado; + LAZY_LOADED_OBJECTS.put( RESULTADO, Boolean.TRUE ); + } + + public java.util.Date getData_esperada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ESPERADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_esperada; + } + + public void setData_esperada( java.util.Date data_esperada ) + { + try + { + preProcess( DATA_ESPERADA, data_esperada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_esperada = data_esperada; + LAZY_LOADED_OBJECTS.put( DATA_ESPERADA, Boolean.TRUE ); + } + + public java.util.Date getData_ficha() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_FICHA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_ficha; + } + + public void setData_ficha( java.util.Date data_ficha ) + { + try + { + preProcess( DATA_FICHA, data_ficha ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_ficha = data_ficha; + LAZY_LOADED_OBJECTS.put( DATA_FICHA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + value = getId(); + break; + case Trabalhadores.SEXO_INDEX: + value = getSexo(); + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + value = getData_nascimento(); + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + value = getNumero_mecanografico(); + break; + case Trabalhadores.CATEGORIA_INDEX: + value = getCategoria(); + break; + case Trabalhadores.ULTIMO_EXAME_INDEX: + value = getUltimo_exame(); + break; + case Trabalhadores.REALIZADO_INDEX: + value = getRealizado(); + break; + case Trabalhadores.PROXIMO_EXAME_INDEX: + value = getProximo_exame(); + break; + case Trabalhadores.ULTIMA_CONSULTA_INDEX: + value = getUltima_consulta(); + break; + case Trabalhadores.REALIZADA_INDEX: + value = getRealizada(); + break; + case Trabalhadores.PROXIMA_CONSULTA_INDEX: + value = getProxima_consulta(); + break; + case Trabalhadores.NOME_INDEX: + value = getNome(); + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case Trabalhadores.RESULTADO_INDEX: + value = getResultado(); + break; + case Trabalhadores.DATA_ESPERADA_INDEX: + value = getData_esperada(); + break; + case Trabalhadores.DATA_FICHA_INDEX: + value = getData_ficha(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + value = this.id; + break; + case Trabalhadores.SEXO_INDEX: + value = this.sexo; + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + value = this.data_nascimento; + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + value = this.numero_mecanografico; + break; + case Trabalhadores.CATEGORIA_INDEX: + value = this.categoria; + break; + case Trabalhadores.ULTIMO_EXAME_INDEX: + value = this.ultimo_exame; + break; + case Trabalhadores.REALIZADO_INDEX: + value = this.realizado; + break; + case Trabalhadores.PROXIMO_EXAME_INDEX: + value = this.proximo_exame; + break; + case Trabalhadores.ULTIMA_CONSULTA_INDEX: + value = this.ultima_consulta; + break; + case Trabalhadores.REALIZADA_INDEX: + value = this.realizada; + break; + case Trabalhadores.PROXIMA_CONSULTA_INDEX: + value = this.proxima_consulta; + break; + case Trabalhadores.NOME_INDEX: + value = this.nome; + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case Trabalhadores.RESULTADO_INDEX: + value = this.resultado; + break; + case Trabalhadores.DATA_ESPERADA_INDEX: + value = this.data_esperada; + break; + case Trabalhadores.DATA_FICHA_INDEX: + value = this.data_ficha; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + setId( ( Integer ) value ); + break; + case Trabalhadores.SEXO_INDEX: + setSexo( ( String ) value ); + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + setData_nascimento( ( java.util.Date ) value ); + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + setNumero_mecanografico( ( String ) value ); + break; + case Trabalhadores.CATEGORIA_INDEX: + setCategoria( ( String ) value ); + break; + case Trabalhadores.ULTIMO_EXAME_INDEX: + setUltimo_exame( ( java.util.Date ) value ); + break; + case Trabalhadores.REALIZADO_INDEX: + setRealizado( ( String ) value ); + break; + case Trabalhadores.PROXIMO_EXAME_INDEX: + setProximo_exame( ( java.util.Date ) value ); + break; + case Trabalhadores.ULTIMA_CONSULTA_INDEX: + setUltima_consulta( ( java.util.Date ) value ); + break; + case Trabalhadores.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + case Trabalhadores.PROXIMA_CONSULTA_INDEX: + setProxima_consulta( ( java.util.Date ) value ); + break; + case Trabalhadores.NOME_INDEX: + setNome( ( String ) value ); + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp.outer.EstabelecimentosData ) value ); + break; + case Trabalhadores.RESULTADO_INDEX: + setResultado( ( String ) value ); + break; + case Trabalhadores.DATA_ESPERADA_INDEX: + setData_esperada( ( java.util.Date ) value ); + break; + case Trabalhadores.DATA_FICHA_INDEX: + setData_ficha( ( java.util.Date ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + this.id = ( Integer ) value; + break; + case Trabalhadores.SEXO_INDEX: + this.sexo = ( String ) value; + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + this.data_nascimento = ( java.util.Date ) value; + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + this.numero_mecanografico = ( String ) value; + break; + case Trabalhadores.CATEGORIA_INDEX: + this.categoria = ( String ) value; + break; + case Trabalhadores.ULTIMO_EXAME_INDEX: + this.ultimo_exame = ( java.util.Date ) value; + break; + case Trabalhadores.REALIZADO_INDEX: + this.realizado = ( String ) value; + break; + case Trabalhadores.PROXIMO_EXAME_INDEX: + this.proximo_exame = ( java.util.Date ) value; + break; + case Trabalhadores.ULTIMA_CONSULTA_INDEX: + this.ultima_consulta = ( java.util.Date ) value; + break; + case Trabalhadores.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + case Trabalhadores.PROXIMA_CONSULTA_INDEX: + this.proxima_consulta = ( java.util.Date ) value; + break; + case Trabalhadores.NOME_INDEX: + this.nome = ( String ) value; + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp.outer.EstabelecimentosData ) value; + break; + case Trabalhadores.RESULTADO_INDEX: + this.resultado = ( String ) value; + break; + case Trabalhadores.DATA_ESPERADA_INDEX: + this.data_esperada = ( java.util.Date ) value; + break; + case Trabalhadores.DATA_FICHA_INDEX: + this.data_ficha = ( java.util.Date ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Trabalhadores.ID_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.SEXO_INDEX: + theClass = String.class; + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + theClass = String.class; + break; + case Trabalhadores.CATEGORIA_INDEX: + theClass = String.class; + break; + case Trabalhadores.ULTIMO_EXAME_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.REALIZADO_INDEX: + theClass = String.class; + break; + case Trabalhadores.PROXIMO_EXAME_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.ULTIMA_CONSULTA_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.REALIZADA_INDEX: + theClass = String.class; + break; + case Trabalhadores.PROXIMA_CONSULTA_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.NOME_INDEX: + theClass = String.class; + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp.outer.EstabelecimentosData.class; + break; + case Trabalhadores.RESULTADO_INDEX: + theClass = String.class; + break; + case Trabalhadores.DATA_ESPERADA_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.DATA_FICHA_INDEX: + theClass = java.util.Date.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Trabalhadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Trabalhadores.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Users.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Users.java new file mode 100644 index 00000000..1df6d29e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Users.java @@ -0,0 +1,178 @@ +/* +* Users.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Users extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "users"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.users"; + + public static final int _INVALID__INDEX = -1; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + }; + + + protected com.evolute.entity.utils.ObjectPrimaryKey primaryKey; + + public Users() + { + super(); + dirtyProperties = new boolean[]{ }; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on Users is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Users._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.ObjectPrimaryKey( TABLENAME, Users.PK_FIELD_NAMES ); + } + } + + @Override + public com.evolute.entity.utils.ObjectPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Utilizadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Utilizadores.java new file mode 100644 index 00000000..64e64450 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Utilizadores.java @@ -0,0 +1,1290 @@ +/* +* Utilizadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Utilizadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Utilizadores.ID, Utilizadores.ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.ID_FULL, Utilizadores.ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.LOGIN, Utilizadores.LOGIN_INDEX ); + FIELD_INDEXES.put( Utilizadores.LOGIN_FULL, Utilizadores.LOGIN_INDEX ); + FIELD_INDEXES.put( Utilizadores.PASSWORD, Utilizadores.PASSWORD_INDEX ); + FIELD_INDEXES.put( Utilizadores.PASSWORD_FULL, Utilizadores.PASSWORD_INDEX ); + FIELD_INDEXES.put( Utilizadores.EMAIL, Utilizadores.EMAIL_INDEX ); + FIELD_INDEXES.put( Utilizadores.EMAIL_FULL, Utilizadores.EMAIL_INDEX ); + FIELD_INDEXES.put( Utilizadores.EMPRESA_ID, Utilizadores.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.EMPRESA_ID_FULL, Utilizadores.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.ESTABELECIMENTO_ID, Utilizadores.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.ESTABELECIMENTO_ID_FULL, Utilizadores.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.ADMINISTRADOR, Utilizadores.ADMINISTRADOR_INDEX ); + FIELD_INDEXES.put( Utilizadores.ADMINISTRADOR_FULL, Utilizadores.ADMINISTRADOR_INDEX ); + FIELD_INDEXES.put( Utilizadores.MEDICO_ID, Utilizadores.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.MEDICO_ID_FULL, Utilizadores.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.TIPO, Utilizadores.TIPO_INDEX ); + FIELD_INDEXES.put( Utilizadores.TIPO_FULL, Utilizadores.TIPO_INDEX ); + FIELD_INDEXES.put( Utilizadores.NUMERO_CEDULA, Utilizadores.NUMERO_CEDULA_INDEX ); + FIELD_INDEXES.put( Utilizadores.NUMERO_CEDULA_FULL, Utilizadores.NUMERO_CEDULA_INDEX ); + FIELD_INDEXES.put( Utilizadores.CAP, Utilizadores.CAP_INDEX ); + FIELD_INDEXES.put( Utilizadores.CAP_FULL, Utilizadores.CAP_INDEX ); + FIELD_INDEXES.put( Utilizadores.NOME, Utilizadores.NOME_INDEX ); + FIELD_INDEXES.put( Utilizadores.NOME_FULL, Utilizadores.NOME_INDEX ); + FIELD_INDEXES.put( Utilizadores.FUNCIONARIO_HST_ID, Utilizadores.FUNCIONARIO_HST_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.FUNCIONARIO_HST_ID_FULL, Utilizadores.FUNCIONARIO_HST_ID_INDEX ); + FIELD_INDEXES.put( Utilizadores.ACTIVO, Utilizadores.ACTIVO_INDEX ); + FIELD_INDEXES.put( Utilizadores.ACTIVO_FULL, Utilizadores.ACTIVO_INDEX ); + FIELD_INDEXES.put( Utilizadores.RESPONSAVEL_LOJA, Utilizadores.RESPONSAVEL_LOJA_INDEX ); + FIELD_INDEXES.put( Utilizadores.RESPONSAVEL_LOJA_FULL, Utilizadores.RESPONSAVEL_LOJA_INDEX ); + FIELD_INDEXES.put( Utilizadores.NUMERO_MECANOGRAFICO, Utilizadores.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Utilizadores.NUMERO_MECANOGRAFICO_FULL, Utilizadores.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Utilizadores.GESTOR_GERAL, Utilizadores.GESTOR_GERAL_INDEX ); + FIELD_INDEXES.put( Utilizadores.GESTOR_GERAL_FULL, Utilizadores.GESTOR_GERAL_INDEX ); + FIELD_INDEXES.put( Utilizadores.PRIMEIRO_LOGIN, Utilizadores.PRIMEIRO_LOGIN_INDEX ); + FIELD_INDEXES.put( Utilizadores.PRIMEIRO_LOGIN_FULL, Utilizadores.PRIMEIRO_LOGIN_INDEX ); + FIELD_INDEXES.put( Utilizadores.APAGADO, Utilizadores.APAGADO_INDEX ); + FIELD_INDEXES.put( Utilizadores.APAGADO_FULL, Utilizadores.APAGADO_INDEX ); + FIELD_INDEXES.put( Utilizadores.DATA_PASSWORD, Utilizadores.DATA_PASSWORD_INDEX ); + FIELD_INDEXES.put( Utilizadores.DATA_PASSWORD_FULL, Utilizadores.DATA_PASSWORD_INDEX ); + FIELD_INDEXES.put( Utilizadores.BACKUP_EMAIL2, Utilizadores.BACKUP_EMAIL2_INDEX ); + FIELD_INDEXES.put( Utilizadores.BACKUP_EMAIL2_FULL, Utilizadores.BACKUP_EMAIL2_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "utilizadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.utilizadores"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "utilizadores.id"; + public static final int ID_INDEX = 0; + public static final String LOGIN = "login"; + public static final String LOGIN_FULL = "utilizadores.login"; + public static final int LOGIN_INDEX = 1; + public static final String PASSWORD = "password"; + public static final String PASSWORD_FULL = "utilizadores.password"; + public static final int PASSWORD_INDEX = 2; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "utilizadores.email"; + public static final int EMAIL_INDEX = 3; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "utilizadores.empresa_id"; + public static final int EMPRESA_ID_INDEX = 4; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "utilizadores.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 5; + public static final String ADMINISTRADOR = "administrador"; + public static final String ADMINISTRADOR_FULL = "utilizadores.administrador"; + public static final int ADMINISTRADOR_INDEX = 6; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "utilizadores.medico_id"; + public static final int MEDICO_ID_INDEX = 7; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "utilizadores.tipo"; + public static final int TIPO_INDEX = 8; + public static final String NUMERO_CEDULA = "numero_cedula"; + public static final String NUMERO_CEDULA_FULL = "utilizadores.numero_cedula"; + public static final int NUMERO_CEDULA_INDEX = 9; + public static final String CAP = "cap"; + public static final String CAP_FULL = "utilizadores.cap"; + public static final int CAP_INDEX = 10; + public static final String NOME = "nome"; + public static final String NOME_FULL = "utilizadores.nome"; + public static final int NOME_INDEX = 11; + public static final String FUNCIONARIO_HST_ID = "funcionario_hst_id"; + public static final String FUNCIONARIO_HST_ID_FULL = "utilizadores.funcionario_hst_id"; + public static final int FUNCIONARIO_HST_ID_INDEX = 12; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "utilizadores.activo"; + public static final int ACTIVO_INDEX = 13; + public static final String RESPONSAVEL_LOJA = "responsavel_loja"; + public static final String RESPONSAVEL_LOJA_FULL = "utilizadores.responsavel_loja"; + public static final int RESPONSAVEL_LOJA_INDEX = 14; + public static final String NUMERO_MECANOGRAFICO = "numero_mecanografico"; + public static final String NUMERO_MECANOGRAFICO_FULL = "utilizadores.numero_mecanografico"; + public static final int NUMERO_MECANOGRAFICO_INDEX = 15; + public static final String GESTOR_GERAL = "gestor_geral"; + public static final String GESTOR_GERAL_FULL = "utilizadores.gestor_geral"; + public static final int GESTOR_GERAL_INDEX = 16; + public static final String PRIMEIRO_LOGIN = "primeiro_login"; + public static final String PRIMEIRO_LOGIN_FULL = "utilizadores.primeiro_login"; + public static final int PRIMEIRO_LOGIN_INDEX = 17; + public static final String APAGADO = "apagado"; + public static final String APAGADO_FULL = "utilizadores.apagado"; + public static final int APAGADO_INDEX = 18; + public static final String DATA_PASSWORD = "data_password"; + public static final String DATA_PASSWORD_FULL = "utilizadores.data_password"; + public static final int DATA_PASSWORD_INDEX = 19; + public static final String BACKUP_EMAIL2 = "backup_email2"; + public static final String BACKUP_EMAIL2_FULL = "utilizadores.backup_email2"; + public static final int BACKUP_EMAIL2_INDEX = 20; + + public static final String FIELD_NAMES[] = new String[]{ + LOGIN, PASSWORD, EMAIL, EMPRESA_ID, ESTABELECIMENTO_ID, ADMINISTRADOR, MEDICO_ID, + TIPO, NUMERO_CEDULA, CAP, NOME, FUNCIONARIO_HST_ID, ACTIVO, RESPONSAVEL_LOJA, + NUMERO_MECANOGRAFICO, GESTOR_GERAL, PRIMEIRO_LOGIN, APAGADO, DATA_PASSWORD, + BACKUP_EMAIL2, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + LOGIN, TABLENAME + "." + PASSWORD, TABLENAME + "." + EMAIL, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + ADMINISTRADOR, TABLENAME + "." + MEDICO_ID, + TABLENAME + "." + TIPO, TABLENAME + "." + NUMERO_CEDULA, TABLENAME + "." + CAP, TABLENAME + "." + NOME, TABLENAME + "." + FUNCIONARIO_HST_ID, TABLENAME + "." + ACTIVO, TABLENAME + "." + RESPONSAVEL_LOJA, + TABLENAME + "." + NUMERO_MECANOGRAFICO, TABLENAME + "." + GESTOR_GERAL, TABLENAME + "." + PRIMEIRO_LOGIN, TABLENAME + "." + APAGADO, TABLENAME + "." + DATA_PASSWORD, + TABLENAME + "." + BACKUP_EMAIL2, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, LOGIN, PASSWORD, EMAIL, EMPRESA_ID, ESTABELECIMENTO_ID, ADMINISTRADOR, MEDICO_ID, + TIPO, NUMERO_CEDULA, CAP, NOME, FUNCIONARIO_HST_ID, ACTIVO, RESPONSAVEL_LOJA, + NUMERO_MECANOGRAFICO, GESTOR_GERAL, PRIMEIRO_LOGIN, APAGADO, DATA_PASSWORD, + BACKUP_EMAIL2, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, LOGIN, PASSWORD, EMAIL, EMPRESA_ID, ESTABELECIMENTO_ID, ADMINISTRADOR, MEDICO_ID, + TIPO, NUMERO_CEDULA, CAP, NOME, FUNCIONARIO_HST_ID, ACTIVO, RESPONSAVEL_LOJA, + NUMERO_MECANOGRAFICO, GESTOR_GERAL, PRIMEIRO_LOGIN, APAGADO, DATA_PASSWORD, + BACKUP_EMAIL2, }; + + private Integer id; + private String login; + private String password; + private String email; + private Integer empresa_id; + private Integer estabelecimento_id; + private String administrador; + private Integer medico_id; + private Integer tipo; + private String numero_cedula; + private String cap; + private String nome; + private Integer funcionario_hst_id; + private String activo; + private String responsavel_loja; + private String numero_mecanografico; + private String gestor_geral; + private String primeiro_login; + private String apagado; + private java.util.Date data_password; + private String backup_email2; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Utilizadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPlanosActuacao_user_dir_loja() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanosActuacaoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_dir_loja" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromPlanosActuacao_user_dns() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanosActuacaoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_dns" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public java.util.ListfromPlanosActuacao_user_hs() + { + java.util.List result = new java.util.LinkedList< db.data.siprp.outer.PlanosActuacaoData >(); + if ( getPrimaryKey() != null ) + { + try + { + result = fromReference( db.data.siprp.outer.PlanosActuacaoData.class , getPrimaryKey().getMap().get("id"), "user_hs" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + } + return result; + } + + public String getLogin() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOGIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.login; + } + + public void setLogin( String login ) + { + try + { + preProcess( LOGIN, login ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.login = login; + LAZY_LOADED_OBJECTS.put( LOGIN, Boolean.TRUE ); + } + + public String getPassword() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PASSWORD ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.password; + } + + public void setPassword( String password ) + { + try + { + preProcess( PASSWORD, password ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.password = password; + LAZY_LOADED_OBJECTS.put( PASSWORD, Boolean.TRUE ); + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public String getAdministrador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ADMINISTRADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.administrador; + } + + public void setAdministrador( String administrador ) + { + try + { + preProcess( ADMINISTRADOR, administrador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.administrador = administrador; + LAZY_LOADED_OBJECTS.put( ADMINISTRADOR, Boolean.TRUE ); + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public String getNumero_cedula() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_CEDULA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_cedula; + } + + public void setNumero_cedula( String numero_cedula ) + { + try + { + preProcess( NUMERO_CEDULA, numero_cedula ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_cedula = numero_cedula; + LAZY_LOADED_OBJECTS.put( NUMERO_CEDULA, Boolean.TRUE ); + } + + public String getCap() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cap; + } + + public void setCap( String cap ) + { + try + { + preProcess( CAP, cap ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cap = cap; + LAZY_LOADED_OBJECTS.put( CAP, Boolean.TRUE ); + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Integer getFuncionario_hst_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCIONARIO_HST_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcionario_hst_id; + } + + public void setFuncionario_hst_id( Integer funcionario_hst_id ) + { + try + { + preProcess( FUNCIONARIO_HST_ID, funcionario_hst_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcionario_hst_id = funcionario_hst_id; + LAZY_LOADED_OBJECTS.put( FUNCIONARIO_HST_ID, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public String getResponsavel_loja() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESPONSAVEL_LOJA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.responsavel_loja; + } + + public void setResponsavel_loja( String responsavel_loja ) + { + try + { + preProcess( RESPONSAVEL_LOJA, responsavel_loja ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.responsavel_loja = responsavel_loja; + LAZY_LOADED_OBJECTS.put( RESPONSAVEL_LOJA, Boolean.TRUE ); + } + + public String getNumero_mecanografico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_MECANOGRAFICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_mecanografico; + } + + public void setNumero_mecanografico( String numero_mecanografico ) + { + try + { + preProcess( NUMERO_MECANOGRAFICO, numero_mecanografico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_mecanografico = numero_mecanografico; + LAZY_LOADED_OBJECTS.put( NUMERO_MECANOGRAFICO, Boolean.TRUE ); + } + + public String getGestor_geral() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( GESTOR_GERAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.gestor_geral; + } + + public void setGestor_geral( String gestor_geral ) + { + try + { + preProcess( GESTOR_GERAL, gestor_geral ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.gestor_geral = gestor_geral; + LAZY_LOADED_OBJECTS.put( GESTOR_GERAL, Boolean.TRUE ); + } + + public String getPrimeiro_login() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRIMEIRO_LOGIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.primeiro_login; + } + + public void setPrimeiro_login( String primeiro_login ) + { + try + { + preProcess( PRIMEIRO_LOGIN, primeiro_login ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.primeiro_login = primeiro_login; + LAZY_LOADED_OBJECTS.put( PRIMEIRO_LOGIN, Boolean.TRUE ); + } + + public String getApagado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( APAGADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.apagado; + } + + public void setApagado( String apagado ) + { + try + { + preProcess( APAGADO, apagado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.apagado = apagado; + LAZY_LOADED_OBJECTS.put( APAGADO, Boolean.TRUE ); + } + + public java.util.Date getData_password() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_PASSWORD ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_password; + } + + public void setData_password( java.util.Date data_password ) + { + try + { + preProcess( DATA_PASSWORD, data_password ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_password = data_password; + LAZY_LOADED_OBJECTS.put( DATA_PASSWORD, Boolean.TRUE ); + } + + public String getBackup_email2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( BACKUP_EMAIL2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.backup_email2; + } + + public void setBackup_email2( String backup_email2 ) + { + try + { + preProcess( BACKUP_EMAIL2, backup_email2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.backup_email2 = backup_email2; + LAZY_LOADED_OBJECTS.put( BACKUP_EMAIL2, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Utilizadores.ID_INDEX: + value = getId(); + break; + case Utilizadores.LOGIN_INDEX: + value = getLogin(); + break; + case Utilizadores.PASSWORD_INDEX: + value = getPassword(); + break; + case Utilizadores.EMAIL_INDEX: + value = getEmail(); + break; + case Utilizadores.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case Utilizadores.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case Utilizadores.ADMINISTRADOR_INDEX: + value = getAdministrador(); + break; + case Utilizadores.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + case Utilizadores.TIPO_INDEX: + value = getTipo(); + break; + case Utilizadores.NUMERO_CEDULA_INDEX: + value = getNumero_cedula(); + break; + case Utilizadores.CAP_INDEX: + value = getCap(); + break; + case Utilizadores.NOME_INDEX: + value = getNome(); + break; + case Utilizadores.FUNCIONARIO_HST_ID_INDEX: + value = getFuncionario_hst_id(); + break; + case Utilizadores.ACTIVO_INDEX: + value = getActivo(); + break; + case Utilizadores.RESPONSAVEL_LOJA_INDEX: + value = getResponsavel_loja(); + break; + case Utilizadores.NUMERO_MECANOGRAFICO_INDEX: + value = getNumero_mecanografico(); + break; + case Utilizadores.GESTOR_GERAL_INDEX: + value = getGestor_geral(); + break; + case Utilizadores.PRIMEIRO_LOGIN_INDEX: + value = getPrimeiro_login(); + break; + case Utilizadores.APAGADO_INDEX: + value = getApagado(); + break; + case Utilizadores.DATA_PASSWORD_INDEX: + value = getData_password(); + break; + case Utilizadores.BACKUP_EMAIL2_INDEX: + value = getBackup_email2(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Utilizadores.ID_INDEX: + value = this.id; + break; + case Utilizadores.LOGIN_INDEX: + value = this.login; + break; + case Utilizadores.PASSWORD_INDEX: + value = this.password; + break; + case Utilizadores.EMAIL_INDEX: + value = this.email; + break; + case Utilizadores.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case Utilizadores.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case Utilizadores.ADMINISTRADOR_INDEX: + value = this.administrador; + break; + case Utilizadores.MEDICO_ID_INDEX: + value = this.medico_id; + break; + case Utilizadores.TIPO_INDEX: + value = this.tipo; + break; + case Utilizadores.NUMERO_CEDULA_INDEX: + value = this.numero_cedula; + break; + case Utilizadores.CAP_INDEX: + value = this.cap; + break; + case Utilizadores.NOME_INDEX: + value = this.nome; + break; + case Utilizadores.FUNCIONARIO_HST_ID_INDEX: + value = this.funcionario_hst_id; + break; + case Utilizadores.ACTIVO_INDEX: + value = this.activo; + break; + case Utilizadores.RESPONSAVEL_LOJA_INDEX: + value = this.responsavel_loja; + break; + case Utilizadores.NUMERO_MECANOGRAFICO_INDEX: + value = this.numero_mecanografico; + break; + case Utilizadores.GESTOR_GERAL_INDEX: + value = this.gestor_geral; + break; + case Utilizadores.PRIMEIRO_LOGIN_INDEX: + value = this.primeiro_login; + break; + case Utilizadores.APAGADO_INDEX: + value = this.apagado; + break; + case Utilizadores.DATA_PASSWORD_INDEX: + value = this.data_password; + break; + case Utilizadores.BACKUP_EMAIL2_INDEX: + value = this.backup_email2; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Utilizadores.ID_INDEX: + setId( ( Integer ) value ); + break; + case Utilizadores.LOGIN_INDEX: + setLogin( ( String ) value ); + break; + case Utilizadores.PASSWORD_INDEX: + setPassword( ( String ) value ); + break; + case Utilizadores.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + case Utilizadores.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case Utilizadores.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case Utilizadores.ADMINISTRADOR_INDEX: + setAdministrador( ( String ) value ); + break; + case Utilizadores.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + case Utilizadores.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case Utilizadores.NUMERO_CEDULA_INDEX: + setNumero_cedula( ( String ) value ); + break; + case Utilizadores.CAP_INDEX: + setCap( ( String ) value ); + break; + case Utilizadores.NOME_INDEX: + setNome( ( String ) value ); + break; + case Utilizadores.FUNCIONARIO_HST_ID_INDEX: + setFuncionario_hst_id( ( Integer ) value ); + break; + case Utilizadores.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + case Utilizadores.RESPONSAVEL_LOJA_INDEX: + setResponsavel_loja( ( String ) value ); + break; + case Utilizadores.NUMERO_MECANOGRAFICO_INDEX: + setNumero_mecanografico( ( String ) value ); + break; + case Utilizadores.GESTOR_GERAL_INDEX: + setGestor_geral( ( String ) value ); + break; + case Utilizadores.PRIMEIRO_LOGIN_INDEX: + setPrimeiro_login( ( String ) value ); + break; + case Utilizadores.APAGADO_INDEX: + setApagado( ( String ) value ); + break; + case Utilizadores.DATA_PASSWORD_INDEX: + setData_password( ( java.util.Date ) value ); + break; + case Utilizadores.BACKUP_EMAIL2_INDEX: + setBackup_email2( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Utilizadores.ID_INDEX: + this.id = ( Integer ) value; + break; + case Utilizadores.LOGIN_INDEX: + this.login = ( String ) value; + break; + case Utilizadores.PASSWORD_INDEX: + this.password = ( String ) value; + break; + case Utilizadores.EMAIL_INDEX: + this.email = ( String ) value; + break; + case Utilizadores.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case Utilizadores.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case Utilizadores.ADMINISTRADOR_INDEX: + this.administrador = ( String ) value; + break; + case Utilizadores.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + case Utilizadores.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case Utilizadores.NUMERO_CEDULA_INDEX: + this.numero_cedula = ( String ) value; + break; + case Utilizadores.CAP_INDEX: + this.cap = ( String ) value; + break; + case Utilizadores.NOME_INDEX: + this.nome = ( String ) value; + break; + case Utilizadores.FUNCIONARIO_HST_ID_INDEX: + this.funcionario_hst_id = ( Integer ) value; + break; + case Utilizadores.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + case Utilizadores.RESPONSAVEL_LOJA_INDEX: + this.responsavel_loja = ( String ) value; + break; + case Utilizadores.NUMERO_MECANOGRAFICO_INDEX: + this.numero_mecanografico = ( String ) value; + break; + case Utilizadores.GESTOR_GERAL_INDEX: + this.gestor_geral = ( String ) value; + break; + case Utilizadores.PRIMEIRO_LOGIN_INDEX: + this.primeiro_login = ( String ) value; + break; + case Utilizadores.APAGADO_INDEX: + this.apagado = ( String ) value; + break; + case Utilizadores.DATA_PASSWORD_INDEX: + this.data_password = ( java.util.Date ) value; + break; + case Utilizadores.BACKUP_EMAIL2_INDEX: + this.backup_email2 = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Utilizadores.ID_INDEX: + theClass = Integer.class; + break; + case Utilizadores.LOGIN_INDEX: + theClass = String.class; + break; + case Utilizadores.PASSWORD_INDEX: + theClass = String.class; + break; + case Utilizadores.EMAIL_INDEX: + theClass = String.class; + break; + case Utilizadores.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case Utilizadores.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Utilizadores.ADMINISTRADOR_INDEX: + theClass = String.class; + break; + case Utilizadores.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + case Utilizadores.TIPO_INDEX: + theClass = Integer.class; + break; + case Utilizadores.NUMERO_CEDULA_INDEX: + theClass = String.class; + break; + case Utilizadores.CAP_INDEX: + theClass = String.class; + break; + case Utilizadores.NOME_INDEX: + theClass = String.class; + break; + case Utilizadores.FUNCIONARIO_HST_ID_INDEX: + theClass = Integer.class; + break; + case Utilizadores.ACTIVO_INDEX: + theClass = String.class; + break; + case Utilizadores.RESPONSAVEL_LOJA_INDEX: + theClass = String.class; + break; + case Utilizadores.NUMERO_MECANOGRAFICO_INDEX: + theClass = String.class; + break; + case Utilizadores.GESTOR_GERAL_INDEX: + theClass = String.class; + break; + case Utilizadores.PRIMEIRO_LOGIN_INDEX: + theClass = String.class; + break; + case Utilizadores.APAGADO_INDEX: + theClass = String.class; + break; + case Utilizadores.DATA_PASSWORD_INDEX: + theClass = java.util.Date.class; + break; + case Utilizadores.BACKUP_EMAIL2_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Utilizadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Utilizadores.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Version.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Version.java new file mode 100644 index 00000000..16408527 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/Version.java @@ -0,0 +1,342 @@ +/* +* Version.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp.inner; + + +public class Version extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Version.CURRENT_VERSION, Version.CURRENT_VERSION_INDEX ); + FIELD_INDEXES.put( Version.CURRENT_VERSION_FULL, Version.CURRENT_VERSION_INDEX ); + FIELD_INDEXES.put( Version.ID, Version.ID_INDEX ); + FIELD_INDEXES.put( Version.ID_FULL, Version.ID_INDEX ); + FIELD_INDEXES.put( Version.MODULE_NAME, Version.MODULE_NAME_INDEX ); + FIELD_INDEXES.put( Version.MODULE_NAME_FULL, Version.MODULE_NAME_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "version"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp.inner.version"; + + public static final int _INVALID__INDEX = -1; + public static final String CURRENT_VERSION = "current_version"; + public static final String CURRENT_VERSION_FULL = "version.current_version"; + public static final int CURRENT_VERSION_INDEX = 0; + public static final String ID = "id"; + public static final String ID_FULL = "version.id"; + public static final int ID_INDEX = 1; + public static final String MODULE_NAME = "module_name"; + public static final String MODULE_NAME_FULL = "version.module_name"; + public static final int MODULE_NAME_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + CURRENT_VERSION, MODULE_NAME, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CURRENT_VERSION, TABLENAME + "." + MODULE_NAME, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + CURRENT_VERSION, ID, MODULE_NAME, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + CURRENT_VERSION, ID, MODULE_NAME, }; + + private Double current_version; + private Integer id; + private String module_name; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Version() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Double getCurrent_version() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURRENT_VERSION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.current_version; + } + + public void setCurrent_version( Double current_version ) + { + try + { + preProcess( CURRENT_VERSION, current_version ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.current_version = current_version; + LAZY_LOADED_OBJECTS.put( CURRENT_VERSION, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getModule_name() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MODULE_NAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.module_name; + } + + public void setModule_name( String module_name ) + { + try + { + preProcess( MODULE_NAME, module_name ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.module_name = module_name; + LAZY_LOADED_OBJECTS.put( MODULE_NAME, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + value = getCurrent_version(); + break; + case Version.ID_INDEX: + value = getId(); + break; + case Version.MODULE_NAME_INDEX: + value = getModule_name(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + value = this.current_version; + break; + case Version.ID_INDEX: + value = this.id; + break; + case Version.MODULE_NAME_INDEX: + value = this.module_name; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + setCurrent_version( ( Double ) value ); + break; + case Version.ID_INDEX: + setId( ( Integer ) value ); + break; + case Version.MODULE_NAME_INDEX: + setModule_name( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + this.current_version = ( Double ) value; + break; + case Version.ID_INDEX: + this.id = ( Integer ) value; + break; + case Version.MODULE_NAME_INDEX: + this.module_name = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + theClass = Double.class; + break; + case Version.ID_INDEX: + theClass = Integer.class; + break; + case Version.MODULE_NAME_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Version._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Version.PK_FIELD_NAMES ); + Object idObject = array.get( row, col + 0 ); + try + { + primaryKey.set( 0, ( Integer ) idObject ); + setId( ( Integer ) idObject ); + } + catch( ClassCastException ex ) + { + if( idObject instanceof Number ) + { + primaryKey.set( 0, ((Number)idObject).intValue() ); + setId( ((Number)idObject).intValue() ); + } + else { + throw ex; + } + } + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/package.xml b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/package.xml new file mode 100644 index 00000000..a186b39c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/inner/package.xml @@ -0,0 +1,1639 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AcidentadosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AcidentadosData.java new file mode 100644 index 00000000..2713cd49 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AcidentadosData.java @@ -0,0 +1,18 @@ +/* +* AcidentadosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class AcidentadosData extends db.data.siprp.inner.Acidentados +{ + + public AcidentadosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ActualizacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ActualizacaoData.java new file mode 100644 index 00000000..316c102d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ActualizacaoData.java @@ -0,0 +1,18 @@ +/* +* ActualizacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class ActualizacaoData extends db.data.siprp.inner.Actualizacao +{ + + public ActualizacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AnalisesAcidentesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AnalisesAcidentesData.java new file mode 100644 index 00000000..5177c7f2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AnalisesAcidentesData.java @@ -0,0 +1,18 @@ +/* +* AnalisesAcidentesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class AnalisesAcidentesData extends db.data.siprp.inner.AnalisesAcidentes +{ + + public AnalisesAcidentesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AvisosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AvisosData.java new file mode 100644 index 00000000..580bbe07 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/AvisosData.java @@ -0,0 +1,18 @@ +/* +* AvisosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class AvisosData extends db.data.siprp.inner.Avisos +{ + + public AvisosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/CausasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/CausasData.java new file mode 100644 index 00000000..0d0ff4a4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/CausasData.java @@ -0,0 +1,18 @@ +/* +* CausasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class CausasData extends db.data.siprp.inner.Causas +{ + + public CausasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ContactosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ContactosData.java new file mode 100644 index 00000000..d841d28a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ContactosData.java @@ -0,0 +1,18 @@ +/* +* ContactosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class ContactosData extends db.data.siprp.inner.Contactos +{ + + public ContactosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ControleData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ControleData.java new file mode 100644 index 00000000..8f919bb0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ControleData.java @@ -0,0 +1,18 @@ +/* +* ControleData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class ControleData extends db.data.siprp.inner.Controle +{ + + public ControleData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/DepartamentosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/DepartamentosData.java new file mode 100644 index 00000000..197c5982 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/DepartamentosData.java @@ -0,0 +1,18 @@ +/* +* DepartamentosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class DepartamentosData extends db.data.siprp.inner.Departamentos +{ + + public DepartamentosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EmpresasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EmpresasData.java new file mode 100644 index 00000000..7b7b34ca --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EmpresasData.java @@ -0,0 +1,18 @@ +/* +* EmpresasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class EmpresasData extends db.data.siprp.inner.Empresas +{ + + public EmpresasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ErrorsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ErrorsData.java new file mode 100644 index 00000000..2752eb49 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ErrorsData.java @@ -0,0 +1,18 @@ +/* +* ErrorsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class ErrorsData extends db.data.siprp.inner.Errors +{ + + public ErrorsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EstabelecimentosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EstabelecimentosData.java new file mode 100644 index 00000000..61ee1210 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EstabelecimentosData.java @@ -0,0 +1,18 @@ +/* +* EstabelecimentosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class EstabelecimentosData extends db.data.siprp.inner.Estabelecimentos +{ + + public EstabelecimentosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EstadoMedidasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EstadoMedidasData.java new file mode 100644 index 00000000..12d62136 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/EstadoMedidasData.java @@ -0,0 +1,18 @@ +/* +* EstadoMedidasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class EstadoMedidasData extends db.data.siprp.inner.EstadoMedidas +{ + + public EstadoMedidasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ExamesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ExamesData.java new file mode 100644 index 00000000..5710efe5 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ExamesData.java @@ -0,0 +1,18 @@ +/* +* ExamesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class ExamesData extends db.data.siprp.inner.Exames +{ + + public ExamesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ExamesPerfisData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ExamesPerfisData.java new file mode 100644 index 00000000..3e709b6b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/ExamesPerfisData.java @@ -0,0 +1,18 @@ +/* +* ExamesPerfisData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class ExamesPerfisData extends db.data.siprp.inner.ExamesPerfis +{ + + public ExamesPerfisData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/HistoricoEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/HistoricoEstabelecimentoData.java new file mode 100644 index 00000000..caaafddc --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/HistoricoEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* HistoricoEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class HistoricoEstabelecimentoData extends db.data.siprp.inner.HistoricoEstabelecimento +{ + + public HistoricoEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesEmpresaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesEmpresaData.java new file mode 100644 index 00000000..79679543 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesEmpresaData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesEmpresaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class MarcacoesEmpresaData extends db.data.siprp.inner.MarcacoesEmpresa +{ + + public MarcacoesEmpresaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesEstabelecimentoData.java new file mode 100644 index 00000000..a901db91 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class MarcacoesEstabelecimentoData extends db.data.siprp.inner.MarcacoesEstabelecimento +{ + + public MarcacoesEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesTrabalhadorData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesTrabalhadorData.java new file mode 100644 index 00000000..e630fc2e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MarcacoesTrabalhadorData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesTrabalhadorData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class MarcacoesTrabalhadorData extends db.data.siprp.inner.MarcacoesTrabalhador +{ + + public MarcacoesTrabalhadorData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MedicosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MedicosData.java new file mode 100644 index 00000000..3e2ee281 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MedicosData.java @@ -0,0 +1,18 @@ +/* +* MedicosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class MedicosData extends db.data.siprp.inner.Medicos +{ + + public MedicosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MedidasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MedidasData.java new file mode 100644 index 00000000..30a6c6f3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/MedidasData.java @@ -0,0 +1,18 @@ +/* +* MedidasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class MedidasData extends db.data.siprp.inner.Medidas +{ + + public MedidasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/NotNoticiasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/NotNoticiasData.java new file mode 100644 index 00000000..b9598074 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/NotNoticiasData.java @@ -0,0 +1,18 @@ +/* +* NotNoticiasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class NotNoticiasData extends db.data.siprp.inner.NotNoticias +{ + + public NotNoticiasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PermissoesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PermissoesData.java new file mode 100644 index 00000000..4b7d3356 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PermissoesData.java @@ -0,0 +1,18 @@ +/* +* PermissoesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PermissoesData extends db.data.siprp.inner.Permissoes +{ + + public PermissoesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoAreasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoAreasData.java new file mode 100644 index 00000000..960a9807 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoAreasData.java @@ -0,0 +1,18 @@ +/* +* PlanoAreasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanoAreasData extends db.data.siprp.inner.PlanoAreas +{ + + public PlanoAreasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoMedidasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoMedidasData.java new file mode 100644 index 00000000..8d105648 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoMedidasData.java @@ -0,0 +1,18 @@ +/* +* PlanoMedidasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanoMedidasData extends db.data.siprp.inner.PlanoMedidas +{ + + public PlanoMedidasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoPostosTrabalhoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoPostosTrabalhoData.java new file mode 100644 index 00000000..a594b298 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoPostosTrabalhoData.java @@ -0,0 +1,18 @@ +/* +* PlanoPostosTrabalhoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanoPostosTrabalhoData extends db.data.siprp.inner.PlanoPostosTrabalho +{ + + public PlanoPostosTrabalhoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoRiscosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoRiscosData.java new file mode 100644 index 00000000..90b3891f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoRiscosData.java @@ -0,0 +1,18 @@ +/* +* PlanoRiscosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanoRiscosData extends db.data.siprp.inner.PlanoRiscos +{ + + public PlanoRiscosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoValoresQualitativosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoValoresQualitativosData.java new file mode 100644 index 00000000..014e7762 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanoValoresQualitativosData.java @@ -0,0 +1,18 @@ +/* +* PlanoValoresQualitativosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanoValoresQualitativosData extends db.data.siprp.inner.PlanoValoresQualitativos +{ + + public PlanoValoresQualitativosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanosActuacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanosActuacaoData.java new file mode 100644 index 00000000..23804955 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PlanosActuacaoData.java @@ -0,0 +1,18 @@ +/* +* PlanosActuacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PlanosActuacaoData extends db.data.siprp.inner.PlanosActuacao +{ + + public PlanosActuacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PropertiesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PropertiesData.java new file mode 100644 index 00000000..7f93b5b5 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/PropertiesData.java @@ -0,0 +1,18 @@ +/* +* PropertiesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class PropertiesData extends db.data.siprp.inner.Properties +{ + + public PropertiesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RecomendacoesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RecomendacoesData.java new file mode 100644 index 00000000..8a951078 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RecomendacoesData.java @@ -0,0 +1,18 @@ +/* +* RecomendacoesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class RecomendacoesData extends db.data.siprp.inner.Recomendacoes +{ + + public RecomendacoesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RiscoValoresTempData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RiscoValoresTempData.java new file mode 100644 index 00000000..1756a8b0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RiscoValoresTempData.java @@ -0,0 +1,18 @@ +/* +* RiscoValoresTempData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class RiscoValoresTempData extends db.data.siprp.inner.RiscoValoresTemp +{ + + public RiscoValoresTempData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RolesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RolesData.java new file mode 100644 index 00000000..2ac92c55 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/RolesData.java @@ -0,0 +1,18 @@ +/* +* RolesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class RolesData extends db.data.siprp.inner.Roles +{ + + public RolesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/SeccoesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/SeccoesData.java new file mode 100644 index 00000000..5b6b39bc --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/SeccoesData.java @@ -0,0 +1,18 @@ +/* +* SeccoesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class SeccoesData extends db.data.siprp.inner.Seccoes +{ + + public SeccoesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TiposExamesCompData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TiposExamesCompData.java new file mode 100644 index 00000000..f7c0a8f4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TiposExamesCompData.java @@ -0,0 +1,18 @@ +/* +* TiposExamesCompData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class TiposExamesCompData extends db.data.siprp.inner.TiposExamesComp +{ + + public TiposExamesCompData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TiposUtilizadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TiposUtilizadoresData.java new file mode 100644 index 00000000..56f478b7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TiposUtilizadoresData.java @@ -0,0 +1,18 @@ +/* +* TiposUtilizadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class TiposUtilizadoresData extends db.data.siprp.inner.TiposUtilizadores +{ + + public TiposUtilizadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TrabalhadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TrabalhadoresData.java new file mode 100644 index 00000000..81950266 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/TrabalhadoresData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class TrabalhadoresData extends db.data.siprp.inner.Trabalhadores +{ + + public TrabalhadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/UsersData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/UsersData.java new file mode 100644 index 00000000..5a661b86 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/UsersData.java @@ -0,0 +1,18 @@ +/* +* UsersData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class UsersData extends db.data.siprp.inner.Users +{ + + public UsersData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/UtilizadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/UtilizadoresData.java new file mode 100644 index 00000000..3e5a0425 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/UtilizadoresData.java @@ -0,0 +1,18 @@ +/* +* UtilizadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class UtilizadoresData extends db.data.siprp.inner.Utilizadores +{ + + public UtilizadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/VersionData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/VersionData.java new file mode 100644 index 00000000..128a7c4b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp/outer/VersionData.java @@ -0,0 +1,18 @@ +/* +* VersionData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp.outer; + + +public final class VersionData extends db.data.siprp.inner.Version +{ + + public VersionData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Actualizacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Actualizacao.java new file mode 100644 index 00000000..aa015d0a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Actualizacao.java @@ -0,0 +1,280 @@ +/* +* Actualizacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Actualizacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Actualizacao.HORA, Actualizacao.HORA_INDEX ); + FIELD_INDEXES.put( Actualizacao.HORA_FULL, Actualizacao.HORA_INDEX ); + FIELD_INDEXES.put( Actualizacao.ID, Actualizacao.ID_INDEX ); + FIELD_INDEXES.put( Actualizacao.ID_FULL, Actualizacao.ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "actualizacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.actualizacao"; + + public static final int _INVALID__INDEX = -1; + public static final String HORA = "hora"; + public static final String HORA_FULL = "actualizacao.hora"; + public static final int HORA_INDEX = 0; + public static final String ID = "id"; + public static final String ID_FULL = "actualizacao.id"; + public static final int ID_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + HORA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + HORA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + HORA, ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + HORA, ID, }; + + private java.sql.Timestamp hora; + private Integer id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Actualizacao() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public java.sql.Timestamp getHora() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HORA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hora; + } + + public void setHora( java.sql.Timestamp hora ) + { + try + { + setLockedForRefresh( true ); + preProcess( HORA, hora ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hora = hora; + LAZY_LOADED_OBJECTS.put( HORA, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Actualizacao.HORA_INDEX: + value = getHora(); + break; + case Actualizacao.ID_INDEX: + value = getId(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Actualizacao.HORA_INDEX: + value = this.hora; + break; + case Actualizacao.ID_INDEX: + value = this.id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Actualizacao.HORA_INDEX: + setHora( ( java.sql.Timestamp ) value ); + break; + case Actualizacao.ID_INDEX: + setId( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Actualizacao.HORA_INDEX: + this.hora = ( java.sql.Timestamp ) value; + break; + case Actualizacao.ID_INDEX: + this.id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Actualizacao.HORA_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Actualizacao.ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Actualizacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Actualizacao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptAppointment.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptAppointment.java new file mode 100644 index 00000000..35d979a4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptAppointment.java @@ -0,0 +1,609 @@ +/* +* AptAppointment.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class AptAppointment extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( AptAppointment.ID, AptAppointment.ID_INDEX ); + FIELD_INDEXES.put( AptAppointment.ID_FULL, AptAppointment.ID_INDEX ); + FIELD_INDEXES.put( AptAppointment.DAY_DATE, AptAppointment.DAY_DATE_INDEX ); + FIELD_INDEXES.put( AptAppointment.DAY_DATE_FULL, AptAppointment.DAY_DATE_INDEX ); + FIELD_INDEXES.put( AptAppointment.START_TIME, AptAppointment.START_TIME_INDEX ); + FIELD_INDEXES.put( AptAppointment.START_TIME_FULL, AptAppointment.START_TIME_INDEX ); + FIELD_INDEXES.put( AptAppointment.END_TIME, AptAppointment.END_TIME_INDEX ); + FIELD_INDEXES.put( AptAppointment.END_TIME_FULL, AptAppointment.END_TIME_INDEX ); + FIELD_INDEXES.put( AptAppointment.NOTES, AptAppointment.NOTES_INDEX ); + FIELD_INDEXES.put( AptAppointment.NOTES_FULL, AptAppointment.NOTES_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( AptAppointment.CLASS_IDENTIFIER, AptAppointment.STATE_ID, AptAppointment.TO_STATE_ID ); + FIELD_INDEXES.put( AptAppointment.STATE_ID, AptAppointment.STATE_ID_INDEX ); + FIELD_INDEXES.put( AptAppointment.STATE_ID_FULL, AptAppointment.STATE_ID_INDEX ); + FIELD_INDEXES.put( AptAppointment.TO_STATE_ID, AptAppointment.TO_STATE_ID_INDEX ); + FIELD_INDEXES.put( AptAppointment.DELETED_STAMP, AptAppointment.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( AptAppointment.DELETED_STAMP_FULL, AptAppointment.DELETED_STAMP_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeystate_idToapt_state = + new com.evolute.entity.ForeignKey( AptAppointment.class, AptAppointment.STATE_ID, db.data.siprp_local.outer.AptStateData.class, db.data.siprp_local.outer.AptStateData.ID ); + + public static final String TABLENAME = "apt_appointment"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.apt_appointment"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "apt_appointment.id"; + public static final int ID_INDEX = 0; + public static final String DAY_DATE = "day_date"; + public static final String DAY_DATE_FULL = "apt_appointment.day_date"; + public static final int DAY_DATE_INDEX = 1; + public static final String START_TIME = "start_time"; + public static final String START_TIME_FULL = "apt_appointment.start_time"; + public static final int START_TIME_INDEX = 2; + public static final String END_TIME = "end_time"; + public static final String END_TIME_FULL = "apt_appointment.end_time"; + public static final int END_TIME_INDEX = 3; + public static final String NOTES = "notes"; + public static final String NOTES_FULL = "apt_appointment.notes"; + public static final int NOTES_INDEX = 4; + public static final String STATE_ID = "state_id"; + public static final String STATE_ID_FULL = "apt_appointment.state_id"; + public static final int STATE_ID_INDEX = 5; + public static final String TO_STATE_ID = "to_state_id"; + public static final String TO_STATE_ID_FULL = "apt_appointment.to_state_id"; + public static final int TO_STATE_ID_INDEX = 6; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "apt_appointment.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + DAY_DATE, START_TIME, END_TIME, NOTES, STATE_ID, TO_STATE_ID, DELETED_STAMP, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DAY_DATE, TABLENAME + "." + START_TIME, TABLENAME + "." + END_TIME, TABLENAME + "." + NOTES, TABLENAME + "." + STATE_ID, TABLENAME + "." + TO_STATE_ID, TABLENAME + "." + DELETED_STAMP, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DAY_DATE, START_TIME, END_TIME, NOTES, STATE_ID, DELETED_STAMP, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DAY_DATE, START_TIME, END_TIME, NOTES, STATE_ID, DELETED_STAMP, }; + + private Integer id; + private java.util.Date day_date; + private java.sql.Time start_time; + private java.sql.Time end_time; + private String notes; + private Integer state_id; + private db.data.siprp_local.outer.AptStateData to_state_id; + private java.sql.Timestamp deleted_stamp; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public AptAppointment() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAptSegurancaAlimentar_appointment_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.AptSegurancaAlimentarData.class , getPrimaryKey().getMap().get("id"), "appointment_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromFilFileAppointment_appointment_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.FilFileAppointmentData.class , getPrimaryKey().getMap().get("id"), "appointment_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getDay_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DAY_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.day_date; + } + + public void setDay_date( java.util.Date day_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DAY_DATE, day_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.day_date = day_date; + LAZY_LOADED_OBJECTS.put( DAY_DATE, Boolean.TRUE ); + } + + public java.sql.Time getStart_time() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( START_TIME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.start_time; + } + + public void setStart_time( java.sql.Time start_time ) + { + try + { + setLockedForRefresh( true ); + preProcess( START_TIME, start_time ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.start_time = start_time; + LAZY_LOADED_OBJECTS.put( START_TIME, Boolean.TRUE ); + } + + public java.sql.Time getEnd_time() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( END_TIME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.end_time; + } + + public void setEnd_time( java.sql.Time end_time ) + { + try + { + setLockedForRefresh( true ); + preProcess( END_TIME, end_time ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.end_time = end_time; + LAZY_LOADED_OBJECTS.put( END_TIME, Boolean.TRUE ); + } + + public String getNotes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOTES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.notes; + } + + public void setNotes( String notes ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOTES, notes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.notes = notes; + LAZY_LOADED_OBJECTS.put( NOTES, Boolean.TRUE ); + } + + public Integer getState_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( STATE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.state_id; + } + + public void setState_id( Integer state_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( STATE_ID, state_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.state_id = state_id; + LAZY_LOADED_OBJECTS.put( STATE_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.AptStateData toState_id() + { + try + { + prepare( TO_STATE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_state_id; + } + + public void setToState_id( db.data.siprp_local.outer.AptStateData to_state_id ) + { + try + { + preProcess( TO_STATE_ID, to_state_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_state_id = to_state_id; + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptAppointment.ID_INDEX: + value = getId(); + break; + case AptAppointment.DAY_DATE_INDEX: + value = getDay_date(); + break; + case AptAppointment.START_TIME_INDEX: + value = getStart_time(); + break; + case AptAppointment.END_TIME_INDEX: + value = getEnd_time(); + break; + case AptAppointment.NOTES_INDEX: + value = getNotes(); + break; + case AptAppointment.STATE_ID_INDEX: + value = getState_id(); + break; + case AptAppointment.TO_STATE_ID_INDEX: + value = toState_id(); + break; + case AptAppointment.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptAppointment.ID_INDEX: + value = this.id; + break; + case AptAppointment.DAY_DATE_INDEX: + value = this.day_date; + break; + case AptAppointment.START_TIME_INDEX: + value = this.start_time; + break; + case AptAppointment.END_TIME_INDEX: + value = this.end_time; + break; + case AptAppointment.NOTES_INDEX: + value = this.notes; + break; + case AptAppointment.STATE_ID_INDEX: + value = this.state_id; + break; + case AptAppointment.TO_STATE_ID_INDEX: + value = this.to_state_id; + break; + case AptAppointment.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptAppointment.ID_INDEX: + setId( ( Integer ) value ); + break; + case AptAppointment.DAY_DATE_INDEX: + setDay_date( ( java.util.Date ) value ); + break; + case AptAppointment.START_TIME_INDEX: + setStart_time( ( java.sql.Time ) value ); + break; + case AptAppointment.END_TIME_INDEX: + setEnd_time( ( java.sql.Time ) value ); + break; + case AptAppointment.NOTES_INDEX: + setNotes( ( String ) value ); + break; + case AptAppointment.STATE_ID_INDEX: + setState_id( ( Integer ) value ); + break; + case AptAppointment.TO_STATE_ID_INDEX: + setToState_id( ( db.data.siprp_local.outer.AptStateData ) value ); + break; + case AptAppointment.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptAppointment.ID_INDEX: + this.id = ( Integer ) value; + break; + case AptAppointment.DAY_DATE_INDEX: + this.day_date = ( java.util.Date ) value; + break; + case AptAppointment.START_TIME_INDEX: + this.start_time = ( java.sql.Time ) value; + break; + case AptAppointment.END_TIME_INDEX: + this.end_time = ( java.sql.Time ) value; + break; + case AptAppointment.NOTES_INDEX: + this.notes = ( String ) value; + break; + case AptAppointment.STATE_ID_INDEX: + this.state_id = ( Integer ) value; + break; + case AptAppointment.TO_STATE_ID_INDEX: + this.to_state_id = ( db.data.siprp_local.outer.AptStateData ) value; + break; + case AptAppointment.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case AptAppointment.ID_INDEX: + theClass = Integer.class; + break; + case AptAppointment.DAY_DATE_INDEX: + theClass = java.util.Date.class; + break; + case AptAppointment.START_TIME_INDEX: + theClass = java.sql.Time.class; + break; + case AptAppointment.END_TIME_INDEX: + theClass = java.sql.Time.class; + break; + case AptAppointment.NOTES_INDEX: + theClass = String.class; + break; + case AptAppointment.STATE_ID_INDEX: + theClass = Integer.class; + break; + case AptAppointment.TO_STATE_ID_INDEX: + theClass = db.data.siprp_local.outer.AptStateData.class; + break; + case AptAppointment.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : AptAppointment._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, AptAppointment.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptSegurancaAlimentar.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptSegurancaAlimentar.java new file mode 100644 index 00000000..2ed5f8e7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptSegurancaAlimentar.java @@ -0,0 +1,483 @@ +/* +* AptSegurancaAlimentar.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class AptSegurancaAlimentar extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( AptSegurancaAlimentar.ID, AptSegurancaAlimentar.ID_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.ID_FULL, AptSegurancaAlimentar.ID_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.DELETED_STAMP, AptSegurancaAlimentar.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.DELETED_STAMP_FULL, AptSegurancaAlimentar.DELETED_STAMP_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( AptSegurancaAlimentar.CLASS_IDENTIFIER, AptSegurancaAlimentar.APPOINTMENT_ID, AptSegurancaAlimentar.TO_APPOINTMENT_ID ); + FIELD_INDEXES.put( AptSegurancaAlimentar.APPOINTMENT_ID, AptSegurancaAlimentar.APPOINTMENT_ID_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.APPOINTMENT_ID_FULL, AptSegurancaAlimentar.APPOINTMENT_ID_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.TO_APPOINTMENT_ID, AptSegurancaAlimentar.TO_APPOINTMENT_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( AptSegurancaAlimentar.CLASS_IDENTIFIER, AptSegurancaAlimentar.ESTABELECIMENTO_ID, AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( AptSegurancaAlimentar.ESTABELECIMENTO_ID, AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.ESTABELECIMENTO_ID_FULL, AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID, AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyappointment_idToapt_appointment = + new com.evolute.entity.ForeignKey( AptSegurancaAlimentar.class, AptSegurancaAlimentar.APPOINTMENT_ID, db.data.siprp_local.outer.AptAppointmentData.class, db.data.siprp_local.outer.AptAppointmentData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( AptSegurancaAlimentar.class, AptSegurancaAlimentar.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "apt_seguranca_alimentar"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.apt_seguranca_alimentar"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "apt_seguranca_alimentar.id"; + public static final int ID_INDEX = 0; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "apt_seguranca_alimentar.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 1; + public static final String APPOINTMENT_ID = "appointment_id"; + public static final String APPOINTMENT_ID_FULL = "apt_seguranca_alimentar.appointment_id"; + public static final int APPOINTMENT_ID_INDEX = 2; + public static final String TO_APPOINTMENT_ID = "to_appointment_id"; + public static final String TO_APPOINTMENT_ID_FULL = "apt_seguranca_alimentar.to_appointment_id"; + public static final int TO_APPOINTMENT_ID_INDEX = 3; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "apt_seguranca_alimentar.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 4; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "apt_seguranca_alimentar.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DELETED_STAMP, APPOINTMENT_ID, TO_APPOINTMENT_ID, ESTABELECIMENTO_ID, + TO_ESTABELECIMENTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DELETED_STAMP, TABLENAME + "." + APPOINTMENT_ID, TABLENAME + "." + TO_APPOINTMENT_ID, TABLENAME + "." + ESTABELECIMENTO_ID, + TABLENAME + "." + TO_ESTABELECIMENTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DELETED_STAMP, APPOINTMENT_ID, ESTABELECIMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DELETED_STAMP, APPOINTMENT_ID, ESTABELECIMENTO_ID, }; + + private Integer id; + private java.sql.Timestamp deleted_stamp; + private Integer appointment_id; + private db.data.siprp_local.outer.AptAppointmentData to_appointment_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public AptSegurancaAlimentar() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public Integer getAppointment_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( APPOINTMENT_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.appointment_id; + } + + public void setAppointment_id( Integer appointment_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( APPOINTMENT_ID, appointment_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.appointment_id = appointment_id; + LAZY_LOADED_OBJECTS.put( APPOINTMENT_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.AptAppointmentData toAppointment_id() + { + try + { + prepare( TO_APPOINTMENT_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_appointment_id; + } + + public void setToAppointment_id( db.data.siprp_local.outer.AptAppointmentData to_appointment_id ) + { + try + { + preProcess( TO_APPOINTMENT_ID, to_appointment_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_appointment_id = to_appointment_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptSegurancaAlimentar.ID_INDEX: + value = getId(); + break; + case AptSegurancaAlimentar.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + case AptSegurancaAlimentar.APPOINTMENT_ID_INDEX: + value = getAppointment_id(); + break; + case AptSegurancaAlimentar.TO_APPOINTMENT_ID_INDEX: + value = toAppointment_id(); + break; + case AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptSegurancaAlimentar.ID_INDEX: + value = this.id; + break; + case AptSegurancaAlimentar.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + case AptSegurancaAlimentar.APPOINTMENT_ID_INDEX: + value = this.appointment_id; + break; + case AptSegurancaAlimentar.TO_APPOINTMENT_ID_INDEX: + value = this.to_appointment_id; + break; + case AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptSegurancaAlimentar.ID_INDEX: + setId( ( Integer ) value ); + break; + case AptSegurancaAlimentar.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + case AptSegurancaAlimentar.APPOINTMENT_ID_INDEX: + setAppointment_id( ( Integer ) value ); + break; + case AptSegurancaAlimentar.TO_APPOINTMENT_ID_INDEX: + setToAppointment_id( ( db.data.siprp_local.outer.AptAppointmentData ) value ); + break; + case AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptSegurancaAlimentar.ID_INDEX: + this.id = ( Integer ) value; + break; + case AptSegurancaAlimentar.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + case AptSegurancaAlimentar.APPOINTMENT_ID_INDEX: + this.appointment_id = ( Integer ) value; + break; + case AptSegurancaAlimentar.TO_APPOINTMENT_ID_INDEX: + this.to_appointment_id = ( db.data.siprp_local.outer.AptAppointmentData ) value; + break; + case AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case AptSegurancaAlimentar.ID_INDEX: + theClass = Integer.class; + break; + case AptSegurancaAlimentar.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case AptSegurancaAlimentar.APPOINTMENT_ID_INDEX: + theClass = Integer.class; + break; + case AptSegurancaAlimentar.TO_APPOINTMENT_ID_INDEX: + theClass = db.data.siprp_local.outer.AptAppointmentData.class; + break; + case AptSegurancaAlimentar.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case AptSegurancaAlimentar.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : AptSegurancaAlimentar._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, AptSegurancaAlimentar.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptState.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptState.java new file mode 100644 index 00000000..3bb24cb4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/AptState.java @@ -0,0 +1,293 @@ +/* +* AptState.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class AptState extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( AptState.ID, AptState.ID_INDEX ); + FIELD_INDEXES.put( AptState.ID_FULL, AptState.ID_INDEX ); + FIELD_INDEXES.put( AptState.DESCRIPTION, AptState.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( AptState.DESCRIPTION_FULL, AptState.DESCRIPTION_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "apt_state"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.apt_state"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "apt_state.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "apt_state.description"; + public static final int DESCRIPTION_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, }; + + private Integer id; + private String description; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public AptState() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAptAppointment_state_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.AptAppointmentData.class , getPrimaryKey().getMap().get("id"), "state_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptState.ID_INDEX: + value = getId(); + break; + case AptState.DESCRIPTION_INDEX: + value = getDescription(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptState.ID_INDEX: + value = this.id; + break; + case AptState.DESCRIPTION_INDEX: + value = this.description; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptState.ID_INDEX: + setId( ( Integer ) value ); + break; + case AptState.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case AptState.ID_INDEX: + this.id = ( Integer ) value; + break; + case AptState.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case AptState.ID_INDEX: + theClass = Integer.class; + break; + case AptState.DESCRIPTION_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : AptState._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, AptState.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Avisos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Avisos.java new file mode 100644 index 00000000..86793d5c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Avisos.java @@ -0,0 +1,786 @@ +/* +* Avisos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Avisos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Avisos.ID, Avisos.ID_INDEX ); + FIELD_INDEXES.put( Avisos.ID_FULL, Avisos.ID_INDEX ); + FIELD_INDEXES.put( Avisos.TIPO, Avisos.TIPO_INDEX ); + FIELD_INDEXES.put( Avisos.TIPO_FULL, Avisos.TIPO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Avisos.CLASS_IDENTIFIER, Avisos.EMPRESA_ID, Avisos.TO_EMPRESA_ID ); + FIELD_INDEXES.put( Avisos.EMPRESA_ID, Avisos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Avisos.EMPRESA_ID_FULL, Avisos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TO_EMPRESA_ID, Avisos.TO_EMPRESA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Avisos.CLASS_IDENTIFIER, Avisos.ESTABELECIMENTO_ID, Avisos.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( Avisos.ESTABELECIMENTO_ID, Avisos.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.ESTABELECIMENTO_ID_FULL, Avisos.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TO_ESTABELECIMENTO_ID, Avisos.TO_ESTABELECIMENTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Avisos.CLASS_IDENTIFIER, Avisos.TRABALHADOR_ID, Avisos.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( Avisos.TRABALHADOR_ID, Avisos.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TRABALHADOR_ID_FULL, Avisos.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Avisos.TO_TRABALHADOR_ID, Avisos.TO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Avisos.EVENTO_ID, Avisos.EVENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.EVENTO_ID_FULL, Avisos.EVENTO_ID_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_AVISO, Avisos.DATA_AVISO_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_AVISO_FULL, Avisos.DATA_AVISO_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_EVENTO, Avisos.DATA_EVENTO_INDEX ); + FIELD_INDEXES.put( Avisos.DATA_EVENTO_FULL, Avisos.DATA_EVENTO_INDEX ); + FIELD_INDEXES.put( Avisos.DESCRICAO, Avisos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Avisos.DESCRICAO_FULL, Avisos.DESCRICAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( Avisos.class, Avisos.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( Avisos.class, Avisos.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( Avisos.class, Avisos.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final String TABLENAME = "avisos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.avisos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "avisos.id"; + public static final int ID_INDEX = 0; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "avisos.tipo"; + public static final int TIPO_INDEX = 1; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "avisos.empresa_id"; + public static final int EMPRESA_ID_INDEX = 2; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "avisos.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 3; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "avisos.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 4; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "avisos.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 5; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "avisos.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 6; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "avisos.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 7; + public static final String EVENTO_ID = "evento_id"; + public static final String EVENTO_ID_FULL = "avisos.evento_id"; + public static final int EVENTO_ID_INDEX = 8; + public static final String DATA_AVISO = "data_aviso"; + public static final String DATA_AVISO_FULL = "avisos.data_aviso"; + public static final int DATA_AVISO_INDEX = 9; + public static final String DATA_EVENTO = "data_evento"; + public static final String DATA_EVENTO_FULL = "avisos.data_evento"; + public static final int DATA_EVENTO_INDEX = 10; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "avisos.descricao"; + public static final int DESCRICAO_INDEX = 11; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO, EMPRESA_ID, TO_EMPRESA_ID, ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, + TRABALHADOR_ID, TO_TRABALHADOR_ID, EVENTO_ID, DATA_AVISO, DATA_EVENTO, DESCRICAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + EVENTO_ID, TABLENAME + "." + DATA_AVISO, TABLENAME + "." + DATA_EVENTO, TABLENAME + "." + DESCRICAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO, EMPRESA_ID, ESTABELECIMENTO_ID, TRABALHADOR_ID, EVENTO_ID, DATA_AVISO, + DATA_EVENTO, DESCRICAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO, EMPRESA_ID, ESTABELECIMENTO_ID, TRABALHADOR_ID, EVENTO_ID, DATA_AVISO, + DATA_EVENTO, DESCRICAO, }; + + private Integer id; + private Integer tipo; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private Integer evento_id; + private java.util.Date data_aviso; + private java.util.Date data_evento; + private String descricao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Avisos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false, false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getEvento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EVENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.evento_id; + } + + public void setEvento_id( Integer evento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EVENTO_ID, evento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.evento_id = evento_id; + LAZY_LOADED_OBJECTS.put( EVENTO_ID, Boolean.TRUE ); + } + + public java.util.Date getData_aviso() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_AVISO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_aviso; + } + + public void setData_aviso( java.util.Date data_aviso ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_AVISO, data_aviso ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_aviso = data_aviso; + LAZY_LOADED_OBJECTS.put( DATA_AVISO, Boolean.TRUE ); + } + + public java.util.Date getData_evento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EVENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_evento; + } + + public void setData_evento( java.util.Date data_evento ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_EVENTO, data_evento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_evento = data_evento; + LAZY_LOADED_OBJECTS.put( DATA_EVENTO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + value = getId(); + break; + case Avisos.TIPO_INDEX: + value = getTipo(); + break; + case Avisos.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case Avisos.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case Avisos.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case Avisos.EVENTO_ID_INDEX: + value = getEvento_id(); + break; + case Avisos.DATA_AVISO_INDEX: + value = getData_aviso(); + break; + case Avisos.DATA_EVENTO_INDEX: + value = getData_evento(); + break; + case Avisos.DESCRICAO_INDEX: + value = getDescricao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + value = this.id; + break; + case Avisos.TIPO_INDEX: + value = this.tipo; + break; + case Avisos.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case Avisos.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case Avisos.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case Avisos.EVENTO_ID_INDEX: + value = this.evento_id; + break; + case Avisos.DATA_AVISO_INDEX: + value = this.data_aviso; + break; + case Avisos.DATA_EVENTO_INDEX: + value = this.data_evento; + break; + case Avisos.DESCRICAO_INDEX: + value = this.descricao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Avisos.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case Avisos.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case Avisos.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + case Avisos.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case Avisos.EVENTO_ID_INDEX: + setEvento_id( ( Integer ) value ); + break; + case Avisos.DATA_AVISO_INDEX: + setData_aviso( ( java.util.Date ) value ); + break; + case Avisos.DATA_EVENTO_INDEX: + setData_evento( ( java.util.Date ) value ); + break; + case Avisos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Avisos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Avisos.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case Avisos.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case Avisos.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + case Avisos.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case Avisos.EVENTO_ID_INDEX: + this.evento_id = ( Integer ) value; + break; + case Avisos.DATA_AVISO_INDEX: + this.data_aviso = ( java.util.Date ) value; + break; + case Avisos.DATA_EVENTO_INDEX: + this.data_evento = ( java.util.Date ) value; + break; + case Avisos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Avisos.ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TIPO_INDEX: + theClass = Integer.class; + break; + case Avisos.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case Avisos.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + case Avisos.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case Avisos.EVENTO_ID_INDEX: + theClass = Integer.class; + break; + case Avisos.DATA_AVISO_INDEX: + theClass = java.util.Date.class; + break; + case Avisos.DATA_EVENTO_INDEX: + theClass = java.util.Date.class; + break; + case Avisos.DESCRICAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Avisos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Avisos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Contactos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Contactos.java new file mode 100644 index 00000000..ca51c0dd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Contactos.java @@ -0,0 +1,637 @@ +/* +* Contactos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Contactos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Contactos.ID, Contactos.ID_INDEX ); + FIELD_INDEXES.put( Contactos.ID_FULL, Contactos.ID_INDEX ); + FIELD_INDEXES.put( Contactos.NOME, Contactos.NOME_INDEX ); + FIELD_INDEXES.put( Contactos.NOME_FULL, Contactos.NOME_INDEX ); + FIELD_INDEXES.put( Contactos.TELEFONE, Contactos.TELEFONE_INDEX ); + FIELD_INDEXES.put( Contactos.TELEFONE_FULL, Contactos.TELEFONE_INDEX ); + FIELD_INDEXES.put( Contactos.TELEMOVEL, Contactos.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( Contactos.TELEMOVEL_FULL, Contactos.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( Contactos.FAX, Contactos.FAX_INDEX ); + FIELD_INDEXES.put( Contactos.FAX_FULL, Contactos.FAX_INDEX ); + FIELD_INDEXES.put( Contactos.EMAIL, Contactos.EMAIL_INDEX ); + FIELD_INDEXES.put( Contactos.EMAIL_FULL, Contactos.EMAIL_INDEX ); + FIELD_INDEXES.put( Contactos.CARGO, Contactos.CARGO_INDEX ); + FIELD_INDEXES.put( Contactos.CARGO_FULL, Contactos.CARGO_INDEX ); + FIELD_INDEXES.put( Contactos.DEPARTAMENTO, Contactos.DEPARTAMENTO_INDEX ); + FIELD_INDEXES.put( Contactos.DEPARTAMENTO_FULL, Contactos.DEPARTAMENTO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "contactos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.contactos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "contactos.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "contactos.nome"; + public static final int NOME_INDEX = 1; + public static final String TELEFONE = "telefone"; + public static final String TELEFONE_FULL = "contactos.telefone"; + public static final int TELEFONE_INDEX = 2; + public static final String TELEMOVEL = "telemovel"; + public static final String TELEMOVEL_FULL = "contactos.telemovel"; + public static final int TELEMOVEL_INDEX = 3; + public static final String FAX = "fax"; + public static final String FAX_FULL = "contactos.fax"; + public static final int FAX_INDEX = 4; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "contactos.email"; + public static final int EMAIL_INDEX = 5; + public static final String CARGO = "cargo"; + public static final String CARGO_FULL = "contactos.cargo"; + public static final int CARGO_INDEX = 6; + public static final String DEPARTAMENTO = "departamento"; + public static final String DEPARTAMENTO_FULL = "contactos.departamento"; + public static final int DEPARTAMENTO_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, TELEFONE, TELEMOVEL, FAX, EMAIL, CARGO, DEPARTAMENTO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + TELEFONE, TABLENAME + "." + TELEMOVEL, TABLENAME + "." + FAX, TABLENAME + "." + EMAIL, TABLENAME + "." + CARGO, TABLENAME + "." + DEPARTAMENTO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, TELEFONE, TELEMOVEL, FAX, EMAIL, CARGO, DEPARTAMENTO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, TELEFONE, TELEMOVEL, FAX, EMAIL, CARGO, DEPARTAMENTO, }; + + private Integer id; + private String nome; + private String telefone; + private String telemovel; + private String fax; + private String email; + private String cargo; + private String departamento; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Contactos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEmpresas_contacto_1() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmpresasData.class , getPrimaryKey().getMap().get("id"), "contacto_1" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEmpresas_contacto_2() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmpresasData.class , getPrimaryKey().getMap().get("id"), "contacto_2" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEstabelecimentos_contacto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "contacto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromPrestadores_contacto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrestadoresData.class , getPrimaryKey().getMap().get("id"), "contacto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getTelefone() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEFONE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telefone; + } + + public void setTelefone( String telefone ) + { + try + { + setLockedForRefresh( true ); + preProcess( TELEFONE, telefone ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telefone = telefone; + LAZY_LOADED_OBJECTS.put( TELEFONE, Boolean.TRUE ); + } + + public String getTelemovel() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEMOVEL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telemovel; + } + + public void setTelemovel( String telemovel ) + { + try + { + setLockedForRefresh( true ); + preProcess( TELEMOVEL, telemovel ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telemovel = telemovel; + LAZY_LOADED_OBJECTS.put( TELEMOVEL, Boolean.TRUE ); + } + + public String getFax() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FAX ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fax; + } + + public void setFax( String fax ) + { + try + { + setLockedForRefresh( true ); + preProcess( FAX, fax ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fax = fax; + LAZY_LOADED_OBJECTS.put( FAX, Boolean.TRUE ); + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public String getCargo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CARGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cargo; + } + + public void setCargo( String cargo ) + { + try + { + setLockedForRefresh( true ); + preProcess( CARGO, cargo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cargo = cargo; + LAZY_LOADED_OBJECTS.put( CARGO, Boolean.TRUE ); + } + + public String getDepartamento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DEPARTAMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.departamento; + } + + public void setDepartamento( String departamento ) + { + try + { + setLockedForRefresh( true ); + preProcess( DEPARTAMENTO, departamento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.departamento = departamento; + LAZY_LOADED_OBJECTS.put( DEPARTAMENTO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + value = getId(); + break; + case Contactos.NOME_INDEX: + value = getNome(); + break; + case Contactos.TELEFONE_INDEX: + value = getTelefone(); + break; + case Contactos.TELEMOVEL_INDEX: + value = getTelemovel(); + break; + case Contactos.FAX_INDEX: + value = getFax(); + break; + case Contactos.EMAIL_INDEX: + value = getEmail(); + break; + case Contactos.CARGO_INDEX: + value = getCargo(); + break; + case Contactos.DEPARTAMENTO_INDEX: + value = getDepartamento(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + value = this.id; + break; + case Contactos.NOME_INDEX: + value = this.nome; + break; + case Contactos.TELEFONE_INDEX: + value = this.telefone; + break; + case Contactos.TELEMOVEL_INDEX: + value = this.telemovel; + break; + case Contactos.FAX_INDEX: + value = this.fax; + break; + case Contactos.EMAIL_INDEX: + value = this.email; + break; + case Contactos.CARGO_INDEX: + value = this.cargo; + break; + case Contactos.DEPARTAMENTO_INDEX: + value = this.departamento; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Contactos.NOME_INDEX: + setNome( ( String ) value ); + break; + case Contactos.TELEFONE_INDEX: + setTelefone( ( String ) value ); + break; + case Contactos.TELEMOVEL_INDEX: + setTelemovel( ( String ) value ); + break; + case Contactos.FAX_INDEX: + setFax( ( String ) value ); + break; + case Contactos.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + case Contactos.CARGO_INDEX: + setCargo( ( String ) value ); + break; + case Contactos.DEPARTAMENTO_INDEX: + setDepartamento( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Contactos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Contactos.NOME_INDEX: + this.nome = ( String ) value; + break; + case Contactos.TELEFONE_INDEX: + this.telefone = ( String ) value; + break; + case Contactos.TELEMOVEL_INDEX: + this.telemovel = ( String ) value; + break; + case Contactos.FAX_INDEX: + this.fax = ( String ) value; + break; + case Contactos.EMAIL_INDEX: + this.email = ( String ) value; + break; + case Contactos.CARGO_INDEX: + this.cargo = ( String ) value; + break; + case Contactos.DEPARTAMENTO_INDEX: + this.departamento = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Contactos.ID_INDEX: + theClass = Integer.class; + break; + case Contactos.NOME_INDEX: + theClass = String.class; + break; + case Contactos.TELEFONE_INDEX: + theClass = String.class; + break; + case Contactos.TELEMOVEL_INDEX: + theClass = String.class; + break; + case Contactos.FAX_INDEX: + theClass = String.class; + break; + case Contactos.EMAIL_INDEX: + theClass = String.class; + break; + case Contactos.CARGO_INDEX: + theClass = String.class; + break; + case Contactos.DEPARTAMENTO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Contactos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Contactos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurArs.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurArs.java new file mode 100644 index 00000000..cc307e7c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurArs.java @@ -0,0 +1,294 @@ +/* +* CurArs.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurArs extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurArs.ID, CurArs.ID_INDEX ); + FIELD_INDEXES.put( CurArs.ID_FULL, CurArs.ID_INDEX ); + FIELD_INDEXES.put( CurArs.NOME, CurArs.NOME_INDEX ); + FIELD_INDEXES.put( CurArs.NOME_FULL, CurArs.NOME_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_ars"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_ars"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_ars.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "cur_ars.nome"; + public static final int NOME_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, }; + + private Integer id; + private String nome; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurArs() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurFormandos_ars_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurFormandosData.class , getPrimaryKey().getMap().get("id"), "ars_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurArs.ID_INDEX: + value = getId(); + break; + case CurArs.NOME_INDEX: + value = getNome(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurArs.ID_INDEX: + value = this.id; + break; + case CurArs.NOME_INDEX: + value = this.nome; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurArs.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurArs.NOME_INDEX: + setNome( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurArs.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurArs.NOME_INDEX: + this.nome = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurArs.ID_INDEX: + theClass = Integer.class; + break; + case CurArs.NOME_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurArs._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurArs.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurAulas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurAulas.java new file mode 100644 index 00000000..ad28b2e8 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurAulas.java @@ -0,0 +1,509 @@ +/* +* CurAulas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurAulas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurAulas.ID, CurAulas.ID_INDEX ); + FIELD_INDEXES.put( CurAulas.ID_FULL, CurAulas.ID_INDEX ); + FIELD_INDEXES.put( CurAulas.INICIO_DATE, CurAulas.INICIO_DATE_INDEX ); + FIELD_INDEXES.put( CurAulas.INICIO_DATE_FULL, CurAulas.INICIO_DATE_INDEX ); + FIELD_INDEXES.put( CurAulas.FIM_DATE, CurAulas.FIM_DATE_INDEX ); + FIELD_INDEXES.put( CurAulas.FIM_DATE_FULL, CurAulas.FIM_DATE_INDEX ); + FIELD_INDEXES.put( CurAulas.DELETED_DATE, CurAulas.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurAulas.DELETED_DATE_FULL, CurAulas.DELETED_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurAulas.CLASS_IDENTIFIER, CurAulas.CUR_DIA_ID, CurAulas.TO_CUR_DIA_ID ); + FIELD_INDEXES.put( CurAulas.CUR_DIA_ID, CurAulas.CUR_DIA_ID_INDEX ); + FIELD_INDEXES.put( CurAulas.CUR_DIA_ID_FULL, CurAulas.CUR_DIA_ID_INDEX ); + FIELD_INDEXES.put( CurAulas.TO_CUR_DIA_ID, CurAulas.TO_CUR_DIA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeycur_dia_idTocur_dias = + new com.evolute.entity.ForeignKey( CurAulas.class, CurAulas.CUR_DIA_ID, db.data.siprp_local.outer.CurDiasData.class, db.data.siprp_local.outer.CurDiasData.ID ); + + public static final String TABLENAME = "cur_aulas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_aulas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_aulas.id"; + public static final int ID_INDEX = 0; + public static final String INICIO_DATE = "inicio_date"; + public static final String INICIO_DATE_FULL = "cur_aulas.inicio_date"; + public static final int INICIO_DATE_INDEX = 1; + public static final String FIM_DATE = "fim_date"; + public static final String FIM_DATE_FULL = "cur_aulas.fim_date"; + public static final int FIM_DATE_INDEX = 2; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_aulas.deleted_date"; + public static final int DELETED_DATE_INDEX = 3; + public static final String CUR_DIA_ID = "cur_dia_id"; + public static final String CUR_DIA_ID_FULL = "cur_aulas.cur_dia_id"; + public static final int CUR_DIA_ID_INDEX = 4; + public static final String TO_CUR_DIA_ID = "to_cur_dia_id"; + public static final String TO_CUR_DIA_ID_FULL = "cur_aulas.to_cur_dia_id"; + public static final int TO_CUR_DIA_ID_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + INICIO_DATE, FIM_DATE, DELETED_DATE, CUR_DIA_ID, TO_CUR_DIA_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + INICIO_DATE, TABLENAME + "." + FIM_DATE, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + CUR_DIA_ID, TABLENAME + "." + TO_CUR_DIA_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, INICIO_DATE, FIM_DATE, DELETED_DATE, CUR_DIA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, INICIO_DATE, FIM_DATE, DELETED_DATE, CUR_DIA_ID, }; + + private Integer id; + private java.sql.Time inicio_date; + private java.sql.Time fim_date; + private java.sql.Timestamp deleted_date; + private Integer cur_dia_id; + private db.data.siprp_local.outer.CurDiasData to_cur_dia_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurAulas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurAulasFormadores_aula_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurAulasFormadoresData.class , getPrimaryKey().getMap().get("id"), "aula_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurTopicosAulas_aula_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurTopicosAulasData.class , getPrimaryKey().getMap().get("id"), "aula_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.sql.Time getInicio_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INICIO_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inicio_date; + } + + public void setInicio_date( java.sql.Time inicio_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( INICIO_DATE, inicio_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inicio_date = inicio_date; + LAZY_LOADED_OBJECTS.put( INICIO_DATE, Boolean.TRUE ); + } + + public java.sql.Time getFim_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FIM_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fim_date; + } + + public void setFim_date( java.sql.Time fim_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( FIM_DATE, fim_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fim_date = fim_date; + LAZY_LOADED_OBJECTS.put( FIM_DATE, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getCur_dia_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CUR_DIA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cur_dia_id; + } + + public void setCur_dia_id( Integer cur_dia_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CUR_DIA_ID, cur_dia_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cur_dia_id = cur_dia_id; + LAZY_LOADED_OBJECTS.put( CUR_DIA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurDiasData toCur_dia_id() + { + try + { + prepare( TO_CUR_DIA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_cur_dia_id; + } + + public void setToCur_dia_id( db.data.siprp_local.outer.CurDiasData to_cur_dia_id ) + { + try + { + preProcess( TO_CUR_DIA_ID, to_cur_dia_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_cur_dia_id = to_cur_dia_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulas.ID_INDEX: + value = getId(); + break; + case CurAulas.INICIO_DATE_INDEX: + value = getInicio_date(); + break; + case CurAulas.FIM_DATE_INDEX: + value = getFim_date(); + break; + case CurAulas.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case CurAulas.CUR_DIA_ID_INDEX: + value = getCur_dia_id(); + break; + case CurAulas.TO_CUR_DIA_ID_INDEX: + value = toCur_dia_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulas.ID_INDEX: + value = this.id; + break; + case CurAulas.INICIO_DATE_INDEX: + value = this.inicio_date; + break; + case CurAulas.FIM_DATE_INDEX: + value = this.fim_date; + break; + case CurAulas.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case CurAulas.CUR_DIA_ID_INDEX: + value = this.cur_dia_id; + break; + case CurAulas.TO_CUR_DIA_ID_INDEX: + value = this.to_cur_dia_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulas.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurAulas.INICIO_DATE_INDEX: + setInicio_date( ( java.sql.Time ) value ); + break; + case CurAulas.FIM_DATE_INDEX: + setFim_date( ( java.sql.Time ) value ); + break; + case CurAulas.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case CurAulas.CUR_DIA_ID_INDEX: + setCur_dia_id( ( Integer ) value ); + break; + case CurAulas.TO_CUR_DIA_ID_INDEX: + setToCur_dia_id( ( db.data.siprp_local.outer.CurDiasData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulas.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurAulas.INICIO_DATE_INDEX: + this.inicio_date = ( java.sql.Time ) value; + break; + case CurAulas.FIM_DATE_INDEX: + this.fim_date = ( java.sql.Time ) value; + break; + case CurAulas.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case CurAulas.CUR_DIA_ID_INDEX: + this.cur_dia_id = ( Integer ) value; + break; + case CurAulas.TO_CUR_DIA_ID_INDEX: + this.to_cur_dia_id = ( db.data.siprp_local.outer.CurDiasData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurAulas.ID_INDEX: + theClass = Integer.class; + break; + case CurAulas.INICIO_DATE_INDEX: + theClass = java.sql.Time.class; + break; + case CurAulas.FIM_DATE_INDEX: + theClass = java.sql.Time.class; + break; + case CurAulas.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurAulas.CUR_DIA_ID_INDEX: + theClass = Integer.class; + break; + case CurAulas.TO_CUR_DIA_ID_INDEX: + theClass = db.data.siprp_local.outer.CurDiasData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurAulas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurAulas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurAulasFormadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurAulasFormadores.java new file mode 100644 index 00000000..a1ed0aae --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurAulasFormadores.java @@ -0,0 +1,431 @@ +/* +* CurAulasFormadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurAulasFormadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( CurAulasFormadores.CLASS_IDENTIFIER, CurAulasFormadores.AULA_ID, CurAulasFormadores.TO_AULA_ID ); + FIELD_INDEXES.put( CurAulasFormadores.AULA_ID, CurAulasFormadores.AULA_ID_INDEX ); + FIELD_INDEXES.put( CurAulasFormadores.AULA_ID_FULL, CurAulasFormadores.AULA_ID_INDEX ); + FIELD_INDEXES.put( CurAulasFormadores.TO_AULA_ID, CurAulasFormadores.TO_AULA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurAulasFormadores.CLASS_IDENTIFIER, CurAulasFormadores.FORMADOR_ID, CurAulasFormadores.TO_FORMADOR_ID ); + FIELD_INDEXES.put( CurAulasFormadores.FORMADOR_ID, CurAulasFormadores.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurAulasFormadores.FORMADOR_ID_FULL, CurAulasFormadores.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurAulasFormadores.TO_FORMADOR_ID, CurAulasFormadores.TO_FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurAulasFormadores.DELETED_DATE, CurAulasFormadores.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurAulasFormadores.DELETED_DATE_FULL, CurAulasFormadores.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyaula_idTocur_aulas = + new com.evolute.entity.ForeignKey( CurAulasFormadores.class, CurAulasFormadores.AULA_ID, db.data.siprp_local.outer.CurAulasData.class, db.data.siprp_local.outer.CurAulasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyformador_idTocur_formadores = + new com.evolute.entity.ForeignKey( CurAulasFormadores.class, CurAulasFormadores.FORMADOR_ID, db.data.siprp_local.outer.CurFormadoresData.class, db.data.siprp_local.outer.CurFormadoresData.ID ); + + public static final String TABLENAME = "cur_aulas_formadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_aulas_formadores"; + + public static final int _INVALID__INDEX = -1; + public static final String AULA_ID = "aula_id"; + public static final String AULA_ID_FULL = "cur_aulas_formadores.aula_id"; + public static final int AULA_ID_INDEX = 0; + public static final String TO_AULA_ID = "to_aula_id"; + public static final String TO_AULA_ID_FULL = "cur_aulas_formadores.to_aula_id"; + public static final int TO_AULA_ID_INDEX = 1; + public static final String FORMADOR_ID = "formador_id"; + public static final String FORMADOR_ID_FULL = "cur_aulas_formadores.formador_id"; + public static final int FORMADOR_ID_INDEX = 2; + public static final String TO_FORMADOR_ID = "to_formador_id"; + public static final String TO_FORMADOR_ID_FULL = "cur_aulas_formadores.to_formador_id"; + public static final int TO_FORMADOR_ID_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_aulas_formadores.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + AULA_ID, FORMADOR_ID, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + AULA_ID, FORMADOR_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + AULA_ID, FORMADOR_ID, DELETED_DATE, }; + + private Integer aula_id; + private db.data.siprp_local.outer.CurAulasData to_aula_id; + private Integer formador_id; + private db.data.siprp_local.outer.CurFormadoresData to_formador_id; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurAulasFormadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getAula_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AULA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.aula_id; + } + + public void setAula_id( Integer aula_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( AULA_ID, aula_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.aula_id = aula_id; + LAZY_LOADED_OBJECTS.put( AULA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurAulasData toAula_id() + { + try + { + prepare( TO_AULA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_aula_id; + } + + public void setToAula_id( db.data.siprp_local.outer.CurAulasData to_aula_id ) + { + try + { + preProcess( TO_AULA_ID, to_aula_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_aula_id = to_aula_id; + } + + public Integer getFormador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formador_id; + } + + public void setFormador_id( Integer formador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMADOR_ID, formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formador_id = formador_id; + LAZY_LOADED_OBJECTS.put( FORMADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormadoresData toFormador_id() + { + try + { + prepare( TO_FORMADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formador_id; + } + + public void setToFormador_id( db.data.siprp_local.outer.CurFormadoresData to_formador_id ) + { + try + { + preProcess( TO_FORMADOR_ID, to_formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formador_id = to_formador_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulasFormadores.AULA_ID_INDEX: + value = getAula_id(); + break; + case CurAulasFormadores.TO_AULA_ID_INDEX: + value = toAula_id(); + break; + case CurAulasFormadores.FORMADOR_ID_INDEX: + value = getFormador_id(); + break; + case CurAulasFormadores.TO_FORMADOR_ID_INDEX: + value = toFormador_id(); + break; + case CurAulasFormadores.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulasFormadores.AULA_ID_INDEX: + value = this.aula_id; + break; + case CurAulasFormadores.TO_AULA_ID_INDEX: + value = this.to_aula_id; + break; + case CurAulasFormadores.FORMADOR_ID_INDEX: + value = this.formador_id; + break; + case CurAulasFormadores.TO_FORMADOR_ID_INDEX: + value = this.to_formador_id; + break; + case CurAulasFormadores.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulasFormadores.AULA_ID_INDEX: + setAula_id( ( Integer ) value ); + break; + case CurAulasFormadores.TO_AULA_ID_INDEX: + setToAula_id( ( db.data.siprp_local.outer.CurAulasData ) value ); + break; + case CurAulasFormadores.FORMADOR_ID_INDEX: + setFormador_id( ( Integer ) value ); + break; + case CurAulasFormadores.TO_FORMADOR_ID_INDEX: + setToFormador_id( ( db.data.siprp_local.outer.CurFormadoresData ) value ); + break; + case CurAulasFormadores.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurAulasFormadores.AULA_ID_INDEX: + this.aula_id = ( Integer ) value; + break; + case CurAulasFormadores.TO_AULA_ID_INDEX: + this.to_aula_id = ( db.data.siprp_local.outer.CurAulasData ) value; + break; + case CurAulasFormadores.FORMADOR_ID_INDEX: + this.formador_id = ( Integer ) value; + break; + case CurAulasFormadores.TO_FORMADOR_ID_INDEX: + this.to_formador_id = ( db.data.siprp_local.outer.CurFormadoresData ) value; + break; + case CurAulasFormadores.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on CurAulasFormadores is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurAulasFormadores.AULA_ID_INDEX: + theClass = Integer.class; + break; + case CurAulasFormadores.TO_AULA_ID_INDEX: + theClass = db.data.siprp_local.outer.CurAulasData.class; + break; + case CurAulasFormadores.FORMADOR_ID_INDEX: + theClass = Integer.class; + break; + case CurAulasFormadores.TO_FORMADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormadoresData.class; + break; + case CurAulasFormadores.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurAulasFormadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurAulasFormadores.PK_FIELD_NAMES ); + primaryKey.set( 0, getAula_id() ); + primaryKey.set( 1, getFormador_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurCursos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurCursos.java new file mode 100644 index 00000000..6968bddb --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurCursos.java @@ -0,0 +1,1232 @@ +/* +* CurCursos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurCursos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurCursos.ID, CurCursos.ID_INDEX ); + FIELD_INDEXES.put( CurCursos.ID_FULL, CurCursos.ID_INDEX ); + FIELD_INDEXES.put( CurCursos.NOME, CurCursos.NOME_INDEX ); + FIELD_INDEXES.put( CurCursos.NOME_FULL, CurCursos.NOME_INDEX ); + FIELD_INDEXES.put( CurCursos.DATA, CurCursos.DATA_INDEX ); + FIELD_INDEXES.put( CurCursos.DATA_FULL, CurCursos.DATA_INDEX ); + FIELD_INDEXES.put( CurCursos.INICIO_HORA, CurCursos.INICIO_HORA_INDEX ); + FIELD_INDEXES.put( CurCursos.INICIO_HORA_FULL, CurCursos.INICIO_HORA_INDEX ); + FIELD_INDEXES.put( CurCursos.FIM_HORA, CurCursos.FIM_HORA_INDEX ); + FIELD_INDEXES.put( CurCursos.FIM_HORA_FULL, CurCursos.FIM_HORA_INDEX ); + FIELD_INDEXES.put( CurCursos.LIMITE_INSCRICOES, CurCursos.LIMITE_INSCRICOES_INDEX ); + FIELD_INDEXES.put( CurCursos.LIMITE_INSCRICOES_FULL, CurCursos.LIMITE_INSCRICOES_INDEX ); + FIELD_INDEXES.put( CurCursos.DELETED_DATE, CurCursos.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurCursos.DELETED_DATE_FULL, CurCursos.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurCursos.CODIGO_QUESTIONARIO_ANTES, CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX ); + FIELD_INDEXES.put( CurCursos.CODIGO_QUESTIONARIO_ANTES_FULL, CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX ); + FIELD_INDEXES.put( CurCursos.CODIGO_QUESTIONARIO_DURANTE, CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX ); + FIELD_INDEXES.put( CurCursos.CODIGO_QUESTIONARIO_DURANTE_FULL, CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX ); + FIELD_INDEXES.put( CurCursos.CODIGO_QUESTIONARIO_DEPOIS, CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX ); + FIELD_INDEXES.put( CurCursos.CODIGO_QUESTIONARIO_DEPOIS_FULL, CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX ); + FIELD_INDEXES.put( CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX ); + FIELD_INDEXES.put( CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_FULL, CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX ); + FIELD_INDEXES.put( CurCursos.ARCHIVED_DATE, CurCursos.ARCHIVED_DATE_INDEX ); + FIELD_INDEXES.put( CurCursos.ARCHIVED_DATE_FULL, CurCursos.ARCHIVED_DATE_INDEX ); + FIELD_INDEXES.put( CurCursos.PROFISSIONAL, CurCursos.PROFISSIONAL_INDEX ); + FIELD_INDEXES.put( CurCursos.PROFISSIONAL_FULL, CurCursos.PROFISSIONAL_INDEX ); + FIELD_INDEXES.put( CurCursos.FINANCIADO, CurCursos.FINANCIADO_INDEX ); + FIELD_INDEXES.put( CurCursos.FINANCIADO_FULL, CurCursos.FINANCIADO_INDEX ); + FIELD_INDEXES.put( CurCursos.VALOR, CurCursos.VALOR_INDEX ); + FIELD_INDEXES.put( CurCursos.VALOR_FULL, CurCursos.VALOR_INDEX ); + FIELD_INDEXES.put( CurCursos.RESPONSAVEL_ID, CurCursos.RESPONSAVEL_ID_INDEX ); + FIELD_INDEXES.put( CurCursos.RESPONSAVEL_ID_FULL, CurCursos.RESPONSAVEL_ID_INDEX ); + FIELD_INDEXES.put( CurCursos.DURACAO, CurCursos.DURACAO_INDEX ); + FIELD_INDEXES.put( CurCursos.DURACAO_FULL, CurCursos.DURACAO_INDEX ); + FIELD_INDEXES.put( CurCursos.LIVRO_REGISTO, CurCursos.LIVRO_REGISTO_INDEX ); + FIELD_INDEXES.put( CurCursos.LIVRO_REGISTO_FULL, CurCursos.LIVRO_REGISTO_INDEX ); + FIELD_INDEXES.put( CurCursos.LIVRO_NUMERO, CurCursos.LIVRO_NUMERO_INDEX ); + FIELD_INDEXES.put( CurCursos.LIVRO_NUMERO_FULL, CurCursos.LIVRO_NUMERO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_cursos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_cursos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_cursos.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "cur_cursos.nome"; + public static final int NOME_INDEX = 1; + public static final String DATA = "data"; + public static final String DATA_FULL = "cur_cursos.data"; + public static final int DATA_INDEX = 2; + public static final String INICIO_HORA = "inicio_hora"; + public static final String INICIO_HORA_FULL = "cur_cursos.inicio_hora"; + public static final int INICIO_HORA_INDEX = 3; + public static final String FIM_HORA = "fim_hora"; + public static final String FIM_HORA_FULL = "cur_cursos.fim_hora"; + public static final int FIM_HORA_INDEX = 4; + public static final String LIMITE_INSCRICOES = "limite_inscricoes"; + public static final String LIMITE_INSCRICOES_FULL = "cur_cursos.limite_inscricoes"; + public static final int LIMITE_INSCRICOES_INDEX = 5; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_cursos.deleted_date"; + public static final int DELETED_DATE_INDEX = 6; + public static final String CODIGO_QUESTIONARIO_ANTES = "codigo_questionario_antes"; + public static final String CODIGO_QUESTIONARIO_ANTES_FULL = "cur_cursos.codigo_questionario_antes"; + public static final int CODIGO_QUESTIONARIO_ANTES_INDEX = 7; + public static final String CODIGO_QUESTIONARIO_DURANTE = "codigo_questionario_durante"; + public static final String CODIGO_QUESTIONARIO_DURANTE_FULL = "cur_cursos.codigo_questionario_durante"; + public static final int CODIGO_QUESTIONARIO_DURANTE_INDEX = 8; + public static final String CODIGO_QUESTIONARIO_DEPOIS = "codigo_questionario_depois"; + public static final String CODIGO_QUESTIONARIO_DEPOIS_FULL = "cur_cursos.codigo_questionario_depois"; + public static final int CODIGO_QUESTIONARIO_DEPOIS_INDEX = 9; + public static final String AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID = "aut_impressao_pedido_sub_tipo_id"; + public static final String AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_FULL = "cur_cursos.aut_impressao_pedido_sub_tipo_id"; + public static final int AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX = 10; + public static final String ARCHIVED_DATE = "archived_date"; + public static final String ARCHIVED_DATE_FULL = "cur_cursos.archived_date"; + public static final int ARCHIVED_DATE_INDEX = 11; + public static final String PROFISSIONAL = "profissional"; + public static final String PROFISSIONAL_FULL = "cur_cursos.profissional"; + public static final int PROFISSIONAL_INDEX = 12; + public static final String FINANCIADO = "financiado"; + public static final String FINANCIADO_FULL = "cur_cursos.financiado"; + public static final int FINANCIADO_INDEX = 13; + public static final String VALOR = "valor"; + public static final String VALOR_FULL = "cur_cursos.valor"; + public static final int VALOR_INDEX = 14; + public static final String RESPONSAVEL_ID = "responsavel_id"; + public static final String RESPONSAVEL_ID_FULL = "cur_cursos.responsavel_id"; + public static final int RESPONSAVEL_ID_INDEX = 15; + public static final String DURACAO = "duracao"; + public static final String DURACAO_FULL = "cur_cursos.duracao"; + public static final int DURACAO_INDEX = 16; + public static final String LIVRO_REGISTO = "livro_registo"; + public static final String LIVRO_REGISTO_FULL = "cur_cursos.livro_registo"; + public static final int LIVRO_REGISTO_INDEX = 17; + public static final String LIVRO_NUMERO = "livro_numero"; + public static final String LIVRO_NUMERO_FULL = "cur_cursos.livro_numero"; + public static final int LIVRO_NUMERO_INDEX = 18; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, DATA, INICIO_HORA, FIM_HORA, LIMITE_INSCRICOES, DELETED_DATE, + CODIGO_QUESTIONARIO_ANTES, CODIGO_QUESTIONARIO_DURANTE, + CODIGO_QUESTIONARIO_DEPOIS, AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, + ARCHIVED_DATE, PROFISSIONAL, FINANCIADO, VALOR, RESPONSAVEL_ID, DURACAO, + LIVRO_REGISTO, LIVRO_NUMERO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + DATA, TABLENAME + "." + INICIO_HORA, TABLENAME + "." + FIM_HORA, TABLENAME + "." + LIMITE_INSCRICOES, TABLENAME + "." + DELETED_DATE, + TABLENAME + "." + CODIGO_QUESTIONARIO_ANTES, TABLENAME + "." + CODIGO_QUESTIONARIO_DURANTE, + TABLENAME + "." + CODIGO_QUESTIONARIO_DEPOIS, TABLENAME + "." + AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, + TABLENAME + "." + ARCHIVED_DATE, TABLENAME + "." + PROFISSIONAL, TABLENAME + "." + FINANCIADO, TABLENAME + "." + VALOR, TABLENAME + "." + RESPONSAVEL_ID, TABLENAME + "." + DURACAO, + TABLENAME + "." + LIVRO_REGISTO, TABLENAME + "." + LIVRO_NUMERO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, DATA, INICIO_HORA, FIM_HORA, LIMITE_INSCRICOES, DELETED_DATE, + CODIGO_QUESTIONARIO_ANTES, CODIGO_QUESTIONARIO_DURANTE, + CODIGO_QUESTIONARIO_DEPOIS, AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, + ARCHIVED_DATE, PROFISSIONAL, FINANCIADO, VALOR, RESPONSAVEL_ID, DURACAO, + LIVRO_REGISTO, LIVRO_NUMERO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, DATA, INICIO_HORA, FIM_HORA, LIMITE_INSCRICOES, DELETED_DATE, + CODIGO_QUESTIONARIO_ANTES, CODIGO_QUESTIONARIO_DURANTE, + CODIGO_QUESTIONARIO_DEPOIS, AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, + ARCHIVED_DATE, PROFISSIONAL, FINANCIADO, VALOR, RESPONSAVEL_ID, DURACAO, + LIVRO_REGISTO, LIVRO_NUMERO, }; + + private Integer id; + private String nome; + private java.util.Date data; + private java.sql.Time inicio_hora; + private java.sql.Time fim_hora; + private Integer limite_inscricoes; + private java.sql.Timestamp deleted_date; + private String codigo_questionario_antes; + private String codigo_questionario_durante; + private String codigo_questionario_depois; + private Integer aut_impressao_pedido_sub_tipo_id; + private java.sql.Timestamp archived_date; + private Boolean profissional; + private Boolean financiado; + private Double valor; + private Integer responsavel_id; + private String duracao; + private String livro_registo; + private String livro_numero; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurCursos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurDias_curso_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurDiasData.class , getPrimaryKey().getMap().get("id"), "curso_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurFormadoresCursos_curso_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurFormadoresCursosData.class , getPrimaryKey().getMap().get("id"), "curso_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurFormandosCursos_curso_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurFormandosCursosData.class , getPrimaryKey().getMap().get("id"), "curso_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurPagamentos_curso_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurPagamentosData.class , getPrimaryKey().getMap().get("id"), "curso_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurPresencas_curso_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurPresencasData.class , getPrimaryKey().getMap().get("id"), "curso_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurTopicos_curso_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurTopicosData.class , getPrimaryKey().getMap().get("id"), "curso_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public java.sql.Time getInicio_hora() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INICIO_HORA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inicio_hora; + } + + public void setInicio_hora( java.sql.Time inicio_hora ) + { + try + { + setLockedForRefresh( true ); + preProcess( INICIO_HORA, inicio_hora ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inicio_hora = inicio_hora; + LAZY_LOADED_OBJECTS.put( INICIO_HORA, Boolean.TRUE ); + } + + public java.sql.Time getFim_hora() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FIM_HORA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fim_hora; + } + + public void setFim_hora( java.sql.Time fim_hora ) + { + try + { + setLockedForRefresh( true ); + preProcess( FIM_HORA, fim_hora ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fim_hora = fim_hora; + LAZY_LOADED_OBJECTS.put( FIM_HORA, Boolean.TRUE ); + } + + public Integer getLimite_inscricoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LIMITE_INSCRICOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.limite_inscricoes; + } + + public void setLimite_inscricoes( Integer limite_inscricoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( LIMITE_INSCRICOES, limite_inscricoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.limite_inscricoes = limite_inscricoes; + LAZY_LOADED_OBJECTS.put( LIMITE_INSCRICOES, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public String getCodigo_questionario_antes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_QUESTIONARIO_ANTES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_questionario_antes; + } + + public void setCodigo_questionario_antes( String codigo_questionario_antes ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_QUESTIONARIO_ANTES, codigo_questionario_antes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_questionario_antes = codigo_questionario_antes; + LAZY_LOADED_OBJECTS.put( CODIGO_QUESTIONARIO_ANTES, Boolean.TRUE ); + } + + public String getCodigo_questionario_durante() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_QUESTIONARIO_DURANTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_questionario_durante; + } + + public void setCodigo_questionario_durante( String codigo_questionario_durante ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_QUESTIONARIO_DURANTE, codigo_questionario_durante ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_questionario_durante = codigo_questionario_durante; + LAZY_LOADED_OBJECTS.put( CODIGO_QUESTIONARIO_DURANTE, Boolean.TRUE ); + } + + public String getCodigo_questionario_depois() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_QUESTIONARIO_DEPOIS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_questionario_depois; + } + + public void setCodigo_questionario_depois( String codigo_questionario_depois ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_QUESTIONARIO_DEPOIS, codigo_questionario_depois ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_questionario_depois = codigo_questionario_depois; + LAZY_LOADED_OBJECTS.put( CODIGO_QUESTIONARIO_DEPOIS, Boolean.TRUE ); + } + + public Integer getAut_impressao_pedido_sub_tipo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.aut_impressao_pedido_sub_tipo_id; + } + + public void setAut_impressao_pedido_sub_tipo_id( Integer aut_impressao_pedido_sub_tipo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, aut_impressao_pedido_sub_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.aut_impressao_pedido_sub_tipo_id = aut_impressao_pedido_sub_tipo_id; + LAZY_LOADED_OBJECTS.put( AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getArchived_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ARCHIVED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.archived_date; + } + + public void setArchived_date( java.sql.Timestamp archived_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( ARCHIVED_DATE, archived_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.archived_date = archived_date; + LAZY_LOADED_OBJECTS.put( ARCHIVED_DATE, Boolean.TRUE ); + } + + public Boolean getProfissional() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROFISSIONAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.profissional; + } + + public void setProfissional( Boolean profissional ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROFISSIONAL, profissional ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.profissional = profissional; + LAZY_LOADED_OBJECTS.put( PROFISSIONAL, Boolean.TRUE ); + } + + public Boolean getFinanciado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FINANCIADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.financiado; + } + + public void setFinanciado( Boolean financiado ) + { + try + { + setLockedForRefresh( true ); + preProcess( FINANCIADO, financiado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.financiado = financiado; + LAZY_LOADED_OBJECTS.put( FINANCIADO, Boolean.TRUE ); + } + + public Double getValor() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor; + } + + public void setValor( Double valor ) + { + try + { + setLockedForRefresh( true ); + preProcess( VALOR, valor ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor = valor; + LAZY_LOADED_OBJECTS.put( VALOR, Boolean.TRUE ); + } + + public Integer getResponsavel_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESPONSAVEL_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.responsavel_id; + } + + public void setResponsavel_id( Integer responsavel_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RESPONSAVEL_ID, responsavel_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.responsavel_id = responsavel_id; + LAZY_LOADED_OBJECTS.put( RESPONSAVEL_ID, Boolean.TRUE ); + } + + public String getDuracao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DURACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.duracao; + } + + public void setDuracao( String duracao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DURACAO, duracao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.duracao = duracao; + LAZY_LOADED_OBJECTS.put( DURACAO, Boolean.TRUE ); + } + + public String getLivro_registo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LIVRO_REGISTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.livro_registo; + } + + public void setLivro_registo( String livro_registo ) + { + try + { + setLockedForRefresh( true ); + preProcess( LIVRO_REGISTO, livro_registo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.livro_registo = livro_registo; + LAZY_LOADED_OBJECTS.put( LIVRO_REGISTO, Boolean.TRUE ); + } + + public String getLivro_numero() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LIVRO_NUMERO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.livro_numero; + } + + public void setLivro_numero( String livro_numero ) + { + try + { + setLockedForRefresh( true ); + preProcess( LIVRO_NUMERO, livro_numero ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.livro_numero = livro_numero; + LAZY_LOADED_OBJECTS.put( LIVRO_NUMERO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurCursos.ID_INDEX: + value = getId(); + break; + case CurCursos.NOME_INDEX: + value = getNome(); + break; + case CurCursos.DATA_INDEX: + value = getData(); + break; + case CurCursos.INICIO_HORA_INDEX: + value = getInicio_hora(); + break; + case CurCursos.FIM_HORA_INDEX: + value = getFim_hora(); + break; + case CurCursos.LIMITE_INSCRICOES_INDEX: + value = getLimite_inscricoes(); + break; + case CurCursos.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX: + value = getCodigo_questionario_antes(); + break; + case CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX: + value = getCodigo_questionario_durante(); + break; + case CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX: + value = getCodigo_questionario_depois(); + break; + case CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX: + value = getAut_impressao_pedido_sub_tipo_id(); + break; + case CurCursos.ARCHIVED_DATE_INDEX: + value = getArchived_date(); + break; + case CurCursos.PROFISSIONAL_INDEX: + value = getProfissional(); + break; + case CurCursos.FINANCIADO_INDEX: + value = getFinanciado(); + break; + case CurCursos.VALOR_INDEX: + value = getValor(); + break; + case CurCursos.RESPONSAVEL_ID_INDEX: + value = getResponsavel_id(); + break; + case CurCursos.DURACAO_INDEX: + value = getDuracao(); + break; + case CurCursos.LIVRO_REGISTO_INDEX: + value = getLivro_registo(); + break; + case CurCursos.LIVRO_NUMERO_INDEX: + value = getLivro_numero(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurCursos.ID_INDEX: + value = this.id; + break; + case CurCursos.NOME_INDEX: + value = this.nome; + break; + case CurCursos.DATA_INDEX: + value = this.data; + break; + case CurCursos.INICIO_HORA_INDEX: + value = this.inicio_hora; + break; + case CurCursos.FIM_HORA_INDEX: + value = this.fim_hora; + break; + case CurCursos.LIMITE_INSCRICOES_INDEX: + value = this.limite_inscricoes; + break; + case CurCursos.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX: + value = this.codigo_questionario_antes; + break; + case CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX: + value = this.codigo_questionario_durante; + break; + case CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX: + value = this.codigo_questionario_depois; + break; + case CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX: + value = this.aut_impressao_pedido_sub_tipo_id; + break; + case CurCursos.ARCHIVED_DATE_INDEX: + value = this.archived_date; + break; + case CurCursos.PROFISSIONAL_INDEX: + value = this.profissional; + break; + case CurCursos.FINANCIADO_INDEX: + value = this.financiado; + break; + case CurCursos.VALOR_INDEX: + value = this.valor; + break; + case CurCursos.RESPONSAVEL_ID_INDEX: + value = this.responsavel_id; + break; + case CurCursos.DURACAO_INDEX: + value = this.duracao; + break; + case CurCursos.LIVRO_REGISTO_INDEX: + value = this.livro_registo; + break; + case CurCursos.LIVRO_NUMERO_INDEX: + value = this.livro_numero; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurCursos.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurCursos.NOME_INDEX: + setNome( ( String ) value ); + break; + case CurCursos.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case CurCursos.INICIO_HORA_INDEX: + setInicio_hora( ( java.sql.Time ) value ); + break; + case CurCursos.FIM_HORA_INDEX: + setFim_hora( ( java.sql.Time ) value ); + break; + case CurCursos.LIMITE_INSCRICOES_INDEX: + setLimite_inscricoes( ( Integer ) value ); + break; + case CurCursos.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX: + setCodigo_questionario_antes( ( String ) value ); + break; + case CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX: + setCodigo_questionario_durante( ( String ) value ); + break; + case CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX: + setCodigo_questionario_depois( ( String ) value ); + break; + case CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX: + setAut_impressao_pedido_sub_tipo_id( ( Integer ) value ); + break; + case CurCursos.ARCHIVED_DATE_INDEX: + setArchived_date( ( java.sql.Timestamp ) value ); + break; + case CurCursos.PROFISSIONAL_INDEX: + setProfissional( ( Boolean ) value ); + break; + case CurCursos.FINANCIADO_INDEX: + setFinanciado( ( Boolean ) value ); + break; + case CurCursos.VALOR_INDEX: + setValor( ( Double ) value ); + break; + case CurCursos.RESPONSAVEL_ID_INDEX: + setResponsavel_id( ( Integer ) value ); + break; + case CurCursos.DURACAO_INDEX: + setDuracao( ( String ) value ); + break; + case CurCursos.LIVRO_REGISTO_INDEX: + setLivro_registo( ( String ) value ); + break; + case CurCursos.LIVRO_NUMERO_INDEX: + setLivro_numero( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurCursos.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurCursos.NOME_INDEX: + this.nome = ( String ) value; + break; + case CurCursos.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case CurCursos.INICIO_HORA_INDEX: + this.inicio_hora = ( java.sql.Time ) value; + break; + case CurCursos.FIM_HORA_INDEX: + this.fim_hora = ( java.sql.Time ) value; + break; + case CurCursos.LIMITE_INSCRICOES_INDEX: + this.limite_inscricoes = ( Integer ) value; + break; + case CurCursos.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX: + this.codigo_questionario_antes = ( String ) value; + break; + case CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX: + this.codigo_questionario_durante = ( String ) value; + break; + case CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX: + this.codigo_questionario_depois = ( String ) value; + break; + case CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX: + this.aut_impressao_pedido_sub_tipo_id = ( Integer ) value; + break; + case CurCursos.ARCHIVED_DATE_INDEX: + this.archived_date = ( java.sql.Timestamp ) value; + break; + case CurCursos.PROFISSIONAL_INDEX: + this.profissional = ( Boolean ) value; + break; + case CurCursos.FINANCIADO_INDEX: + this.financiado = ( Boolean ) value; + break; + case CurCursos.VALOR_INDEX: + this.valor = ( Double ) value; + break; + case CurCursos.RESPONSAVEL_ID_INDEX: + this.responsavel_id = ( Integer ) value; + break; + case CurCursos.DURACAO_INDEX: + this.duracao = ( String ) value; + break; + case CurCursos.LIVRO_REGISTO_INDEX: + this.livro_registo = ( String ) value; + break; + case CurCursos.LIVRO_NUMERO_INDEX: + this.livro_numero = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurCursos.ID_INDEX: + theClass = Integer.class; + break; + case CurCursos.NOME_INDEX: + theClass = String.class; + break; + case CurCursos.DATA_INDEX: + theClass = java.util.Date.class; + break; + case CurCursos.INICIO_HORA_INDEX: + theClass = java.sql.Time.class; + break; + case CurCursos.FIM_HORA_INDEX: + theClass = java.sql.Time.class; + break; + case CurCursos.LIMITE_INSCRICOES_INDEX: + theClass = Integer.class; + break; + case CurCursos.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurCursos.CODIGO_QUESTIONARIO_ANTES_INDEX: + theClass = String.class; + break; + case CurCursos.CODIGO_QUESTIONARIO_DURANTE_INDEX: + theClass = String.class; + break; + case CurCursos.CODIGO_QUESTIONARIO_DEPOIS_INDEX: + theClass = String.class; + break; + case CurCursos.AUT_IMPRESSAO_PEDIDO_SUB_TIPO_ID_INDEX: + theClass = Integer.class; + break; + case CurCursos.ARCHIVED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurCursos.PROFISSIONAL_INDEX: + theClass = Boolean.class; + break; + case CurCursos.FINANCIADO_INDEX: + theClass = Boolean.class; + break; + case CurCursos.VALOR_INDEX: + theClass = Double.class; + break; + case CurCursos.RESPONSAVEL_ID_INDEX: + theClass = Integer.class; + break; + case CurCursos.DURACAO_INDEX: + theClass = String.class; + break; + case CurCursos.LIVRO_REGISTO_INDEX: + theClass = String.class; + break; + case CurCursos.LIVRO_NUMERO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurCursos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurCursos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurDias.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurDias.java new file mode 100644 index 00000000..c7198d9a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurDias.java @@ -0,0 +1,445 @@ +/* +* CurDias.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurDias extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurDias.ID, CurDias.ID_INDEX ); + FIELD_INDEXES.put( CurDias.ID_FULL, CurDias.ID_INDEX ); + FIELD_INDEXES.put( CurDias.DIA_DATE, CurDias.DIA_DATE_INDEX ); + FIELD_INDEXES.put( CurDias.DIA_DATE_FULL, CurDias.DIA_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurDias.CLASS_IDENTIFIER, CurDias.CURSO_ID, CurDias.TO_CURSO_ID ); + FIELD_INDEXES.put( CurDias.CURSO_ID, CurDias.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurDias.CURSO_ID_FULL, CurDias.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurDias.TO_CURSO_ID, CurDias.TO_CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurDias.DELETED_DATE, CurDias.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurDias.DELETED_DATE_FULL, CurDias.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeycurso_idTocur_cursos = + new com.evolute.entity.ForeignKey( CurDias.class, CurDias.CURSO_ID, db.data.siprp_local.outer.CurCursosData.class, db.data.siprp_local.outer.CurCursosData.ID ); + + public static final String TABLENAME = "cur_dias"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_dias"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_dias.id"; + public static final int ID_INDEX = 0; + public static final String DIA_DATE = "dia_date"; + public static final String DIA_DATE_FULL = "cur_dias.dia_date"; + public static final int DIA_DATE_INDEX = 1; + public static final String CURSO_ID = "curso_id"; + public static final String CURSO_ID_FULL = "cur_dias.curso_id"; + public static final int CURSO_ID_INDEX = 2; + public static final String TO_CURSO_ID = "to_curso_id"; + public static final String TO_CURSO_ID_FULL = "cur_dias.to_curso_id"; + public static final int TO_CURSO_ID_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_dias.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DIA_DATE, CURSO_ID, TO_CURSO_ID, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DIA_DATE, TABLENAME + "." + CURSO_ID, TABLENAME + "." + TO_CURSO_ID, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DIA_DATE, CURSO_ID, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DIA_DATE, CURSO_ID, DELETED_DATE, }; + + private Integer id; + private java.util.Date dia_date; + private Integer curso_id; + private db.data.siprp_local.outer.CurCursosData to_curso_id; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurDias() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurAulas_cur_dia_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurAulasData.class , getPrimaryKey().getMap().get("id"), "cur_dia_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getDia_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DIA_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.dia_date; + } + + public void setDia_date( java.util.Date dia_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DIA_DATE, dia_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.dia_date = dia_date; + LAZY_LOADED_OBJECTS.put( DIA_DATE, Boolean.TRUE ); + } + + public Integer getCurso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.curso_id; + } + + public void setCurso_id( Integer curso_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURSO_ID, curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.curso_id = curso_id; + LAZY_LOADED_OBJECTS.put( CURSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurCursosData toCurso_id() + { + try + { + prepare( TO_CURSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_curso_id; + } + + public void setToCurso_id( db.data.siprp_local.outer.CurCursosData to_curso_id ) + { + try + { + preProcess( TO_CURSO_ID, to_curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_curso_id = to_curso_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurDias.ID_INDEX: + value = getId(); + break; + case CurDias.DIA_DATE_INDEX: + value = getDia_date(); + break; + case CurDias.CURSO_ID_INDEX: + value = getCurso_id(); + break; + case CurDias.TO_CURSO_ID_INDEX: + value = toCurso_id(); + break; + case CurDias.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurDias.ID_INDEX: + value = this.id; + break; + case CurDias.DIA_DATE_INDEX: + value = this.dia_date; + break; + case CurDias.CURSO_ID_INDEX: + value = this.curso_id; + break; + case CurDias.TO_CURSO_ID_INDEX: + value = this.to_curso_id; + break; + case CurDias.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurDias.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurDias.DIA_DATE_INDEX: + setDia_date( ( java.util.Date ) value ); + break; + case CurDias.CURSO_ID_INDEX: + setCurso_id( ( Integer ) value ); + break; + case CurDias.TO_CURSO_ID_INDEX: + setToCurso_id( ( db.data.siprp_local.outer.CurCursosData ) value ); + break; + case CurDias.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurDias.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurDias.DIA_DATE_INDEX: + this.dia_date = ( java.util.Date ) value; + break; + case CurDias.CURSO_ID_INDEX: + this.curso_id = ( Integer ) value; + break; + case CurDias.TO_CURSO_ID_INDEX: + this.to_curso_id = ( db.data.siprp_local.outer.CurCursosData ) value; + break; + case CurDias.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurDias.ID_INDEX: + theClass = Integer.class; + break; + case CurDias.DIA_DATE_INDEX: + theClass = java.util.Date.class; + break; + case CurDias.CURSO_ID_INDEX: + theClass = Integer.class; + break; + case CurDias.TO_CURSO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurCursosData.class; + break; + case CurDias.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurDias._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurDias.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormadores.java new file mode 100644 index 00000000..c629697e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormadores.java @@ -0,0 +1,587 @@ +/* +* CurFormadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurFormadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurFormadores.ID, CurFormadores.ID_INDEX ); + FIELD_INDEXES.put( CurFormadores.ID_FULL, CurFormadores.ID_INDEX ); + FIELD_INDEXES.put( CurFormadores.DADOS_PESSOAS_ID, CurFormadores.DADOS_PESSOAS_ID_INDEX ); + FIELD_INDEXES.put( CurFormadores.DADOS_PESSOAS_ID_FULL, CurFormadores.DADOS_PESSOAS_ID_INDEX ); + FIELD_INDEXES.put( CurFormadores.DELETED_DATE, CurFormadores.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurFormadores.DELETED_DATE_FULL, CurFormadores.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurFormadores.NOME_PROFISSIONAL, CurFormadores.NOME_PROFISSIONAL_INDEX ); + FIELD_INDEXES.put( CurFormadores.NOME_PROFISSIONAL_FULL, CurFormadores.NOME_PROFISSIONAL_INDEX ); + FIELD_INDEXES.put( CurFormadores.HABILITACAO, CurFormadores.HABILITACAO_INDEX ); + FIELD_INDEXES.put( CurFormadores.HABILITACAO_FULL, CurFormadores.HABILITACAO_INDEX ); + FIELD_INDEXES.put( CurFormadores.CAP, CurFormadores.CAP_INDEX ); + FIELD_INDEXES.put( CurFormadores.CAP_FULL, CurFormadores.CAP_INDEX ); + FIELD_INDEXES.put( CurFormadores.CAP_TSHST, CurFormadores.CAP_TSHST_INDEX ); + FIELD_INDEXES.put( CurFormadores.CAP_TSHST_FULL, CurFormadores.CAP_TSHST_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_formadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_formadores"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_formadores.id"; + public static final int ID_INDEX = 0; + public static final String DADOS_PESSOAS_ID = "dados_pessoas_id"; + public static final String DADOS_PESSOAS_ID_FULL = "cur_formadores.dados_pessoas_id"; + public static final int DADOS_PESSOAS_ID_INDEX = 1; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_formadores.deleted_date"; + public static final int DELETED_DATE_INDEX = 2; + public static final String NOME_PROFISSIONAL = "nome_profissional"; + public static final String NOME_PROFISSIONAL_FULL = "cur_formadores.nome_profissional"; + public static final int NOME_PROFISSIONAL_INDEX = 3; + public static final String HABILITACAO = "habilitacao"; + public static final String HABILITACAO_FULL = "cur_formadores.habilitacao"; + public static final int HABILITACAO_INDEX = 4; + public static final String CAP = "cap"; + public static final String CAP_FULL = "cur_formadores.cap"; + public static final int CAP_INDEX = 5; + public static final String CAP_TSHST = "cap_tshst"; + public static final String CAP_TSHST_FULL = "cur_formadores.cap_tshst"; + public static final int CAP_TSHST_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DADOS_PESSOAS_ID, DELETED_DATE, NOME_PROFISSIONAL, HABILITACAO, CAP, CAP_TSHST, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DADOS_PESSOAS_ID, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + NOME_PROFISSIONAL, TABLENAME + "." + HABILITACAO, TABLENAME + "." + CAP, TABLENAME + "." + CAP_TSHST, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DADOS_PESSOAS_ID, DELETED_DATE, NOME_PROFISSIONAL, HABILITACAO, CAP, CAP_TSHST, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DADOS_PESSOAS_ID, DELETED_DATE, NOME_PROFISSIONAL, HABILITACAO, CAP, CAP_TSHST, }; + + private Integer id; + private Integer dados_pessoas_id; + private java.sql.Timestamp deleted_date; + private String nome_profissional; + private String habilitacao; + private String cap; + private String cap_tshst; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurFormadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurAulasFormadores_formador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurAulasFormadoresData.class , getPrimaryKey().getMap().get("id"), "formador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurFormadoresCursos_formador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurFormadoresCursosData.class , getPrimaryKey().getMap().get("id"), "formador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurPresencas_formador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurPresencasData.class , getPrimaryKey().getMap().get("id"), "formador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurTopicos_formador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurTopicosData.class , getPrimaryKey().getMap().get("id"), "formador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getDados_pessoas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DADOS_PESSOAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.dados_pessoas_id; + } + + public void setDados_pessoas_id( Integer dados_pessoas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( DADOS_PESSOAS_ID, dados_pessoas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.dados_pessoas_id = dados_pessoas_id; + LAZY_LOADED_OBJECTS.put( DADOS_PESSOAS_ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public String getNome_profissional() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_PROFISSIONAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_profissional; + } + + public void setNome_profissional( String nome_profissional ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME_PROFISSIONAL, nome_profissional ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_profissional = nome_profissional; + LAZY_LOADED_OBJECTS.put( NOME_PROFISSIONAL, Boolean.TRUE ); + } + + public String getHabilitacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HABILITACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.habilitacao; + } + + public void setHabilitacao( String habilitacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( HABILITACAO, habilitacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.habilitacao = habilitacao; + LAZY_LOADED_OBJECTS.put( HABILITACAO, Boolean.TRUE ); + } + + public String getCap() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cap; + } + + public void setCap( String cap ) + { + try + { + setLockedForRefresh( true ); + preProcess( CAP, cap ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cap = cap; + LAZY_LOADED_OBJECTS.put( CAP, Boolean.TRUE ); + } + + public String getCap_tshst() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAP_TSHST ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cap_tshst; + } + + public void setCap_tshst( String cap_tshst ) + { + try + { + setLockedForRefresh( true ); + preProcess( CAP_TSHST, cap_tshst ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cap_tshst = cap_tshst; + LAZY_LOADED_OBJECTS.put( CAP_TSHST, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadores.ID_INDEX: + value = getId(); + break; + case CurFormadores.DADOS_PESSOAS_ID_INDEX: + value = getDados_pessoas_id(); + break; + case CurFormadores.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case CurFormadores.NOME_PROFISSIONAL_INDEX: + value = getNome_profissional(); + break; + case CurFormadores.HABILITACAO_INDEX: + value = getHabilitacao(); + break; + case CurFormadores.CAP_INDEX: + value = getCap(); + break; + case CurFormadores.CAP_TSHST_INDEX: + value = getCap_tshst(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadores.ID_INDEX: + value = this.id; + break; + case CurFormadores.DADOS_PESSOAS_ID_INDEX: + value = this.dados_pessoas_id; + break; + case CurFormadores.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case CurFormadores.NOME_PROFISSIONAL_INDEX: + value = this.nome_profissional; + break; + case CurFormadores.HABILITACAO_INDEX: + value = this.habilitacao; + break; + case CurFormadores.CAP_INDEX: + value = this.cap; + break; + case CurFormadores.CAP_TSHST_INDEX: + value = this.cap_tshst; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadores.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurFormadores.DADOS_PESSOAS_ID_INDEX: + setDados_pessoas_id( ( Integer ) value ); + break; + case CurFormadores.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case CurFormadores.NOME_PROFISSIONAL_INDEX: + setNome_profissional( ( String ) value ); + break; + case CurFormadores.HABILITACAO_INDEX: + setHabilitacao( ( String ) value ); + break; + case CurFormadores.CAP_INDEX: + setCap( ( String ) value ); + break; + case CurFormadores.CAP_TSHST_INDEX: + setCap_tshst( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadores.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurFormadores.DADOS_PESSOAS_ID_INDEX: + this.dados_pessoas_id = ( Integer ) value; + break; + case CurFormadores.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case CurFormadores.NOME_PROFISSIONAL_INDEX: + this.nome_profissional = ( String ) value; + break; + case CurFormadores.HABILITACAO_INDEX: + this.habilitacao = ( String ) value; + break; + case CurFormadores.CAP_INDEX: + this.cap = ( String ) value; + break; + case CurFormadores.CAP_TSHST_INDEX: + this.cap_tshst = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurFormadores.ID_INDEX: + theClass = Integer.class; + break; + case CurFormadores.DADOS_PESSOAS_ID_INDEX: + theClass = Integer.class; + break; + case CurFormadores.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurFormadores.NOME_PROFISSIONAL_INDEX: + theClass = String.class; + break; + case CurFormadores.HABILITACAO_INDEX: + theClass = String.class; + break; + case CurFormadores.CAP_INDEX: + theClass = String.class; + break; + case CurFormadores.CAP_TSHST_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurFormadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurFormadores.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormadoresCursos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormadoresCursos.java new file mode 100644 index 00000000..9a4824d0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormadoresCursos.java @@ -0,0 +1,481 @@ +/* +* CurFormadoresCursos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurFormadoresCursos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( CurFormadoresCursos.CLASS_IDENTIFIER, CurFormadoresCursos.FORMADOR_ID, CurFormadoresCursos.TO_FORMADOR_ID ); + FIELD_INDEXES.put( CurFormadoresCursos.FORMADOR_ID, CurFormadoresCursos.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.FORMADOR_ID_FULL, CurFormadoresCursos.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.TO_FORMADOR_ID, CurFormadoresCursos.TO_FORMADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurFormadoresCursos.CLASS_IDENTIFIER, CurFormadoresCursos.CURSO_ID, CurFormadoresCursos.TO_CURSO_ID ); + FIELD_INDEXES.put( CurFormadoresCursos.CURSO_ID, CurFormadoresCursos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.CURSO_ID_FULL, CurFormadoresCursos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.TO_CURSO_ID, CurFormadoresCursos.TO_CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.HORAS, CurFormadoresCursos.HORAS_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.HORAS_FULL, CurFormadoresCursos.HORAS_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.NUMERO_CERTIFICADO, CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX ); + FIELD_INDEXES.put( CurFormadoresCursos.NUMERO_CERTIFICADO_FULL, CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyformador_idTocur_formadores = + new com.evolute.entity.ForeignKey( CurFormadoresCursos.class, CurFormadoresCursos.FORMADOR_ID, db.data.siprp_local.outer.CurFormadoresData.class, db.data.siprp_local.outer.CurFormadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycurso_idTocur_cursos = + new com.evolute.entity.ForeignKey( CurFormadoresCursos.class, CurFormadoresCursos.CURSO_ID, db.data.siprp_local.outer.CurCursosData.class, db.data.siprp_local.outer.CurCursosData.ID ); + + public static final String TABLENAME = "cur_formadores_cursos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_formadores_cursos"; + + public static final int _INVALID__INDEX = -1; + public static final String FORMADOR_ID = "formador_id"; + public static final String FORMADOR_ID_FULL = "cur_formadores_cursos.formador_id"; + public static final int FORMADOR_ID_INDEX = 0; + public static final String TO_FORMADOR_ID = "to_formador_id"; + public static final String TO_FORMADOR_ID_FULL = "cur_formadores_cursos.to_formador_id"; + public static final int TO_FORMADOR_ID_INDEX = 1; + public static final String CURSO_ID = "curso_id"; + public static final String CURSO_ID_FULL = "cur_formadores_cursos.curso_id"; + public static final int CURSO_ID_INDEX = 2; + public static final String TO_CURSO_ID = "to_curso_id"; + public static final String TO_CURSO_ID_FULL = "cur_formadores_cursos.to_curso_id"; + public static final int TO_CURSO_ID_INDEX = 3; + public static final String HORAS = "horas"; + public static final String HORAS_FULL = "cur_formadores_cursos.horas"; + public static final int HORAS_INDEX = 4; + public static final String NUMERO_CERTIFICADO = "numero_certificado"; + public static final String NUMERO_CERTIFICADO_FULL = "cur_formadores_cursos.numero_certificado"; + public static final int NUMERO_CERTIFICADO_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + HORAS, NUMERO_CERTIFICADO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + HORAS, TABLENAME + "." + NUMERO_CERTIFICADO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + FORMADOR_ID, CURSO_ID, HORAS, NUMERO_CERTIFICADO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + FORMADOR_ID, CURSO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + FORMADOR_ID, CURSO_ID, HORAS, NUMERO_CERTIFICADO, }; + + private Integer formador_id; + private db.data.siprp_local.outer.CurFormadoresData to_formador_id; + private Integer curso_id; + private db.data.siprp_local.outer.CurCursosData to_curso_id; + private Integer horas; + private Integer numero_certificado; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurFormadoresCursos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false }; + } + + public Integer getFormador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formador_id; + } + + public void setFormador_id( Integer formador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMADOR_ID, formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formador_id = formador_id; + LAZY_LOADED_OBJECTS.put( FORMADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormadoresData toFormador_id() + { + try + { + prepare( TO_FORMADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formador_id; + } + + public void setToFormador_id( db.data.siprp_local.outer.CurFormadoresData to_formador_id ) + { + try + { + preProcess( TO_FORMADOR_ID, to_formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formador_id = to_formador_id; + } + + public Integer getCurso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.curso_id; + } + + public void setCurso_id( Integer curso_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURSO_ID, curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.curso_id = curso_id; + LAZY_LOADED_OBJECTS.put( CURSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurCursosData toCurso_id() + { + try + { + prepare( TO_CURSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_curso_id; + } + + public void setToCurso_id( db.data.siprp_local.outer.CurCursosData to_curso_id ) + { + try + { + preProcess( TO_CURSO_ID, to_curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_curso_id = to_curso_id; + } + + public Integer getHoras() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HORAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.horas; + } + + public void setHoras( Integer horas ) + { + try + { + setLockedForRefresh( true ); + preProcess( HORAS, horas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.horas = horas; + LAZY_LOADED_OBJECTS.put( HORAS, Boolean.TRUE ); + } + + public Integer getNumero_certificado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_CERTIFICADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_certificado; + } + + public void setNumero_certificado( Integer numero_certificado ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_CERTIFICADO, numero_certificado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_certificado = numero_certificado; + LAZY_LOADED_OBJECTS.put( NUMERO_CERTIFICADO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadoresCursos.FORMADOR_ID_INDEX: + value = getFormador_id(); + break; + case CurFormadoresCursos.TO_FORMADOR_ID_INDEX: + value = toFormador_id(); + break; + case CurFormadoresCursos.CURSO_ID_INDEX: + value = getCurso_id(); + break; + case CurFormadoresCursos.TO_CURSO_ID_INDEX: + value = toCurso_id(); + break; + case CurFormadoresCursos.HORAS_INDEX: + value = getHoras(); + break; + case CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX: + value = getNumero_certificado(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadoresCursos.FORMADOR_ID_INDEX: + value = this.formador_id; + break; + case CurFormadoresCursos.TO_FORMADOR_ID_INDEX: + value = this.to_formador_id; + break; + case CurFormadoresCursos.CURSO_ID_INDEX: + value = this.curso_id; + break; + case CurFormadoresCursos.TO_CURSO_ID_INDEX: + value = this.to_curso_id; + break; + case CurFormadoresCursos.HORAS_INDEX: + value = this.horas; + break; + case CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX: + value = this.numero_certificado; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadoresCursos.FORMADOR_ID_INDEX: + setFormador_id( ( Integer ) value ); + break; + case CurFormadoresCursos.TO_FORMADOR_ID_INDEX: + setToFormador_id( ( db.data.siprp_local.outer.CurFormadoresData ) value ); + break; + case CurFormadoresCursos.CURSO_ID_INDEX: + setCurso_id( ( Integer ) value ); + break; + case CurFormadoresCursos.TO_CURSO_ID_INDEX: + setToCurso_id( ( db.data.siprp_local.outer.CurCursosData ) value ); + break; + case CurFormadoresCursos.HORAS_INDEX: + setHoras( ( Integer ) value ); + break; + case CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX: + setNumero_certificado( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormadoresCursos.FORMADOR_ID_INDEX: + this.formador_id = ( Integer ) value; + break; + case CurFormadoresCursos.TO_FORMADOR_ID_INDEX: + this.to_formador_id = ( db.data.siprp_local.outer.CurFormadoresData ) value; + break; + case CurFormadoresCursos.CURSO_ID_INDEX: + this.curso_id = ( Integer ) value; + break; + case CurFormadoresCursos.TO_CURSO_ID_INDEX: + this.to_curso_id = ( db.data.siprp_local.outer.CurCursosData ) value; + break; + case CurFormadoresCursos.HORAS_INDEX: + this.horas = ( Integer ) value; + break; + case CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX: + this.numero_certificado = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on CurFormadoresCursos is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurFormadoresCursos.FORMADOR_ID_INDEX: + theClass = Integer.class; + break; + case CurFormadoresCursos.TO_FORMADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormadoresData.class; + break; + case CurFormadoresCursos.CURSO_ID_INDEX: + theClass = Integer.class; + break; + case CurFormadoresCursos.TO_CURSO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurCursosData.class; + break; + case CurFormadoresCursos.HORAS_INDEX: + theClass = Integer.class; + break; + case CurFormadoresCursos.NUMERO_CERTIFICADO_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurFormadoresCursos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurFormadoresCursos.PK_FIELD_NAMES ); + primaryKey.set( 0, getFormador_id() ); + primaryKey.set( 1, getCurso_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormandos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormandos.java new file mode 100644 index 00000000..b5a55cf6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormandos.java @@ -0,0 +1,625 @@ +/* +* CurFormandos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurFormandos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurFormandos.ID, CurFormandos.ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.ID_FULL, CurFormandos.ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.DADOS_PESSOAS_ID, CurFormandos.DADOS_PESSOAS_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.DADOS_PESSOAS_ID_FULL, CurFormandos.DADOS_PESSOAS_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.DELETED_DATE, CurFormandos.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandos.DELETED_DATE_FULL, CurFormandos.DELETED_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurFormandos.CLASS_IDENTIFIER, CurFormandos.HOSPITAL_ID, CurFormandos.TO_HOSPITAL_ID ); + FIELD_INDEXES.put( CurFormandos.HOSPITAL_ID, CurFormandos.HOSPITAL_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.HOSPITAL_ID_FULL, CurFormandos.HOSPITAL_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.TO_HOSPITAL_ID, CurFormandos.TO_HOSPITAL_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.SUB_REGIAO_ID, CurFormandos.SUB_REGIAO_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.SUB_REGIAO_ID_FULL, CurFormandos.SUB_REGIAO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurFormandos.CLASS_IDENTIFIER, CurFormandos.ARS_ID, CurFormandos.TO_ARS_ID ); + FIELD_INDEXES.put( CurFormandos.ARS_ID, CurFormandos.ARS_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.ARS_ID_FULL, CurFormandos.ARS_ID_INDEX ); + FIELD_INDEXES.put( CurFormandos.TO_ARS_ID, CurFormandos.TO_ARS_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyhospital_idTocur_hospitais = + new com.evolute.entity.ForeignKey( CurFormandos.class, CurFormandos.HOSPITAL_ID, db.data.siprp_local.outer.CurHospitaisData.class, db.data.siprp_local.outer.CurHospitaisData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyars_idTocur_ars = + new com.evolute.entity.ForeignKey( CurFormandos.class, CurFormandos.ARS_ID, db.data.siprp_local.outer.CurArsData.class, db.data.siprp_local.outer.CurArsData.ID ); + + public static final String TABLENAME = "cur_formandos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_formandos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_formandos.id"; + public static final int ID_INDEX = 0; + public static final String DADOS_PESSOAS_ID = "dados_pessoas_id"; + public static final String DADOS_PESSOAS_ID_FULL = "cur_formandos.dados_pessoas_id"; + public static final int DADOS_PESSOAS_ID_INDEX = 1; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_formandos.deleted_date"; + public static final int DELETED_DATE_INDEX = 2; + public static final String HOSPITAL_ID = "hospital_id"; + public static final String HOSPITAL_ID_FULL = "cur_formandos.hospital_id"; + public static final int HOSPITAL_ID_INDEX = 3; + public static final String TO_HOSPITAL_ID = "to_hospital_id"; + public static final String TO_HOSPITAL_ID_FULL = "cur_formandos.to_hospital_id"; + public static final int TO_HOSPITAL_ID_INDEX = 4; + public static final String SUB_REGIAO_ID = "sub_regiao_id"; + public static final String SUB_REGIAO_ID_FULL = "cur_formandos.sub_regiao_id"; + public static final int SUB_REGIAO_ID_INDEX = 5; + public static final String ARS_ID = "ars_id"; + public static final String ARS_ID_FULL = "cur_formandos.ars_id"; + public static final int ARS_ID_INDEX = 6; + public static final String TO_ARS_ID = "to_ars_id"; + public static final String TO_ARS_ID_FULL = "cur_formandos.to_ars_id"; + public static final int TO_ARS_ID_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + DADOS_PESSOAS_ID, DELETED_DATE, HOSPITAL_ID, TO_HOSPITAL_ID, SUB_REGIAO_ID, + ARS_ID, TO_ARS_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DADOS_PESSOAS_ID, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + HOSPITAL_ID, TABLENAME + "." + TO_HOSPITAL_ID, TABLENAME + "." + SUB_REGIAO_ID, + TABLENAME + "." + ARS_ID, TABLENAME + "." + TO_ARS_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DADOS_PESSOAS_ID, DELETED_DATE, HOSPITAL_ID, SUB_REGIAO_ID, ARS_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DADOS_PESSOAS_ID, DELETED_DATE, HOSPITAL_ID, SUB_REGIAO_ID, ARS_ID, }; + + private Integer id; + private Integer dados_pessoas_id; + private java.sql.Timestamp deleted_date; + private Integer hospital_id; + private db.data.siprp_local.outer.CurHospitaisData to_hospital_id; + private Integer sub_regiao_id; + private Integer ars_id; + private db.data.siprp_local.outer.CurArsData to_ars_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurFormandos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurFormandosCursos_formando_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurFormandosCursosData.class , getPrimaryKey().getMap().get("id"), "formando_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurPagamentos_formando_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurPagamentosData.class , getPrimaryKey().getMap().get("id"), "formando_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurPresencas_formando_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurPresencasData.class , getPrimaryKey().getMap().get("id"), "formando_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getDados_pessoas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DADOS_PESSOAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.dados_pessoas_id; + } + + public void setDados_pessoas_id( Integer dados_pessoas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( DADOS_PESSOAS_ID, dados_pessoas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.dados_pessoas_id = dados_pessoas_id; + LAZY_LOADED_OBJECTS.put( DADOS_PESSOAS_ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getHospital_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HOSPITAL_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hospital_id; + } + + public void setHospital_id( Integer hospital_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HOSPITAL_ID, hospital_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hospital_id = hospital_id; + LAZY_LOADED_OBJECTS.put( HOSPITAL_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurHospitaisData toHospital_id() + { + try + { + prepare( TO_HOSPITAL_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_hospital_id; + } + + public void setToHospital_id( db.data.siprp_local.outer.CurHospitaisData to_hospital_id ) + { + try + { + preProcess( TO_HOSPITAL_ID, to_hospital_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_hospital_id = to_hospital_id; + } + + public Integer getSub_regiao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SUB_REGIAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.sub_regiao_id; + } + + public void setSub_regiao_id( Integer sub_regiao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( SUB_REGIAO_ID, sub_regiao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.sub_regiao_id = sub_regiao_id; + LAZY_LOADED_OBJECTS.put( SUB_REGIAO_ID, Boolean.TRUE ); + } + + public Integer getArs_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ARS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ars_id; + } + + public void setArs_id( Integer ars_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ARS_ID, ars_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ars_id = ars_id; + LAZY_LOADED_OBJECTS.put( ARS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurArsData toArs_id() + { + try + { + prepare( TO_ARS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_ars_id; + } + + public void setToArs_id( db.data.siprp_local.outer.CurArsData to_ars_id ) + { + try + { + preProcess( TO_ARS_ID, to_ars_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_ars_id = to_ars_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandos.ID_INDEX: + value = getId(); + break; + case CurFormandos.DADOS_PESSOAS_ID_INDEX: + value = getDados_pessoas_id(); + break; + case CurFormandos.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case CurFormandos.HOSPITAL_ID_INDEX: + value = getHospital_id(); + break; + case CurFormandos.TO_HOSPITAL_ID_INDEX: + value = toHospital_id(); + break; + case CurFormandos.SUB_REGIAO_ID_INDEX: + value = getSub_regiao_id(); + break; + case CurFormandos.ARS_ID_INDEX: + value = getArs_id(); + break; + case CurFormandos.TO_ARS_ID_INDEX: + value = toArs_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandos.ID_INDEX: + value = this.id; + break; + case CurFormandos.DADOS_PESSOAS_ID_INDEX: + value = this.dados_pessoas_id; + break; + case CurFormandos.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case CurFormandos.HOSPITAL_ID_INDEX: + value = this.hospital_id; + break; + case CurFormandos.TO_HOSPITAL_ID_INDEX: + value = this.to_hospital_id; + break; + case CurFormandos.SUB_REGIAO_ID_INDEX: + value = this.sub_regiao_id; + break; + case CurFormandos.ARS_ID_INDEX: + value = this.ars_id; + break; + case CurFormandos.TO_ARS_ID_INDEX: + value = this.to_ars_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandos.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurFormandos.DADOS_PESSOAS_ID_INDEX: + setDados_pessoas_id( ( Integer ) value ); + break; + case CurFormandos.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case CurFormandos.HOSPITAL_ID_INDEX: + setHospital_id( ( Integer ) value ); + break; + case CurFormandos.TO_HOSPITAL_ID_INDEX: + setToHospital_id( ( db.data.siprp_local.outer.CurHospitaisData ) value ); + break; + case CurFormandos.SUB_REGIAO_ID_INDEX: + setSub_regiao_id( ( Integer ) value ); + break; + case CurFormandos.ARS_ID_INDEX: + setArs_id( ( Integer ) value ); + break; + case CurFormandos.TO_ARS_ID_INDEX: + setToArs_id( ( db.data.siprp_local.outer.CurArsData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandos.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurFormandos.DADOS_PESSOAS_ID_INDEX: + this.dados_pessoas_id = ( Integer ) value; + break; + case CurFormandos.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case CurFormandos.HOSPITAL_ID_INDEX: + this.hospital_id = ( Integer ) value; + break; + case CurFormandos.TO_HOSPITAL_ID_INDEX: + this.to_hospital_id = ( db.data.siprp_local.outer.CurHospitaisData ) value; + break; + case CurFormandos.SUB_REGIAO_ID_INDEX: + this.sub_regiao_id = ( Integer ) value; + break; + case CurFormandos.ARS_ID_INDEX: + this.ars_id = ( Integer ) value; + break; + case CurFormandos.TO_ARS_ID_INDEX: + this.to_ars_id = ( db.data.siprp_local.outer.CurArsData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurFormandos.ID_INDEX: + theClass = Integer.class; + break; + case CurFormandos.DADOS_PESSOAS_ID_INDEX: + theClass = Integer.class; + break; + case CurFormandos.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurFormandos.HOSPITAL_ID_INDEX: + theClass = Integer.class; + break; + case CurFormandos.TO_HOSPITAL_ID_INDEX: + theClass = db.data.siprp_local.outer.CurHospitaisData.class; + break; + case CurFormandos.SUB_REGIAO_ID_INDEX: + theClass = Integer.class; + break; + case CurFormandos.ARS_ID_INDEX: + theClass = Integer.class; + break; + case CurFormandos.TO_ARS_ID_INDEX: + theClass = db.data.siprp_local.outer.CurArsData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurFormandos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurFormandos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormandosCursos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormandosCursos.java new file mode 100644 index 00000000..b61a9546 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurFormandosCursos.java @@ -0,0 +1,583 @@ +/* +* CurFormandosCursos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurFormandosCursos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( CurFormandosCursos.CLASS_IDENTIFIER, CurFormandosCursos.FORMANDO_ID, CurFormandosCursos.TO_FORMANDO_ID ); + FIELD_INDEXES.put( CurFormandosCursos.FORMANDO_ID, CurFormandosCursos.FORMANDO_ID_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.FORMANDO_ID_FULL, CurFormandosCursos.FORMANDO_ID_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.TO_FORMANDO_ID, CurFormandosCursos.TO_FORMANDO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurFormandosCursos.CLASS_IDENTIFIER, CurFormandosCursos.CURSO_ID, CurFormandosCursos.TO_CURSO_ID ); + FIELD_INDEXES.put( CurFormandosCursos.CURSO_ID, CurFormandosCursos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.CURSO_ID_FULL, CurFormandosCursos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.TO_CURSO_ID, CurFormandosCursos.TO_CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.INSCRITO_DATE, CurFormandosCursos.INSCRITO_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.INSCRITO_DATE_FULL, CurFormandosCursos.INSCRITO_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.REJEITADO_DATE, CurFormandosCursos.REJEITADO_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.REJEITADO_DATE_FULL, CurFormandosCursos.REJEITADO_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.DESISTIU_DATE, CurFormandosCursos.DESISTIU_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.DESISTIU_DATE_FULL, CurFormandosCursos.DESISTIU_DATE_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.NUMERO_CERTIFICADO, CurFormandosCursos.NUMERO_CERTIFICADO_INDEX ); + FIELD_INDEXES.put( CurFormandosCursos.NUMERO_CERTIFICADO_FULL, CurFormandosCursos.NUMERO_CERTIFICADO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyformando_idTocur_formandos = + new com.evolute.entity.ForeignKey( CurFormandosCursos.class, CurFormandosCursos.FORMANDO_ID, db.data.siprp_local.outer.CurFormandosData.class, db.data.siprp_local.outer.CurFormandosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycurso_idTocur_cursos = + new com.evolute.entity.ForeignKey( CurFormandosCursos.class, CurFormandosCursos.CURSO_ID, db.data.siprp_local.outer.CurCursosData.class, db.data.siprp_local.outer.CurCursosData.ID ); + + public static final String TABLENAME = "cur_formandos_cursos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_formandos_cursos"; + + public static final int _INVALID__INDEX = -1; + public static final String FORMANDO_ID = "formando_id"; + public static final String FORMANDO_ID_FULL = "cur_formandos_cursos.formando_id"; + public static final int FORMANDO_ID_INDEX = 0; + public static final String TO_FORMANDO_ID = "to_formando_id"; + public static final String TO_FORMANDO_ID_FULL = "cur_formandos_cursos.to_formando_id"; + public static final int TO_FORMANDO_ID_INDEX = 1; + public static final String CURSO_ID = "curso_id"; + public static final String CURSO_ID_FULL = "cur_formandos_cursos.curso_id"; + public static final int CURSO_ID_INDEX = 2; + public static final String TO_CURSO_ID = "to_curso_id"; + public static final String TO_CURSO_ID_FULL = "cur_formandos_cursos.to_curso_id"; + public static final int TO_CURSO_ID_INDEX = 3; + public static final String INSCRITO_DATE = "inscrito_date"; + public static final String INSCRITO_DATE_FULL = "cur_formandos_cursos.inscrito_date"; + public static final int INSCRITO_DATE_INDEX = 4; + public static final String REJEITADO_DATE = "rejeitado_date"; + public static final String REJEITADO_DATE_FULL = "cur_formandos_cursos.rejeitado_date"; + public static final int REJEITADO_DATE_INDEX = 5; + public static final String DESISTIU_DATE = "desistiu_date"; + public static final String DESISTIU_DATE_FULL = "cur_formandos_cursos.desistiu_date"; + public static final int DESISTIU_DATE_INDEX = 6; + public static final String NUMERO_CERTIFICADO = "numero_certificado"; + public static final String NUMERO_CERTIFICADO_FULL = "cur_formandos_cursos.numero_certificado"; + public static final int NUMERO_CERTIFICADO_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + INSCRITO_DATE, REJEITADO_DATE, DESISTIU_DATE, NUMERO_CERTIFICADO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + INSCRITO_DATE, TABLENAME + "." + REJEITADO_DATE, TABLENAME + "." + DESISTIU_DATE, TABLENAME + "." + NUMERO_CERTIFICADO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + FORMANDO_ID, CURSO_ID, INSCRITO_DATE, REJEITADO_DATE, DESISTIU_DATE, + NUMERO_CERTIFICADO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + FORMANDO_ID, CURSO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + FORMANDO_ID, CURSO_ID, INSCRITO_DATE, REJEITADO_DATE, DESISTIU_DATE, + NUMERO_CERTIFICADO, }; + + private Integer formando_id; + private db.data.siprp_local.outer.CurFormandosData to_formando_id; + private Integer curso_id; + private db.data.siprp_local.outer.CurCursosData to_curso_id; + private java.sql.Timestamp inscrito_date; + private java.sql.Timestamp rejeitado_date; + private java.sql.Timestamp desistiu_date; + private Integer numero_certificado; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurFormandosCursos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false }; + } + + public Integer getFormando_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMANDO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formando_id; + } + + public void setFormando_id( Integer formando_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMANDO_ID, formando_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formando_id = formando_id; + LAZY_LOADED_OBJECTS.put( FORMANDO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormandosData toFormando_id() + { + try + { + prepare( TO_FORMANDO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formando_id; + } + + public void setToFormando_id( db.data.siprp_local.outer.CurFormandosData to_formando_id ) + { + try + { + preProcess( TO_FORMANDO_ID, to_formando_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formando_id = to_formando_id; + } + + public Integer getCurso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.curso_id; + } + + public void setCurso_id( Integer curso_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURSO_ID, curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.curso_id = curso_id; + LAZY_LOADED_OBJECTS.put( CURSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurCursosData toCurso_id() + { + try + { + prepare( TO_CURSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_curso_id; + } + + public void setToCurso_id( db.data.siprp_local.outer.CurCursosData to_curso_id ) + { + try + { + preProcess( TO_CURSO_ID, to_curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_curso_id = to_curso_id; + } + + public java.sql.Timestamp getInscrito_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INSCRITO_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inscrito_date; + } + + public void setInscrito_date( java.sql.Timestamp inscrito_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( INSCRITO_DATE, inscrito_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inscrito_date = inscrito_date; + LAZY_LOADED_OBJECTS.put( INSCRITO_DATE, Boolean.TRUE ); + } + + public java.sql.Timestamp getRejeitado_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REJEITADO_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.rejeitado_date; + } + + public void setRejeitado_date( java.sql.Timestamp rejeitado_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( REJEITADO_DATE, rejeitado_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.rejeitado_date = rejeitado_date; + LAZY_LOADED_OBJECTS.put( REJEITADO_DATE, Boolean.TRUE ); + } + + public java.sql.Timestamp getDesistiu_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESISTIU_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.desistiu_date; + } + + public void setDesistiu_date( java.sql.Timestamp desistiu_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESISTIU_DATE, desistiu_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.desistiu_date = desistiu_date; + LAZY_LOADED_OBJECTS.put( DESISTIU_DATE, Boolean.TRUE ); + } + + public Integer getNumero_certificado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_CERTIFICADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_certificado; + } + + public void setNumero_certificado( Integer numero_certificado ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_CERTIFICADO, numero_certificado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_certificado = numero_certificado; + LAZY_LOADED_OBJECTS.put( NUMERO_CERTIFICADO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandosCursos.FORMANDO_ID_INDEX: + value = getFormando_id(); + break; + case CurFormandosCursos.TO_FORMANDO_ID_INDEX: + value = toFormando_id(); + break; + case CurFormandosCursos.CURSO_ID_INDEX: + value = getCurso_id(); + break; + case CurFormandosCursos.TO_CURSO_ID_INDEX: + value = toCurso_id(); + break; + case CurFormandosCursos.INSCRITO_DATE_INDEX: + value = getInscrito_date(); + break; + case CurFormandosCursos.REJEITADO_DATE_INDEX: + value = getRejeitado_date(); + break; + case CurFormandosCursos.DESISTIU_DATE_INDEX: + value = getDesistiu_date(); + break; + case CurFormandosCursos.NUMERO_CERTIFICADO_INDEX: + value = getNumero_certificado(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandosCursos.FORMANDO_ID_INDEX: + value = this.formando_id; + break; + case CurFormandosCursos.TO_FORMANDO_ID_INDEX: + value = this.to_formando_id; + break; + case CurFormandosCursos.CURSO_ID_INDEX: + value = this.curso_id; + break; + case CurFormandosCursos.TO_CURSO_ID_INDEX: + value = this.to_curso_id; + break; + case CurFormandosCursos.INSCRITO_DATE_INDEX: + value = this.inscrito_date; + break; + case CurFormandosCursos.REJEITADO_DATE_INDEX: + value = this.rejeitado_date; + break; + case CurFormandosCursos.DESISTIU_DATE_INDEX: + value = this.desistiu_date; + break; + case CurFormandosCursos.NUMERO_CERTIFICADO_INDEX: + value = this.numero_certificado; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandosCursos.FORMANDO_ID_INDEX: + setFormando_id( ( Integer ) value ); + break; + case CurFormandosCursos.TO_FORMANDO_ID_INDEX: + setToFormando_id( ( db.data.siprp_local.outer.CurFormandosData ) value ); + break; + case CurFormandosCursos.CURSO_ID_INDEX: + setCurso_id( ( Integer ) value ); + break; + case CurFormandosCursos.TO_CURSO_ID_INDEX: + setToCurso_id( ( db.data.siprp_local.outer.CurCursosData ) value ); + break; + case CurFormandosCursos.INSCRITO_DATE_INDEX: + setInscrito_date( ( java.sql.Timestamp ) value ); + break; + case CurFormandosCursos.REJEITADO_DATE_INDEX: + setRejeitado_date( ( java.sql.Timestamp ) value ); + break; + case CurFormandosCursos.DESISTIU_DATE_INDEX: + setDesistiu_date( ( java.sql.Timestamp ) value ); + break; + case CurFormandosCursos.NUMERO_CERTIFICADO_INDEX: + setNumero_certificado( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurFormandosCursos.FORMANDO_ID_INDEX: + this.formando_id = ( Integer ) value; + break; + case CurFormandosCursos.TO_FORMANDO_ID_INDEX: + this.to_formando_id = ( db.data.siprp_local.outer.CurFormandosData ) value; + break; + case CurFormandosCursos.CURSO_ID_INDEX: + this.curso_id = ( Integer ) value; + break; + case CurFormandosCursos.TO_CURSO_ID_INDEX: + this.to_curso_id = ( db.data.siprp_local.outer.CurCursosData ) value; + break; + case CurFormandosCursos.INSCRITO_DATE_INDEX: + this.inscrito_date = ( java.sql.Timestamp ) value; + break; + case CurFormandosCursos.REJEITADO_DATE_INDEX: + this.rejeitado_date = ( java.sql.Timestamp ) value; + break; + case CurFormandosCursos.DESISTIU_DATE_INDEX: + this.desistiu_date = ( java.sql.Timestamp ) value; + break; + case CurFormandosCursos.NUMERO_CERTIFICADO_INDEX: + this.numero_certificado = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on CurFormandosCursos is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurFormandosCursos.FORMANDO_ID_INDEX: + theClass = Integer.class; + break; + case CurFormandosCursos.TO_FORMANDO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormandosData.class; + break; + case CurFormandosCursos.CURSO_ID_INDEX: + theClass = Integer.class; + break; + case CurFormandosCursos.TO_CURSO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurCursosData.class; + break; + case CurFormandosCursos.INSCRITO_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurFormandosCursos.REJEITADO_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurFormandosCursos.DESISTIU_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurFormandosCursos.NUMERO_CERTIFICADO_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurFormandosCursos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurFormandosCursos.PK_FIELD_NAMES ); + primaryKey.set( 0, getFormando_id() ); + primaryKey.set( 1, getCurso_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurHospitais.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurHospitais.java new file mode 100644 index 00000000..63ff84a4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurHospitais.java @@ -0,0 +1,293 @@ +/* +* CurHospitais.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurHospitais extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurHospitais.ID, CurHospitais.ID_INDEX ); + FIELD_INDEXES.put( CurHospitais.ID_FULL, CurHospitais.ID_INDEX ); + FIELD_INDEXES.put( CurHospitais.NOME, CurHospitais.NOME_INDEX ); + FIELD_INDEXES.put( CurHospitais.NOME_FULL, CurHospitais.NOME_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_hospitais"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_hospitais"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_hospitais.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "cur_hospitais.nome"; + public static final int NOME_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, }; + + private Integer id; + private String nome; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurHospitais() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurFormandos_hospital_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurFormandosData.class , getPrimaryKey().getMap().get("id"), "hospital_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurHospitais.ID_INDEX: + value = getId(); + break; + case CurHospitais.NOME_INDEX: + value = getNome(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurHospitais.ID_INDEX: + value = this.id; + break; + case CurHospitais.NOME_INDEX: + value = this.nome; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurHospitais.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurHospitais.NOME_INDEX: + setNome( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurHospitais.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurHospitais.NOME_INDEX: + this.nome = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurHospitais.ID_INDEX: + theClass = Integer.class; + break; + case CurHospitais.NOME_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurHospitais._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurHospitais.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurNumeroCertificado.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurNumeroCertificado.java new file mode 100644 index 00000000..ce70bcf2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurNumeroCertificado.java @@ -0,0 +1,330 @@ +/* +* CurNumeroCertificado.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurNumeroCertificado extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurNumeroCertificado.ID, CurNumeroCertificado.ID_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificado.ID_FULL, CurNumeroCertificado.ID_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificado.ANO, CurNumeroCertificado.ANO_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificado.ANO_FULL, CurNumeroCertificado.ANO_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificado.ULTIMO_NUMERO, CurNumeroCertificado.ULTIMO_NUMERO_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificado.ULTIMO_NUMERO_FULL, CurNumeroCertificado.ULTIMO_NUMERO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_numero_certificado"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_numero_certificado"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_numero_certificado.id"; + public static final int ID_INDEX = 0; + public static final String ANO = "ano"; + public static final String ANO_FULL = "cur_numero_certificado.ano"; + public static final int ANO_INDEX = 1; + public static final String ULTIMO_NUMERO = "ultimo_numero"; + public static final String ULTIMO_NUMERO_FULL = "cur_numero_certificado.ultimo_numero"; + public static final int ULTIMO_NUMERO_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + ANO, ULTIMO_NUMERO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ANO, TABLENAME + "." + ULTIMO_NUMERO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ANO, ULTIMO_NUMERO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ANO, ULTIMO_NUMERO, }; + + private Integer id; + private Integer ano; + private Integer ultimo_numero; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurNumeroCertificado() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getAno() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ano; + } + + public void setAno( Integer ano ) + { + try + { + setLockedForRefresh( true ); + preProcess( ANO, ano ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ano = ano; + LAZY_LOADED_OBJECTS.put( ANO, Boolean.TRUE ); + } + + public Integer getUltimo_numero() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ULTIMO_NUMERO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ultimo_numero; + } + + public void setUltimo_numero( Integer ultimo_numero ) + { + try + { + setLockedForRefresh( true ); + preProcess( ULTIMO_NUMERO, ultimo_numero ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ultimo_numero = ultimo_numero; + LAZY_LOADED_OBJECTS.put( ULTIMO_NUMERO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificado.ID_INDEX: + value = getId(); + break; + case CurNumeroCertificado.ANO_INDEX: + value = getAno(); + break; + case CurNumeroCertificado.ULTIMO_NUMERO_INDEX: + value = getUltimo_numero(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificado.ID_INDEX: + value = this.id; + break; + case CurNumeroCertificado.ANO_INDEX: + value = this.ano; + break; + case CurNumeroCertificado.ULTIMO_NUMERO_INDEX: + value = this.ultimo_numero; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificado.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurNumeroCertificado.ANO_INDEX: + setAno( ( Integer ) value ); + break; + case CurNumeroCertificado.ULTIMO_NUMERO_INDEX: + setUltimo_numero( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificado.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurNumeroCertificado.ANO_INDEX: + this.ano = ( Integer ) value; + break; + case CurNumeroCertificado.ULTIMO_NUMERO_INDEX: + this.ultimo_numero = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurNumeroCertificado.ID_INDEX: + theClass = Integer.class; + break; + case CurNumeroCertificado.ANO_INDEX: + theClass = Integer.class; + break; + case CurNumeroCertificado.ULTIMO_NUMERO_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurNumeroCertificado._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurNumeroCertificado.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurNumeroCertificadoFormador.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurNumeroCertificadoFormador.java new file mode 100644 index 00000000..3182d757 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurNumeroCertificadoFormador.java @@ -0,0 +1,330 @@ +/* +* CurNumeroCertificadoFormador.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurNumeroCertificadoFormador extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurNumeroCertificadoFormador.ID, CurNumeroCertificadoFormador.ID_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificadoFormador.ID_FULL, CurNumeroCertificadoFormador.ID_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificadoFormador.ANO, CurNumeroCertificadoFormador.ANO_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificadoFormador.ANO_FULL, CurNumeroCertificadoFormador.ANO_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificadoFormador.ULTIMO_NUMERO, CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX ); + FIELD_INDEXES.put( CurNumeroCertificadoFormador.ULTIMO_NUMERO_FULL, CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_numero_certificado_formador"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_numero_certificado_formador"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_numero_certificado_formador.id"; + public static final int ID_INDEX = 0; + public static final String ANO = "ano"; + public static final String ANO_FULL = "cur_numero_certificado_formador.ano"; + public static final int ANO_INDEX = 1; + public static final String ULTIMO_NUMERO = "ultimo_numero"; + public static final String ULTIMO_NUMERO_FULL = "cur_numero_certificado_formador.ultimo_numero"; + public static final int ULTIMO_NUMERO_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + ANO, ULTIMO_NUMERO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ANO, TABLENAME + "." + ULTIMO_NUMERO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ANO, ULTIMO_NUMERO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ANO, ULTIMO_NUMERO, }; + + private Integer id; + private Integer ano; + private Integer ultimo_numero; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurNumeroCertificadoFormador() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getAno() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ano; + } + + public void setAno( Integer ano ) + { + try + { + setLockedForRefresh( true ); + preProcess( ANO, ano ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ano = ano; + LAZY_LOADED_OBJECTS.put( ANO, Boolean.TRUE ); + } + + public Integer getUltimo_numero() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ULTIMO_NUMERO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ultimo_numero; + } + + public void setUltimo_numero( Integer ultimo_numero ) + { + try + { + setLockedForRefresh( true ); + preProcess( ULTIMO_NUMERO, ultimo_numero ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ultimo_numero = ultimo_numero; + LAZY_LOADED_OBJECTS.put( ULTIMO_NUMERO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificadoFormador.ID_INDEX: + value = getId(); + break; + case CurNumeroCertificadoFormador.ANO_INDEX: + value = getAno(); + break; + case CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX: + value = getUltimo_numero(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificadoFormador.ID_INDEX: + value = this.id; + break; + case CurNumeroCertificadoFormador.ANO_INDEX: + value = this.ano; + break; + case CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX: + value = this.ultimo_numero; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificadoFormador.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurNumeroCertificadoFormador.ANO_INDEX: + setAno( ( Integer ) value ); + break; + case CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX: + setUltimo_numero( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurNumeroCertificadoFormador.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurNumeroCertificadoFormador.ANO_INDEX: + this.ano = ( Integer ) value; + break; + case CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX: + this.ultimo_numero = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurNumeroCertificadoFormador.ID_INDEX: + theClass = Integer.class; + break; + case CurNumeroCertificadoFormador.ANO_INDEX: + theClass = Integer.class; + break; + case CurNumeroCertificadoFormador.ULTIMO_NUMERO_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurNumeroCertificadoFormador._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurNumeroCertificadoFormador.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPagamentos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPagamentos.java new file mode 100644 index 00000000..9b4b3514 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPagamentos.java @@ -0,0 +1,683 @@ +/* +* CurPagamentos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurPagamentos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurPagamentos.ID, CurPagamentos.ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.ID_FULL, CurPagamentos.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurPagamentos.CLASS_IDENTIFIER, CurPagamentos.FORMANDO_ID, CurPagamentos.TO_FORMANDO_ID ); + FIELD_INDEXES.put( CurPagamentos.FORMANDO_ID, CurPagamentos.FORMANDO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.FORMANDO_ID_FULL, CurPagamentos.FORMANDO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.TO_FORMANDO_ID, CurPagamentos.TO_FORMANDO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurPagamentos.CLASS_IDENTIFIER, CurPagamentos.CURSO_ID, CurPagamentos.TO_CURSO_ID ); + FIELD_INDEXES.put( CurPagamentos.CURSO_ID, CurPagamentos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.CURSO_ID_FULL, CurPagamentos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.TO_CURSO_ID, CurPagamentos.TO_CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.DATA_DATE, CurPagamentos.DATA_DATE_INDEX ); + FIELD_INDEXES.put( CurPagamentos.DATA_DATE_FULL, CurPagamentos.DATA_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurPagamentos.CLASS_IDENTIFIER, CurPagamentos.TIPO_ID, CurPagamentos.TO_TIPO_ID ); + FIELD_INDEXES.put( CurPagamentos.TIPO_ID, CurPagamentos.TIPO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.TIPO_ID_FULL, CurPagamentos.TIPO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.TO_TIPO_ID, CurPagamentos.TO_TIPO_ID_INDEX ); + FIELD_INDEXES.put( CurPagamentos.OBSERVACOES, CurPagamentos.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( CurPagamentos.OBSERVACOES_FULL, CurPagamentos.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( CurPagamentos.VALOR, CurPagamentos.VALOR_INDEX ); + FIELD_INDEXES.put( CurPagamentos.VALOR_FULL, CurPagamentos.VALOR_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyformando_idTocur_formandos = + new com.evolute.entity.ForeignKey( CurPagamentos.class, CurPagamentos.FORMANDO_ID, db.data.siprp_local.outer.CurFormandosData.class, db.data.siprp_local.outer.CurFormandosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycurso_idTocur_cursos = + new com.evolute.entity.ForeignKey( CurPagamentos.class, CurPagamentos.CURSO_ID, db.data.siprp_local.outer.CurCursosData.class, db.data.siprp_local.outer.CurCursosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytipo_idTocur_pagamentos_tipos = + new com.evolute.entity.ForeignKey( CurPagamentos.class, CurPagamentos.TIPO_ID, db.data.siprp_local.outer.CurPagamentosTiposData.class, db.data.siprp_local.outer.CurPagamentosTiposData.ID ); + + public static final String TABLENAME = "cur_pagamentos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_pagamentos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_pagamentos.id"; + public static final int ID_INDEX = 0; + public static final String FORMANDO_ID = "formando_id"; + public static final String FORMANDO_ID_FULL = "cur_pagamentos.formando_id"; + public static final int FORMANDO_ID_INDEX = 1; + public static final String TO_FORMANDO_ID = "to_formando_id"; + public static final String TO_FORMANDO_ID_FULL = "cur_pagamentos.to_formando_id"; + public static final int TO_FORMANDO_ID_INDEX = 2; + public static final String CURSO_ID = "curso_id"; + public static final String CURSO_ID_FULL = "cur_pagamentos.curso_id"; + public static final int CURSO_ID_INDEX = 3; + public static final String TO_CURSO_ID = "to_curso_id"; + public static final String TO_CURSO_ID_FULL = "cur_pagamentos.to_curso_id"; + public static final int TO_CURSO_ID_INDEX = 4; + public static final String DATA_DATE = "data_date"; + public static final String DATA_DATE_FULL = "cur_pagamentos.data_date"; + public static final int DATA_DATE_INDEX = 5; + public static final String TIPO_ID = "tipo_id"; + public static final String TIPO_ID_FULL = "cur_pagamentos.tipo_id"; + public static final int TIPO_ID_INDEX = 6; + public static final String TO_TIPO_ID = "to_tipo_id"; + public static final String TO_TIPO_ID_FULL = "cur_pagamentos.to_tipo_id"; + public static final int TO_TIPO_ID_INDEX = 7; + public static final String OBSERVACOES = "observacoes"; + public static final String OBSERVACOES_FULL = "cur_pagamentos.observacoes"; + public static final int OBSERVACOES_INDEX = 8; + public static final String VALOR = "valor"; + public static final String VALOR_FULL = "cur_pagamentos.valor"; + public static final int VALOR_INDEX = 9; + + public static final String FIELD_NAMES[] = new String[]{ + FORMANDO_ID, TO_FORMANDO_ID, CURSO_ID, TO_CURSO_ID, DATA_DATE, TIPO_ID, TO_TIPO_ID, + OBSERVACOES, VALOR, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + FORMANDO_ID, TABLENAME + "." + TO_FORMANDO_ID, TABLENAME + "." + CURSO_ID, TABLENAME + "." + TO_CURSO_ID, TABLENAME + "." + DATA_DATE, TABLENAME + "." + TIPO_ID, TABLENAME + "." + TO_TIPO_ID, + TABLENAME + "." + OBSERVACOES, TABLENAME + "." + VALOR, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, FORMANDO_ID, CURSO_ID, DATA_DATE, TIPO_ID, OBSERVACOES, VALOR, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, FORMANDO_ID, CURSO_ID, DATA_DATE, TIPO_ID, OBSERVACOES, VALOR, }; + + private Integer id; + private Integer formando_id; + private db.data.siprp_local.outer.CurFormandosData to_formando_id; + private Integer curso_id; + private db.data.siprp_local.outer.CurCursosData to_curso_id; + private java.sql.Timestamp data_date; + private Integer tipo_id; + private db.data.siprp_local.outer.CurPagamentosTiposData to_tipo_id; + private String observacoes; + private Double valor; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurPagamentos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getFormando_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMANDO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formando_id; + } + + public void setFormando_id( Integer formando_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMANDO_ID, formando_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formando_id = formando_id; + LAZY_LOADED_OBJECTS.put( FORMANDO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormandosData toFormando_id() + { + try + { + prepare( TO_FORMANDO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formando_id; + } + + public void setToFormando_id( db.data.siprp_local.outer.CurFormandosData to_formando_id ) + { + try + { + preProcess( TO_FORMANDO_ID, to_formando_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formando_id = to_formando_id; + } + + public Integer getCurso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.curso_id; + } + + public void setCurso_id( Integer curso_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURSO_ID, curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.curso_id = curso_id; + LAZY_LOADED_OBJECTS.put( CURSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurCursosData toCurso_id() + { + try + { + prepare( TO_CURSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_curso_id; + } + + public void setToCurso_id( db.data.siprp_local.outer.CurCursosData to_curso_id ) + { + try + { + preProcess( TO_CURSO_ID, to_curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_curso_id = to_curso_id; + } + + public java.sql.Timestamp getData_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_date; + } + + public void setData_date( java.sql.Timestamp data_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_DATE, data_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_date = data_date; + LAZY_LOADED_OBJECTS.put( DATA_DATE, Boolean.TRUE ); + } + + public Integer getTipo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_id; + } + + public void setTipo_id( Integer tipo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO_ID, tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_id = tipo_id; + LAZY_LOADED_OBJECTS.put( TIPO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurPagamentosTiposData toTipo_id() + { + try + { + prepare( TO_TIPO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tipo_id; + } + + public void setToTipo_id( db.data.siprp_local.outer.CurPagamentosTiposData to_tipo_id ) + { + try + { + preProcess( TO_TIPO_ID, to_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tipo_id = to_tipo_id; + } + + public String getObservacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes; + } + + public void setObservacoes( String observacoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACOES, observacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes = observacoes; + LAZY_LOADED_OBJECTS.put( OBSERVACOES, Boolean.TRUE ); + } + + public Double getValor() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor; + } + + public void setValor( Double valor ) + { + try + { + setLockedForRefresh( true ); + preProcess( VALOR, valor ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor = valor; + LAZY_LOADED_OBJECTS.put( VALOR, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentos.ID_INDEX: + value = getId(); + break; + case CurPagamentos.FORMANDO_ID_INDEX: + value = getFormando_id(); + break; + case CurPagamentos.TO_FORMANDO_ID_INDEX: + value = toFormando_id(); + break; + case CurPagamentos.CURSO_ID_INDEX: + value = getCurso_id(); + break; + case CurPagamentos.TO_CURSO_ID_INDEX: + value = toCurso_id(); + break; + case CurPagamentos.DATA_DATE_INDEX: + value = getData_date(); + break; + case CurPagamentos.TIPO_ID_INDEX: + value = getTipo_id(); + break; + case CurPagamentos.TO_TIPO_ID_INDEX: + value = toTipo_id(); + break; + case CurPagamentos.OBSERVACOES_INDEX: + value = getObservacoes(); + break; + case CurPagamentos.VALOR_INDEX: + value = getValor(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentos.ID_INDEX: + value = this.id; + break; + case CurPagamentos.FORMANDO_ID_INDEX: + value = this.formando_id; + break; + case CurPagamentos.TO_FORMANDO_ID_INDEX: + value = this.to_formando_id; + break; + case CurPagamentos.CURSO_ID_INDEX: + value = this.curso_id; + break; + case CurPagamentos.TO_CURSO_ID_INDEX: + value = this.to_curso_id; + break; + case CurPagamentos.DATA_DATE_INDEX: + value = this.data_date; + break; + case CurPagamentos.TIPO_ID_INDEX: + value = this.tipo_id; + break; + case CurPagamentos.TO_TIPO_ID_INDEX: + value = this.to_tipo_id; + break; + case CurPagamentos.OBSERVACOES_INDEX: + value = this.observacoes; + break; + case CurPagamentos.VALOR_INDEX: + value = this.valor; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentos.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurPagamentos.FORMANDO_ID_INDEX: + setFormando_id( ( Integer ) value ); + break; + case CurPagamentos.TO_FORMANDO_ID_INDEX: + setToFormando_id( ( db.data.siprp_local.outer.CurFormandosData ) value ); + break; + case CurPagamentos.CURSO_ID_INDEX: + setCurso_id( ( Integer ) value ); + break; + case CurPagamentos.TO_CURSO_ID_INDEX: + setToCurso_id( ( db.data.siprp_local.outer.CurCursosData ) value ); + break; + case CurPagamentos.DATA_DATE_INDEX: + setData_date( ( java.sql.Timestamp ) value ); + break; + case CurPagamentos.TIPO_ID_INDEX: + setTipo_id( ( Integer ) value ); + break; + case CurPagamentos.TO_TIPO_ID_INDEX: + setToTipo_id( ( db.data.siprp_local.outer.CurPagamentosTiposData ) value ); + break; + case CurPagamentos.OBSERVACOES_INDEX: + setObservacoes( ( String ) value ); + break; + case CurPagamentos.VALOR_INDEX: + setValor( ( Double ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentos.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurPagamentos.FORMANDO_ID_INDEX: + this.formando_id = ( Integer ) value; + break; + case CurPagamentos.TO_FORMANDO_ID_INDEX: + this.to_formando_id = ( db.data.siprp_local.outer.CurFormandosData ) value; + break; + case CurPagamentos.CURSO_ID_INDEX: + this.curso_id = ( Integer ) value; + break; + case CurPagamentos.TO_CURSO_ID_INDEX: + this.to_curso_id = ( db.data.siprp_local.outer.CurCursosData ) value; + break; + case CurPagamentos.DATA_DATE_INDEX: + this.data_date = ( java.sql.Timestamp ) value; + break; + case CurPagamentos.TIPO_ID_INDEX: + this.tipo_id = ( Integer ) value; + break; + case CurPagamentos.TO_TIPO_ID_INDEX: + this.to_tipo_id = ( db.data.siprp_local.outer.CurPagamentosTiposData ) value; + break; + case CurPagamentos.OBSERVACOES_INDEX: + this.observacoes = ( String ) value; + break; + case CurPagamentos.VALOR_INDEX: + this.valor = ( Double ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurPagamentos.ID_INDEX: + theClass = Integer.class; + break; + case CurPagamentos.FORMANDO_ID_INDEX: + theClass = Integer.class; + break; + case CurPagamentos.TO_FORMANDO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormandosData.class; + break; + case CurPagamentos.CURSO_ID_INDEX: + theClass = Integer.class; + break; + case CurPagamentos.TO_CURSO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurCursosData.class; + break; + case CurPagamentos.DATA_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurPagamentos.TIPO_ID_INDEX: + theClass = Integer.class; + break; + case CurPagamentos.TO_TIPO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurPagamentosTiposData.class; + break; + case CurPagamentos.OBSERVACOES_INDEX: + theClass = String.class; + break; + case CurPagamentos.VALOR_INDEX: + theClass = Double.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurPagamentos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurPagamentos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPagamentosTipos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPagamentosTipos.java new file mode 100644 index 00000000..75a733e7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPagamentosTipos.java @@ -0,0 +1,294 @@ +/* +* CurPagamentosTipos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurPagamentosTipos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurPagamentosTipos.ID, CurPagamentosTipos.ID_INDEX ); + FIELD_INDEXES.put( CurPagamentosTipos.ID_FULL, CurPagamentosTipos.ID_INDEX ); + FIELD_INDEXES.put( CurPagamentosTipos.DESCRICAO, CurPagamentosTipos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( CurPagamentosTipos.DESCRICAO_FULL, CurPagamentosTipos.DESCRICAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "cur_pagamentos_tipos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_pagamentos_tipos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_pagamentos_tipos.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "cur_pagamentos_tipos.descricao"; + public static final int DESCRICAO_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, }; + + private Integer id; + private String descricao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurPagamentosTipos() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurPagamentos_tipo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurPagamentosData.class , getPrimaryKey().getMap().get("id"), "tipo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentosTipos.ID_INDEX: + value = getId(); + break; + case CurPagamentosTipos.DESCRICAO_INDEX: + value = getDescricao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentosTipos.ID_INDEX: + value = this.id; + break; + case CurPagamentosTipos.DESCRICAO_INDEX: + value = this.descricao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentosTipos.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurPagamentosTipos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPagamentosTipos.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurPagamentosTipos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurPagamentosTipos.ID_INDEX: + theClass = Integer.class; + break; + case CurPagamentosTipos.DESCRICAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurPagamentosTipos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurPagamentosTipos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPresencas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPresencas.java new file mode 100644 index 00000000..72d4f402 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurPresencas.java @@ -0,0 +1,633 @@ +/* +* CurPresencas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurPresencas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurPresencas.ID, CurPresencas.ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.ID_FULL, CurPresencas.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurPresencas.CLASS_IDENTIFIER, CurPresencas.FORMANDO_ID, CurPresencas.TO_FORMANDO_ID ); + FIELD_INDEXES.put( CurPresencas.FORMANDO_ID, CurPresencas.FORMANDO_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.FORMANDO_ID_FULL, CurPresencas.FORMANDO_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.TO_FORMANDO_ID, CurPresencas.TO_FORMANDO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurPresencas.CLASS_IDENTIFIER, CurPresencas.FORMADOR_ID, CurPresencas.TO_FORMADOR_ID ); + FIELD_INDEXES.put( CurPresencas.FORMADOR_ID, CurPresencas.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.FORMADOR_ID_FULL, CurPresencas.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.TO_FORMADOR_ID, CurPresencas.TO_FORMADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurPresencas.CLASS_IDENTIFIER, CurPresencas.CURSO_ID, CurPresencas.TO_CURSO_ID ); + FIELD_INDEXES.put( CurPresencas.CURSO_ID, CurPresencas.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.CURSO_ID_FULL, CurPresencas.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.TO_CURSO_ID, CurPresencas.TO_CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurPresencas.DATA_DATE, CurPresencas.DATA_DATE_INDEX ); + FIELD_INDEXES.put( CurPresencas.DATA_DATE_FULL, CurPresencas.DATA_DATE_INDEX ); + FIELD_INDEXES.put( CurPresencas.DELETED_DATE, CurPresencas.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurPresencas.DELETED_DATE_FULL, CurPresencas.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyformando_idTocur_formandos = + new com.evolute.entity.ForeignKey( CurPresencas.class, CurPresencas.FORMANDO_ID, db.data.siprp_local.outer.CurFormandosData.class, db.data.siprp_local.outer.CurFormandosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyformador_idTocur_formadores = + new com.evolute.entity.ForeignKey( CurPresencas.class, CurPresencas.FORMADOR_ID, db.data.siprp_local.outer.CurFormadoresData.class, db.data.siprp_local.outer.CurFormadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycurso_idTocur_cursos = + new com.evolute.entity.ForeignKey( CurPresencas.class, CurPresencas.CURSO_ID, db.data.siprp_local.outer.CurCursosData.class, db.data.siprp_local.outer.CurCursosData.ID ); + + public static final String TABLENAME = "cur_presencas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_presencas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_presencas.id"; + public static final int ID_INDEX = 0; + public static final String FORMANDO_ID = "formando_id"; + public static final String FORMANDO_ID_FULL = "cur_presencas.formando_id"; + public static final int FORMANDO_ID_INDEX = 1; + public static final String TO_FORMANDO_ID = "to_formando_id"; + public static final String TO_FORMANDO_ID_FULL = "cur_presencas.to_formando_id"; + public static final int TO_FORMANDO_ID_INDEX = 2; + public static final String FORMADOR_ID = "formador_id"; + public static final String FORMADOR_ID_FULL = "cur_presencas.formador_id"; + public static final int FORMADOR_ID_INDEX = 3; + public static final String TO_FORMADOR_ID = "to_formador_id"; + public static final String TO_FORMADOR_ID_FULL = "cur_presencas.to_formador_id"; + public static final int TO_FORMADOR_ID_INDEX = 4; + public static final String CURSO_ID = "curso_id"; + public static final String CURSO_ID_FULL = "cur_presencas.curso_id"; + public static final int CURSO_ID_INDEX = 5; + public static final String TO_CURSO_ID = "to_curso_id"; + public static final String TO_CURSO_ID_FULL = "cur_presencas.to_curso_id"; + public static final int TO_CURSO_ID_INDEX = 6; + public static final String DATA_DATE = "data_date"; + public static final String DATA_DATE_FULL = "cur_presencas.data_date"; + public static final int DATA_DATE_INDEX = 7; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_presencas.deleted_date"; + public static final int DELETED_DATE_INDEX = 8; + + public static final String FIELD_NAMES[] = new String[]{ + FORMANDO_ID, TO_FORMANDO_ID, FORMADOR_ID, TO_FORMADOR_ID, CURSO_ID, TO_CURSO_ID, + DATA_DATE, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + FORMANDO_ID, TABLENAME + "." + TO_FORMANDO_ID, TABLENAME + "." + FORMADOR_ID, TABLENAME + "." + TO_FORMADOR_ID, TABLENAME + "." + CURSO_ID, TABLENAME + "." + TO_CURSO_ID, + TABLENAME + "." + DATA_DATE, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, FORMANDO_ID, FORMADOR_ID, CURSO_ID, DATA_DATE, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, FORMANDO_ID, FORMADOR_ID, CURSO_ID, DATA_DATE, DELETED_DATE, }; + + private Integer id; + private Integer formando_id; + private db.data.siprp_local.outer.CurFormandosData to_formando_id; + private Integer formador_id; + private db.data.siprp_local.outer.CurFormadoresData to_formador_id; + private Integer curso_id; + private db.data.siprp_local.outer.CurCursosData to_curso_id; + private java.sql.Timestamp data_date; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurPresencas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getFormando_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMANDO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formando_id; + } + + public void setFormando_id( Integer formando_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMANDO_ID, formando_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formando_id = formando_id; + LAZY_LOADED_OBJECTS.put( FORMANDO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormandosData toFormando_id() + { + try + { + prepare( TO_FORMANDO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formando_id; + } + + public void setToFormando_id( db.data.siprp_local.outer.CurFormandosData to_formando_id ) + { + try + { + preProcess( TO_FORMANDO_ID, to_formando_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formando_id = to_formando_id; + } + + public Integer getFormador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formador_id; + } + + public void setFormador_id( Integer formador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMADOR_ID, formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formador_id = formador_id; + LAZY_LOADED_OBJECTS.put( FORMADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormadoresData toFormador_id() + { + try + { + prepare( TO_FORMADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formador_id; + } + + public void setToFormador_id( db.data.siprp_local.outer.CurFormadoresData to_formador_id ) + { + try + { + preProcess( TO_FORMADOR_ID, to_formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formador_id = to_formador_id; + } + + public Integer getCurso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.curso_id; + } + + public void setCurso_id( Integer curso_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURSO_ID, curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.curso_id = curso_id; + LAZY_LOADED_OBJECTS.put( CURSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurCursosData toCurso_id() + { + try + { + prepare( TO_CURSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_curso_id; + } + + public void setToCurso_id( db.data.siprp_local.outer.CurCursosData to_curso_id ) + { + try + { + preProcess( TO_CURSO_ID, to_curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_curso_id = to_curso_id; + } + + public java.sql.Timestamp getData_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_date; + } + + public void setData_date( java.sql.Timestamp data_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_DATE, data_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_date = data_date; + LAZY_LOADED_OBJECTS.put( DATA_DATE, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPresencas.ID_INDEX: + value = getId(); + break; + case CurPresencas.FORMANDO_ID_INDEX: + value = getFormando_id(); + break; + case CurPresencas.TO_FORMANDO_ID_INDEX: + value = toFormando_id(); + break; + case CurPresencas.FORMADOR_ID_INDEX: + value = getFormador_id(); + break; + case CurPresencas.TO_FORMADOR_ID_INDEX: + value = toFormador_id(); + break; + case CurPresencas.CURSO_ID_INDEX: + value = getCurso_id(); + break; + case CurPresencas.TO_CURSO_ID_INDEX: + value = toCurso_id(); + break; + case CurPresencas.DATA_DATE_INDEX: + value = getData_date(); + break; + case CurPresencas.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPresencas.ID_INDEX: + value = this.id; + break; + case CurPresencas.FORMANDO_ID_INDEX: + value = this.formando_id; + break; + case CurPresencas.TO_FORMANDO_ID_INDEX: + value = this.to_formando_id; + break; + case CurPresencas.FORMADOR_ID_INDEX: + value = this.formador_id; + break; + case CurPresencas.TO_FORMADOR_ID_INDEX: + value = this.to_formador_id; + break; + case CurPresencas.CURSO_ID_INDEX: + value = this.curso_id; + break; + case CurPresencas.TO_CURSO_ID_INDEX: + value = this.to_curso_id; + break; + case CurPresencas.DATA_DATE_INDEX: + value = this.data_date; + break; + case CurPresencas.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPresencas.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurPresencas.FORMANDO_ID_INDEX: + setFormando_id( ( Integer ) value ); + break; + case CurPresencas.TO_FORMANDO_ID_INDEX: + setToFormando_id( ( db.data.siprp_local.outer.CurFormandosData ) value ); + break; + case CurPresencas.FORMADOR_ID_INDEX: + setFormador_id( ( Integer ) value ); + break; + case CurPresencas.TO_FORMADOR_ID_INDEX: + setToFormador_id( ( db.data.siprp_local.outer.CurFormadoresData ) value ); + break; + case CurPresencas.CURSO_ID_INDEX: + setCurso_id( ( Integer ) value ); + break; + case CurPresencas.TO_CURSO_ID_INDEX: + setToCurso_id( ( db.data.siprp_local.outer.CurCursosData ) value ); + break; + case CurPresencas.DATA_DATE_INDEX: + setData_date( ( java.sql.Timestamp ) value ); + break; + case CurPresencas.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurPresencas.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurPresencas.FORMANDO_ID_INDEX: + this.formando_id = ( Integer ) value; + break; + case CurPresencas.TO_FORMANDO_ID_INDEX: + this.to_formando_id = ( db.data.siprp_local.outer.CurFormandosData ) value; + break; + case CurPresencas.FORMADOR_ID_INDEX: + this.formador_id = ( Integer ) value; + break; + case CurPresencas.TO_FORMADOR_ID_INDEX: + this.to_formador_id = ( db.data.siprp_local.outer.CurFormadoresData ) value; + break; + case CurPresencas.CURSO_ID_INDEX: + this.curso_id = ( Integer ) value; + break; + case CurPresencas.TO_CURSO_ID_INDEX: + this.to_curso_id = ( db.data.siprp_local.outer.CurCursosData ) value; + break; + case CurPresencas.DATA_DATE_INDEX: + this.data_date = ( java.sql.Timestamp ) value; + break; + case CurPresencas.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurPresencas.ID_INDEX: + theClass = Integer.class; + break; + case CurPresencas.FORMANDO_ID_INDEX: + theClass = Integer.class; + break; + case CurPresencas.TO_FORMANDO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormandosData.class; + break; + case CurPresencas.FORMADOR_ID_INDEX: + theClass = Integer.class; + break; + case CurPresencas.TO_FORMADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormadoresData.class; + break; + case CurPresencas.CURSO_ID_INDEX: + theClass = Integer.class; + break; + case CurPresencas.TO_CURSO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurCursosData.class; + break; + case CurPresencas.DATA_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurPresencas.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurPresencas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurPresencas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurTopicos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurTopicos.java new file mode 100644 index 00000000..b8850095 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurTopicos.java @@ -0,0 +1,711 @@ +/* +* CurTopicos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurTopicos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( CurTopicos.ID, CurTopicos.ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.ID_FULL, CurTopicos.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurTopicos.CLASS_IDENTIFIER, CurTopicos.PARENT_ID, CurTopicos.TO_PARENT_ID ); + FIELD_INDEXES.put( CurTopicos.PARENT_ID, CurTopicos.PARENT_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.PARENT_ID_FULL, CurTopicos.PARENT_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.TO_PARENT_ID, CurTopicos.TO_PARENT_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.DESCRICAO, CurTopicos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( CurTopicos.DESCRICAO_FULL, CurTopicos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( CurTopicos.ORDEM, CurTopicos.ORDEM_INDEX ); + FIELD_INDEXES.put( CurTopicos.ORDEM_FULL, CurTopicos.ORDEM_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurTopicos.CLASS_IDENTIFIER, CurTopicos.CURSO_ID, CurTopicos.TO_CURSO_ID ); + FIELD_INDEXES.put( CurTopicos.CURSO_ID, CurTopicos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.CURSO_ID_FULL, CurTopicos.CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.TO_CURSO_ID, CurTopicos.TO_CURSO_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.DELETED_DATE, CurTopicos.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurTopicos.DELETED_DATE_FULL, CurTopicos.DELETED_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurTopicos.CLASS_IDENTIFIER, CurTopicos.FORMADOR_ID, CurTopicos.TO_FORMADOR_ID ); + FIELD_INDEXES.put( CurTopicos.FORMADOR_ID, CurTopicos.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.FORMADOR_ID_FULL, CurTopicos.FORMADOR_ID_INDEX ); + FIELD_INDEXES.put( CurTopicos.TO_FORMADOR_ID, CurTopicos.TO_FORMADOR_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyparent_idTocur_topicos = + new com.evolute.entity.ForeignKey( CurTopicos.class, CurTopicos.PARENT_ID, db.data.siprp_local.outer.CurTopicosData.class, db.data.siprp_local.outer.CurTopicosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycurso_idTocur_cursos = + new com.evolute.entity.ForeignKey( CurTopicos.class, CurTopicos.CURSO_ID, db.data.siprp_local.outer.CurCursosData.class, db.data.siprp_local.outer.CurCursosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyformador_idTocur_formadores = + new com.evolute.entity.ForeignKey( CurTopicos.class, CurTopicos.FORMADOR_ID, db.data.siprp_local.outer.CurFormadoresData.class, db.data.siprp_local.outer.CurFormadoresData.ID ); + + public static final String TABLENAME = "cur_topicos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_topicos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "cur_topicos.id"; + public static final int ID_INDEX = 0; + public static final String PARENT_ID = "parent_id"; + public static final String PARENT_ID_FULL = "cur_topicos.parent_id"; + public static final int PARENT_ID_INDEX = 1; + public static final String TO_PARENT_ID = "to_parent_id"; + public static final String TO_PARENT_ID_FULL = "cur_topicos.to_parent_id"; + public static final int TO_PARENT_ID_INDEX = 2; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "cur_topicos.descricao"; + public static final int DESCRICAO_INDEX = 3; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "cur_topicos.ordem"; + public static final int ORDEM_INDEX = 4; + public static final String CURSO_ID = "curso_id"; + public static final String CURSO_ID_FULL = "cur_topicos.curso_id"; + public static final int CURSO_ID_INDEX = 5; + public static final String TO_CURSO_ID = "to_curso_id"; + public static final String TO_CURSO_ID_FULL = "cur_topicos.to_curso_id"; + public static final int TO_CURSO_ID_INDEX = 6; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_topicos.deleted_date"; + public static final int DELETED_DATE_INDEX = 7; + public static final String FORMADOR_ID = "formador_id"; + public static final String FORMADOR_ID_FULL = "cur_topicos.formador_id"; + public static final int FORMADOR_ID_INDEX = 8; + public static final String TO_FORMADOR_ID = "to_formador_id"; + public static final String TO_FORMADOR_ID_FULL = "cur_topicos.to_formador_id"; + public static final int TO_FORMADOR_ID_INDEX = 9; + + public static final String FIELD_NAMES[] = new String[]{ + PARENT_ID, TO_PARENT_ID, DESCRICAO, ORDEM, CURSO_ID, TO_CURSO_ID, DELETED_DATE, + FORMADOR_ID, TO_FORMADOR_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PARENT_ID, TABLENAME + "." + TO_PARENT_ID, TABLENAME + "." + DESCRICAO, TABLENAME + "." + ORDEM, TABLENAME + "." + CURSO_ID, TABLENAME + "." + TO_CURSO_ID, TABLENAME + "." + DELETED_DATE, + TABLENAME + "." + FORMADOR_ID, TABLENAME + "." + TO_FORMADOR_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PARENT_ID, DESCRICAO, ORDEM, CURSO_ID, DELETED_DATE, FORMADOR_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PARENT_ID, DESCRICAO, ORDEM, CURSO_ID, DELETED_DATE, FORMADOR_ID, }; + + private Integer id; + private Integer parent_id; + private db.data.siprp_local.outer.CurTopicosData to_parent_id; + private String descricao; + private Integer ordem; + private Integer curso_id; + private db.data.siprp_local.outer.CurCursosData to_curso_id; + private java.sql.Timestamp deleted_date; + private Integer formador_id; + private db.data.siprp_local.outer.CurFormadoresData to_formador_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurTopicos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromCurTopicos_parent_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurTopicosData.class , getPrimaryKey().getMap().get("id"), "parent_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromCurTopicosAulas_topico_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.CurTopicosAulasData.class , getPrimaryKey().getMap().get("id"), "topico_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getParent_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PARENT_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.parent_id; + } + + public void setParent_id( Integer parent_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PARENT_ID, parent_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.parent_id = parent_id; + LAZY_LOADED_OBJECTS.put( PARENT_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurTopicosData toParent_id() + { + try + { + prepare( TO_PARENT_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_parent_id; + } + + public void setToParent_id( db.data.siprp_local.outer.CurTopicosData to_parent_id ) + { + try + { + preProcess( TO_PARENT_ID, to_parent_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_parent_id = to_parent_id; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Integer getCurso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.curso_id; + } + + public void setCurso_id( Integer curso_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURSO_ID, curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.curso_id = curso_id; + LAZY_LOADED_OBJECTS.put( CURSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurCursosData toCurso_id() + { + try + { + prepare( TO_CURSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_curso_id; + } + + public void setToCurso_id( db.data.siprp_local.outer.CurCursosData to_curso_id ) + { + try + { + preProcess( TO_CURSO_ID, to_curso_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_curso_id = to_curso_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getFormador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formador_id; + } + + public void setFormador_id( Integer formador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMADOR_ID, formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formador_id = formador_id; + LAZY_LOADED_OBJECTS.put( FORMADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurFormadoresData toFormador_id() + { + try + { + prepare( TO_FORMADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_formador_id; + } + + public void setToFormador_id( db.data.siprp_local.outer.CurFormadoresData to_formador_id ) + { + try + { + preProcess( TO_FORMADOR_ID, to_formador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_formador_id = to_formador_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicos.ID_INDEX: + value = getId(); + break; + case CurTopicos.PARENT_ID_INDEX: + value = getParent_id(); + break; + case CurTopicos.TO_PARENT_ID_INDEX: + value = toParent_id(); + break; + case CurTopicos.DESCRICAO_INDEX: + value = getDescricao(); + break; + case CurTopicos.ORDEM_INDEX: + value = getOrdem(); + break; + case CurTopicos.CURSO_ID_INDEX: + value = getCurso_id(); + break; + case CurTopicos.TO_CURSO_ID_INDEX: + value = toCurso_id(); + break; + case CurTopicos.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case CurTopicos.FORMADOR_ID_INDEX: + value = getFormador_id(); + break; + case CurTopicos.TO_FORMADOR_ID_INDEX: + value = toFormador_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicos.ID_INDEX: + value = this.id; + break; + case CurTopicos.PARENT_ID_INDEX: + value = this.parent_id; + break; + case CurTopicos.TO_PARENT_ID_INDEX: + value = this.to_parent_id; + break; + case CurTopicos.DESCRICAO_INDEX: + value = this.descricao; + break; + case CurTopicos.ORDEM_INDEX: + value = this.ordem; + break; + case CurTopicos.CURSO_ID_INDEX: + value = this.curso_id; + break; + case CurTopicos.TO_CURSO_ID_INDEX: + value = this.to_curso_id; + break; + case CurTopicos.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case CurTopicos.FORMADOR_ID_INDEX: + value = this.formador_id; + break; + case CurTopicos.TO_FORMADOR_ID_INDEX: + value = this.to_formador_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicos.ID_INDEX: + setId( ( Integer ) value ); + break; + case CurTopicos.PARENT_ID_INDEX: + setParent_id( ( Integer ) value ); + break; + case CurTopicos.TO_PARENT_ID_INDEX: + setToParent_id( ( db.data.siprp_local.outer.CurTopicosData ) value ); + break; + case CurTopicos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case CurTopicos.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case CurTopicos.CURSO_ID_INDEX: + setCurso_id( ( Integer ) value ); + break; + case CurTopicos.TO_CURSO_ID_INDEX: + setToCurso_id( ( db.data.siprp_local.outer.CurCursosData ) value ); + break; + case CurTopicos.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case CurTopicos.FORMADOR_ID_INDEX: + setFormador_id( ( Integer ) value ); + break; + case CurTopicos.TO_FORMADOR_ID_INDEX: + setToFormador_id( ( db.data.siprp_local.outer.CurFormadoresData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicos.ID_INDEX: + this.id = ( Integer ) value; + break; + case CurTopicos.PARENT_ID_INDEX: + this.parent_id = ( Integer ) value; + break; + case CurTopicos.TO_PARENT_ID_INDEX: + this.to_parent_id = ( db.data.siprp_local.outer.CurTopicosData ) value; + break; + case CurTopicos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case CurTopicos.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case CurTopicos.CURSO_ID_INDEX: + this.curso_id = ( Integer ) value; + break; + case CurTopicos.TO_CURSO_ID_INDEX: + this.to_curso_id = ( db.data.siprp_local.outer.CurCursosData ) value; + break; + case CurTopicos.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case CurTopicos.FORMADOR_ID_INDEX: + this.formador_id = ( Integer ) value; + break; + case CurTopicos.TO_FORMADOR_ID_INDEX: + this.to_formador_id = ( db.data.siprp_local.outer.CurFormadoresData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurTopicos.ID_INDEX: + theClass = Integer.class; + break; + case CurTopicos.PARENT_ID_INDEX: + theClass = Integer.class; + break; + case CurTopicos.TO_PARENT_ID_INDEX: + theClass = db.data.siprp_local.outer.CurTopicosData.class; + break; + case CurTopicos.DESCRICAO_INDEX: + theClass = String.class; + break; + case CurTopicos.ORDEM_INDEX: + theClass = Integer.class; + break; + case CurTopicos.CURSO_ID_INDEX: + theClass = Integer.class; + break; + case CurTopicos.TO_CURSO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurCursosData.class; + break; + case CurTopicos.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case CurTopicos.FORMADOR_ID_INDEX: + theClass = Integer.class; + break; + case CurTopicos.TO_FORMADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.CurFormadoresData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurTopicos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurTopicos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurTopicosAulas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurTopicosAulas.java new file mode 100644 index 00000000..3c5effb7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/CurTopicosAulas.java @@ -0,0 +1,431 @@ +/* +* CurTopicosAulas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class CurTopicosAulas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( CurTopicosAulas.CLASS_IDENTIFIER, CurTopicosAulas.TOPICO_ID, CurTopicosAulas.TO_TOPICO_ID ); + FIELD_INDEXES.put( CurTopicosAulas.TOPICO_ID, CurTopicosAulas.TOPICO_ID_INDEX ); + FIELD_INDEXES.put( CurTopicosAulas.TOPICO_ID_FULL, CurTopicosAulas.TOPICO_ID_INDEX ); + FIELD_INDEXES.put( CurTopicosAulas.TO_TOPICO_ID, CurTopicosAulas.TO_TOPICO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( CurTopicosAulas.CLASS_IDENTIFIER, CurTopicosAulas.AULA_ID, CurTopicosAulas.TO_AULA_ID ); + FIELD_INDEXES.put( CurTopicosAulas.AULA_ID, CurTopicosAulas.AULA_ID_INDEX ); + FIELD_INDEXES.put( CurTopicosAulas.AULA_ID_FULL, CurTopicosAulas.AULA_ID_INDEX ); + FIELD_INDEXES.put( CurTopicosAulas.TO_AULA_ID, CurTopicosAulas.TO_AULA_ID_INDEX ); + FIELD_INDEXES.put( CurTopicosAulas.DELETED_DATE, CurTopicosAulas.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( CurTopicosAulas.DELETED_DATE_FULL, CurTopicosAulas.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytopico_idTocur_topicos = + new com.evolute.entity.ForeignKey( CurTopicosAulas.class, CurTopicosAulas.TOPICO_ID, db.data.siprp_local.outer.CurTopicosData.class, db.data.siprp_local.outer.CurTopicosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyaula_idTocur_aulas = + new com.evolute.entity.ForeignKey( CurTopicosAulas.class, CurTopicosAulas.AULA_ID, db.data.siprp_local.outer.CurAulasData.class, db.data.siprp_local.outer.CurAulasData.ID ); + + public static final String TABLENAME = "cur_topicos_aulas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.cur_topicos_aulas"; + + public static final int _INVALID__INDEX = -1; + public static final String TOPICO_ID = "topico_id"; + public static final String TOPICO_ID_FULL = "cur_topicos_aulas.topico_id"; + public static final int TOPICO_ID_INDEX = 0; + public static final String TO_TOPICO_ID = "to_topico_id"; + public static final String TO_TOPICO_ID_FULL = "cur_topicos_aulas.to_topico_id"; + public static final int TO_TOPICO_ID_INDEX = 1; + public static final String AULA_ID = "aula_id"; + public static final String AULA_ID_FULL = "cur_topicos_aulas.aula_id"; + public static final int AULA_ID_INDEX = 2; + public static final String TO_AULA_ID = "to_aula_id"; + public static final String TO_AULA_ID_FULL = "cur_topicos_aulas.to_aula_id"; + public static final int TO_AULA_ID_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "cur_topicos_aulas.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + TOPICO_ID, AULA_ID, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + TOPICO_ID, AULA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + TOPICO_ID, AULA_ID, DELETED_DATE, }; + + private Integer topico_id; + private db.data.siprp_local.outer.CurTopicosData to_topico_id; + private Integer aula_id; + private db.data.siprp_local.outer.CurAulasData to_aula_id; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public CurTopicosAulas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getTopico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TOPICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.topico_id; + } + + public void setTopico_id( Integer topico_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TOPICO_ID, topico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.topico_id = topico_id; + LAZY_LOADED_OBJECTS.put( TOPICO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurTopicosData toTopico_id() + { + try + { + prepare( TO_TOPICO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_topico_id; + } + + public void setToTopico_id( db.data.siprp_local.outer.CurTopicosData to_topico_id ) + { + try + { + preProcess( TO_TOPICO_ID, to_topico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_topico_id = to_topico_id; + } + + public Integer getAula_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AULA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.aula_id; + } + + public void setAula_id( Integer aula_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( AULA_ID, aula_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.aula_id = aula_id; + LAZY_LOADED_OBJECTS.put( AULA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.CurAulasData toAula_id() + { + try + { + prepare( TO_AULA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_aula_id; + } + + public void setToAula_id( db.data.siprp_local.outer.CurAulasData to_aula_id ) + { + try + { + preProcess( TO_AULA_ID, to_aula_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_aula_id = to_aula_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicosAulas.TOPICO_ID_INDEX: + value = getTopico_id(); + break; + case CurTopicosAulas.TO_TOPICO_ID_INDEX: + value = toTopico_id(); + break; + case CurTopicosAulas.AULA_ID_INDEX: + value = getAula_id(); + break; + case CurTopicosAulas.TO_AULA_ID_INDEX: + value = toAula_id(); + break; + case CurTopicosAulas.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicosAulas.TOPICO_ID_INDEX: + value = this.topico_id; + break; + case CurTopicosAulas.TO_TOPICO_ID_INDEX: + value = this.to_topico_id; + break; + case CurTopicosAulas.AULA_ID_INDEX: + value = this.aula_id; + break; + case CurTopicosAulas.TO_AULA_ID_INDEX: + value = this.to_aula_id; + break; + case CurTopicosAulas.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicosAulas.TOPICO_ID_INDEX: + setTopico_id( ( Integer ) value ); + break; + case CurTopicosAulas.TO_TOPICO_ID_INDEX: + setToTopico_id( ( db.data.siprp_local.outer.CurTopicosData ) value ); + break; + case CurTopicosAulas.AULA_ID_INDEX: + setAula_id( ( Integer ) value ); + break; + case CurTopicosAulas.TO_AULA_ID_INDEX: + setToAula_id( ( db.data.siprp_local.outer.CurAulasData ) value ); + break; + case CurTopicosAulas.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case CurTopicosAulas.TOPICO_ID_INDEX: + this.topico_id = ( Integer ) value; + break; + case CurTopicosAulas.TO_TOPICO_ID_INDEX: + this.to_topico_id = ( db.data.siprp_local.outer.CurTopicosData ) value; + break; + case CurTopicosAulas.AULA_ID_INDEX: + this.aula_id = ( Integer ) value; + break; + case CurTopicosAulas.TO_AULA_ID_INDEX: + this.to_aula_id = ( db.data.siprp_local.outer.CurAulasData ) value; + break; + case CurTopicosAulas.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on CurTopicosAulas is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case CurTopicosAulas.TOPICO_ID_INDEX: + theClass = Integer.class; + break; + case CurTopicosAulas.TO_TOPICO_ID_INDEX: + theClass = db.data.siprp_local.outer.CurTopicosData.class; + break; + case CurTopicosAulas.AULA_ID_INDEX: + theClass = Integer.class; + break; + case CurTopicosAulas.TO_AULA_ID_INDEX: + theClass = db.data.siprp_local.outer.CurAulasData.class; + break; + case CurTopicosAulas.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : CurTopicosAulas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, CurTopicosAulas.PK_FIELD_NAMES ); + primaryKey.set( 0, getTopico_id() ); + primaryKey.set( 1, getAula_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EcdOficial.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EcdOficial.java new file mode 100644 index 00000000..c15ccd05 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EcdOficial.java @@ -0,0 +1,445 @@ +/* +* EcdOficial.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EcdOficial extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EcdOficial.ID, EcdOficial.ID_INDEX ); + FIELD_INDEXES.put( EcdOficial.ID_FULL, EcdOficial.ID_INDEX ); + FIELD_INDEXES.put( EcdOficial.DESCRICAO, EcdOficial.DESCRICAO_INDEX ); + FIELD_INDEXES.put( EcdOficial.DESCRICAO_FULL, EcdOficial.DESCRICAO_INDEX ); + FIELD_INDEXES.put( EcdOficial.DESCRICAO_PLAIN, EcdOficial.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( EcdOficial.DESCRICAO_PLAIN_FULL, EcdOficial.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( EcdOficial.ORDEM, EcdOficial.ORDEM_INDEX ); + FIELD_INDEXES.put( EcdOficial.ORDEM_FULL, EcdOficial.ORDEM_INDEX ); + FIELD_INDEXES.put( EcdOficial.ACTIVO, EcdOficial.ACTIVO_INDEX ); + FIELD_INDEXES.put( EcdOficial.ACTIVO_FULL, EcdOficial.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "ecd_oficial"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.ecd_oficial"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "ecd_oficial.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "ecd_oficial.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DESCRICAO_PLAIN = "descricao_plain"; + public static final String DESCRICAO_PLAIN_FULL = "ecd_oficial.descricao_plain"; + public static final int DESCRICAO_PLAIN_INDEX = 2; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "ecd_oficial.ordem"; + public static final int ORDEM_INDEX = 3; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "ecd_oficial.activo"; + public static final int ACTIVO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + ORDEM, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, }; + + private Integer id; + private String descricao; + private String descricao_plain; + private Integer ordem; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EcdOficial() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromTrabalhadoresEcd_ecd_oficial_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdData.class , getPrimaryKey().getMap().get("id"), "ecd_oficial_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getDescricao_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao_plain; + } + + public void setDescricao_plain( String descricao_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO_PLAIN, descricao_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao_plain = descricao_plain; + LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EcdOficial.ID_INDEX: + value = getId(); + break; + case EcdOficial.DESCRICAO_INDEX: + value = getDescricao(); + break; + case EcdOficial.DESCRICAO_PLAIN_INDEX: + value = getDescricao_plain(); + break; + case EcdOficial.ORDEM_INDEX: + value = getOrdem(); + break; + case EcdOficial.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EcdOficial.ID_INDEX: + value = this.id; + break; + case EcdOficial.DESCRICAO_INDEX: + value = this.descricao; + break; + case EcdOficial.DESCRICAO_PLAIN_INDEX: + value = this.descricao_plain; + break; + case EcdOficial.ORDEM_INDEX: + value = this.ordem; + break; + case EcdOficial.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EcdOficial.ID_INDEX: + setId( ( Integer ) value ); + break; + case EcdOficial.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case EcdOficial.DESCRICAO_PLAIN_INDEX: + setDescricao_plain( ( String ) value ); + break; + case EcdOficial.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case EcdOficial.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EcdOficial.ID_INDEX: + this.id = ( Integer ) value; + break; + case EcdOficial.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case EcdOficial.DESCRICAO_PLAIN_INDEX: + this.descricao_plain = ( String ) value; + break; + case EcdOficial.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case EcdOficial.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EcdOficial.ID_INDEX: + theClass = Integer.class; + break; + case EcdOficial.DESCRICAO_INDEX: + theClass = String.class; + break; + case EcdOficial.DESCRICAO_PLAIN_INDEX: + theClass = String.class; + break; + case EcdOficial.ORDEM_INDEX: + theClass = Integer.class; + break; + case EcdOficial.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EcdOficial._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EcdOficial.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmailPlanoDeActuacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmailPlanoDeActuacao.java new file mode 100644 index 00000000..a44a0108 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmailPlanoDeActuacao.java @@ -0,0 +1,381 @@ +/* +* EmailPlanoDeActuacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EmailPlanoDeActuacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EmailPlanoDeActuacao.ID, EmailPlanoDeActuacao.ID_INDEX ); + FIELD_INDEXES.put( EmailPlanoDeActuacao.ID_FULL, EmailPlanoDeActuacao.ID_INDEX ); + FIELD_INDEXES.put( EmailPlanoDeActuacao.DESCRIPTION, EmailPlanoDeActuacao.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( EmailPlanoDeActuacao.DESCRIPTION_FULL, EmailPlanoDeActuacao.DESCRIPTION_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( EmailPlanoDeActuacao.CLASS_IDENTIFIER, EmailPlanoDeActuacao.ESTABELECIMENTO_ID, EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( EmailPlanoDeActuacao.ESTABELECIMENTO_ID, EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( EmailPlanoDeActuacao.ESTABELECIMENTO_ID_FULL, EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID, EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( EmailPlanoDeActuacao.class, EmailPlanoDeActuacao.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "email_plano_de_actuacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.email_plano_de_actuacao"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "email_plano_de_actuacao.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "email_plano_de_actuacao.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "email_plano_de_actuacao.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 2; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "email_plano_de_actuacao.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, ESTABELECIMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, ESTABELECIMENTO_ID, }; + + private Integer id; + private String description; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EmailPlanoDeActuacao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmailPlanoDeActuacao.ID_INDEX: + value = getId(); + break; + case EmailPlanoDeActuacao.DESCRIPTION_INDEX: + value = getDescription(); + break; + case EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmailPlanoDeActuacao.ID_INDEX: + value = this.id; + break; + case EmailPlanoDeActuacao.DESCRIPTION_INDEX: + value = this.description; + break; + case EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmailPlanoDeActuacao.ID_INDEX: + setId( ( Integer ) value ); + break; + case EmailPlanoDeActuacao.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmailPlanoDeActuacao.ID_INDEX: + this.id = ( Integer ) value; + break; + case EmailPlanoDeActuacao.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EmailPlanoDeActuacao.ID_INDEX: + theClass = Integer.class; + break; + case EmailPlanoDeActuacao.DESCRIPTION_INDEX: + theClass = String.class; + break; + case EmailPlanoDeActuacao.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case EmailPlanoDeActuacao.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EmailPlanoDeActuacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EmailPlanoDeActuacao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoPeriodicidadeTipo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoPeriodicidadeTipo.java new file mode 100644 index 00000000..f168ec2c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoPeriodicidadeTipo.java @@ -0,0 +1,294 @@ +/* +* EmpresaPrecoPeriodicidadeTipo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EmpresaPrecoPeriodicidadeTipo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EmpresaPrecoPeriodicidadeTipo.ID, EmpresaPrecoPeriodicidadeTipo.ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoPeriodicidadeTipo.ID_FULL, EmpresaPrecoPeriodicidadeTipo.ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoPeriodicidadeTipo.NOME, EmpresaPrecoPeriodicidadeTipo.NOME_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoPeriodicidadeTipo.NOME_FULL, EmpresaPrecoPeriodicidadeTipo.NOME_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "empresa_preco_periodicidade_tipo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.empresa_preco_periodicidade_tipo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "empresa_preco_periodicidade_tipo.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "empresa_preco_periodicidade_tipo.nome"; + public static final int NOME_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, }; + + private Integer id; + private String nome; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EmpresaPrecoPeriodicidadeTipo() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEmpresaPrecoServico_empresa_preco_periodicidade_tipo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmpresaPrecoServicoData.class , getPrimaryKey().getMap().get("id"), "empresa_preco_periodicidade_tipo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoPeriodicidadeTipo.ID_INDEX: + value = getId(); + break; + case EmpresaPrecoPeriodicidadeTipo.NOME_INDEX: + value = getNome(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoPeriodicidadeTipo.ID_INDEX: + value = this.id; + break; + case EmpresaPrecoPeriodicidadeTipo.NOME_INDEX: + value = this.nome; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoPeriodicidadeTipo.ID_INDEX: + setId( ( Integer ) value ); + break; + case EmpresaPrecoPeriodicidadeTipo.NOME_INDEX: + setNome( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoPeriodicidadeTipo.ID_INDEX: + this.id = ( Integer ) value; + break; + case EmpresaPrecoPeriodicidadeTipo.NOME_INDEX: + this.nome = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EmpresaPrecoPeriodicidadeTipo.ID_INDEX: + theClass = Integer.class; + break; + case EmpresaPrecoPeriodicidadeTipo.NOME_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EmpresaPrecoPeriodicidadeTipo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EmpresaPrecoPeriodicidadeTipo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoServico.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoServico.java new file mode 100644 index 00000000..7fc39103 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoServico.java @@ -0,0 +1,739 @@ +/* +* EmpresaPrecoServico.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EmpresaPrecoServico extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EmpresaPrecoServico.ID, EmpresaPrecoServico.ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.ID_FULL, EmpresaPrecoServico.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( EmpresaPrecoServico.CLASS_IDENTIFIER, EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID, EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID ); + FIELD_INDEXES.put( EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID, EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_FULL, EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID, EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( EmpresaPrecoServico.CLASS_IDENTIFIER, EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID ); + FIELD_INDEXES.put( EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_FULL, EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.TIPO_OUTRO, EmpresaPrecoServico.TIPO_OUTRO_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.TIPO_OUTRO_FULL, EmpresaPrecoServico.TIPO_OUTRO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( EmpresaPrecoServico.CLASS_IDENTIFIER, EmpresaPrecoServico.EMPRESA_ID, EmpresaPrecoServico.TO_EMPRESA_ID ); + FIELD_INDEXES.put( EmpresaPrecoServico.EMPRESA_ID, EmpresaPrecoServico.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.EMPRESA_ID_FULL, EmpresaPrecoServico.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.TO_EMPRESA_ID, EmpresaPrecoServico.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.VALOR, EmpresaPrecoServico.VALOR_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.VALOR_FULL, EmpresaPrecoServico.VALOR_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.INICIADO, EmpresaPrecoServico.INICIADO_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.INICIADO_FULL, EmpresaPrecoServico.INICIADO_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.ACTIVO, EmpresaPrecoServico.ACTIVO_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServico.ACTIVO_FULL, EmpresaPrecoServico.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_preco_servico_tipo_idToempresa_preco_servico_tipo = + new com.evolute.entity.ForeignKey( EmpresaPrecoServico.class, EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID, db.data.siprp_local.outer.EmpresaPrecoServicoTipoData.class, db.data.siprp_local.outer.EmpresaPrecoServicoTipoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_preco_periodicidade_tipo_idToempresa_preco_periodicidade_tipo = + new com.evolute.entity.ForeignKey( EmpresaPrecoServico.class, EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData.class, db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( EmpresaPrecoServico.class, EmpresaPrecoServico.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "empresa_preco_servico"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.empresa_preco_servico"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "empresa_preco_servico.id"; + public static final int ID_INDEX = 0; + public static final String EMPRESA_PRECO_SERVICO_TIPO_ID = "empresa_preco_servico_tipo_id"; + public static final String EMPRESA_PRECO_SERVICO_TIPO_ID_FULL = "empresa_preco_servico.empresa_preco_servico_tipo_id"; + public static final int EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX = 1; + public static final String TO_EMPRESA_PRECO_SERVICO_TIPO_ID = "to_empresa_preco_servico_tipo_id"; + public static final String TO_EMPRESA_PRECO_SERVICO_TIPO_ID_FULL = "empresa_preco_servico.to_empresa_preco_servico_tipo_id"; + public static final int TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX = 2; + public static final String EMPRESA_PRECO_PERIODICIDADE_TIPO_ID = "empresa_preco_periodicidade_tipo_id"; + public static final String EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_FULL = "empresa_preco_servico.empresa_preco_periodicidade_tipo_id"; + public static final int EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX = 3; + public static final String TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID = "to_empresa_preco_periodicidade_tipo_id"; + public static final String TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_FULL = "empresa_preco_servico.to_empresa_preco_periodicidade_tipo_id"; + public static final int TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX = 4; + public static final String TIPO_OUTRO = "tipo_outro"; + public static final String TIPO_OUTRO_FULL = "empresa_preco_servico.tipo_outro"; + public static final int TIPO_OUTRO_INDEX = 5; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "empresa_preco_servico.empresa_id"; + public static final int EMPRESA_ID_INDEX = 6; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "empresa_preco_servico.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 7; + public static final String VALOR = "valor"; + public static final String VALOR_FULL = "empresa_preco_servico.valor"; + public static final int VALOR_INDEX = 8; + public static final String INICIADO = "iniciado"; + public static final String INICIADO_FULL = "empresa_preco_servico.iniciado"; + public static final int INICIADO_INDEX = 9; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "empresa_preco_servico.activo"; + public static final int ACTIVO_INDEX = 10; + + public static final String FIELD_NAMES[] = new String[]{ + EMPRESA_PRECO_SERVICO_TIPO_ID, TO_EMPRESA_PRECO_SERVICO_TIPO_ID, + EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, + TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, TIPO_OUTRO, EMPRESA_ID, + TO_EMPRESA_ID, VALOR, INICIADO, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + EMPRESA_PRECO_SERVICO_TIPO_ID, TABLENAME + "." + TO_EMPRESA_PRECO_SERVICO_TIPO_ID, + TABLENAME + "." + EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, + TABLENAME + "." + TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, TABLENAME + "." + TIPO_OUTRO, TABLENAME + "." + EMPRESA_ID, + TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + VALOR, TABLENAME + "." + INICIADO, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, EMPRESA_PRECO_SERVICO_TIPO_ID, EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, + TIPO_OUTRO, EMPRESA_ID, VALOR, INICIADO, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, EMPRESA_PRECO_SERVICO_TIPO_ID, EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, + TIPO_OUTRO, EMPRESA_ID, VALOR, INICIADO, ACTIVO, }; + + private Integer id; + private Integer empresa_preco_servico_tipo_id; + private db.data.siprp_local.outer.EmpresaPrecoServicoTipoData to_empresa_preco_servico_tipo_id; + private Integer empresa_preco_periodicidade_tipo_id; + private db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData to_empresa_preco_periodicidade_tipo_id; + private String tipo_outro; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private Double valor; + private java.sql.Timestamp iniciado; + private Boolean activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EmpresaPrecoServico() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getEmpresa_preco_servico_tipo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_PRECO_SERVICO_TIPO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_preco_servico_tipo_id; + } + + public void setEmpresa_preco_servico_tipo_id( Integer empresa_preco_servico_tipo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_PRECO_SERVICO_TIPO_ID, empresa_preco_servico_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_preco_servico_tipo_id = empresa_preco_servico_tipo_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_PRECO_SERVICO_TIPO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresaPrecoServicoTipoData toEmpresa_preco_servico_tipo_id() + { + try + { + prepare( TO_EMPRESA_PRECO_SERVICO_TIPO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_preco_servico_tipo_id; + } + + public void setToEmpresa_preco_servico_tipo_id( db.data.siprp_local.outer.EmpresaPrecoServicoTipoData to_empresa_preco_servico_tipo_id ) + { + try + { + preProcess( TO_EMPRESA_PRECO_SERVICO_TIPO_ID, to_empresa_preco_servico_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_preco_servico_tipo_id = to_empresa_preco_servico_tipo_id; + } + + public Integer getEmpresa_preco_periodicidade_tipo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_PRECO_PERIODICIDADE_TIPO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_preco_periodicidade_tipo_id; + } + + public void setEmpresa_preco_periodicidade_tipo_id( Integer empresa_preco_periodicidade_tipo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, empresa_preco_periodicidade_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_preco_periodicidade_tipo_id = empresa_preco_periodicidade_tipo_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData toEmpresa_preco_periodicidade_tipo_id() + { + try + { + prepare( TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_preco_periodicidade_tipo_id; + } + + public void setToEmpresa_preco_periodicidade_tipo_id( db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData to_empresa_preco_periodicidade_tipo_id ) + { + try + { + preProcess( TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID, to_empresa_preco_periodicidade_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_preco_periodicidade_tipo_id = to_empresa_preco_periodicidade_tipo_id; + } + + public String getTipo_outro() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_OUTRO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_outro; + } + + public void setTipo_outro( String tipo_outro ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO_OUTRO, tipo_outro ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_outro = tipo_outro; + LAZY_LOADED_OBJECTS.put( TIPO_OUTRO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Double getValor() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor; + } + + public void setValor( Double valor ) + { + try + { + setLockedForRefresh( true ); + preProcess( VALOR, valor ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor = valor; + LAZY_LOADED_OBJECTS.put( VALOR, Boolean.TRUE ); + } + + public java.sql.Timestamp getIniciado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INICIADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.iniciado; + } + + public void setIniciado( java.sql.Timestamp iniciado ) + { + try + { + setLockedForRefresh( true ); + preProcess( INICIADO, iniciado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.iniciado = iniciado; + LAZY_LOADED_OBJECTS.put( INICIADO, Boolean.TRUE ); + } + + public Boolean getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( Boolean activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServico.ID_INDEX: + value = getId(); + break; + case EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + value = getEmpresa_preco_servico_tipo_id(); + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + value = toEmpresa_preco_servico_tipo_id(); + break; + case EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + value = getEmpresa_preco_periodicidade_tipo_id(); + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + value = toEmpresa_preco_periodicidade_tipo_id(); + break; + case EmpresaPrecoServico.TIPO_OUTRO_INDEX: + value = getTipo_outro(); + break; + case EmpresaPrecoServico.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case EmpresaPrecoServico.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case EmpresaPrecoServico.VALOR_INDEX: + value = getValor(); + break; + case EmpresaPrecoServico.INICIADO_INDEX: + value = getIniciado(); + break; + case EmpresaPrecoServico.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServico.ID_INDEX: + value = this.id; + break; + case EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + value = this.empresa_preco_servico_tipo_id; + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + value = this.to_empresa_preco_servico_tipo_id; + break; + case EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + value = this.empresa_preco_periodicidade_tipo_id; + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + value = this.to_empresa_preco_periodicidade_tipo_id; + break; + case EmpresaPrecoServico.TIPO_OUTRO_INDEX: + value = this.tipo_outro; + break; + case EmpresaPrecoServico.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case EmpresaPrecoServico.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case EmpresaPrecoServico.VALOR_INDEX: + value = this.valor; + break; + case EmpresaPrecoServico.INICIADO_INDEX: + value = this.iniciado; + break; + case EmpresaPrecoServico.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServico.ID_INDEX: + setId( ( Integer ) value ); + break; + case EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + setEmpresa_preco_servico_tipo_id( ( Integer ) value ); + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + setToEmpresa_preco_servico_tipo_id( ( db.data.siprp_local.outer.EmpresaPrecoServicoTipoData ) value ); + break; + case EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + setEmpresa_preco_periodicidade_tipo_id( ( Integer ) value ); + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + setToEmpresa_preco_periodicidade_tipo_id( ( db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData ) value ); + break; + case EmpresaPrecoServico.TIPO_OUTRO_INDEX: + setTipo_outro( ( String ) value ); + break; + case EmpresaPrecoServico.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case EmpresaPrecoServico.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case EmpresaPrecoServico.VALOR_INDEX: + setValor( ( Double ) value ); + break; + case EmpresaPrecoServico.INICIADO_INDEX: + setIniciado( ( java.sql.Timestamp ) value ); + break; + case EmpresaPrecoServico.ACTIVO_INDEX: + setActivo( ( Boolean ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServico.ID_INDEX: + this.id = ( Integer ) value; + break; + case EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + this.empresa_preco_servico_tipo_id = ( Integer ) value; + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + this.to_empresa_preco_servico_tipo_id = ( db.data.siprp_local.outer.EmpresaPrecoServicoTipoData ) value; + break; + case EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + this.empresa_preco_periodicidade_tipo_id = ( Integer ) value; + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + this.to_empresa_preco_periodicidade_tipo_id = ( db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData ) value; + break; + case EmpresaPrecoServico.TIPO_OUTRO_INDEX: + this.tipo_outro = ( String ) value; + break; + case EmpresaPrecoServico.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case EmpresaPrecoServico.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case EmpresaPrecoServico.VALOR_INDEX: + this.valor = ( Double ) value; + break; + case EmpresaPrecoServico.INICIADO_INDEX: + this.iniciado = ( java.sql.Timestamp ) value; + break; + case EmpresaPrecoServico.ACTIVO_INDEX: + this.activo = ( Boolean ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EmpresaPrecoServico.ID_INDEX: + theClass = Integer.class; + break; + case EmpresaPrecoServico.EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + theClass = Integer.class; + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_SERVICO_TIPO_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresaPrecoServicoTipoData.class; + break; + case EmpresaPrecoServico.EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + theClass = Integer.class; + break; + case EmpresaPrecoServico.TO_EMPRESA_PRECO_PERIODICIDADE_TIPO_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresaPrecoPeriodicidadeTipoData.class; + break; + case EmpresaPrecoServico.TIPO_OUTRO_INDEX: + theClass = String.class; + break; + case EmpresaPrecoServico.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case EmpresaPrecoServico.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case EmpresaPrecoServico.VALOR_INDEX: + theClass = Double.class; + break; + case EmpresaPrecoServico.INICIADO_INDEX: + theClass = java.sql.Timestamp.class; + break; + case EmpresaPrecoServico.ACTIVO_INDEX: + theClass = Boolean.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EmpresaPrecoServico._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EmpresaPrecoServico.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoServicoTipo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoServicoTipo.java new file mode 100644 index 00000000..5260dbfa --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EmpresaPrecoServicoTipo.java @@ -0,0 +1,294 @@ +/* +* EmpresaPrecoServicoTipo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EmpresaPrecoServicoTipo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EmpresaPrecoServicoTipo.ID, EmpresaPrecoServicoTipo.ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServicoTipo.ID_FULL, EmpresaPrecoServicoTipo.ID_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServicoTipo.NOME, EmpresaPrecoServicoTipo.NOME_INDEX ); + FIELD_INDEXES.put( EmpresaPrecoServicoTipo.NOME_FULL, EmpresaPrecoServicoTipo.NOME_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "empresa_preco_servico_tipo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.empresa_preco_servico_tipo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "empresa_preco_servico_tipo.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "empresa_preco_servico_tipo.nome"; + public static final int NOME_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, }; + + private Integer id; + private String nome; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EmpresaPrecoServicoTipo() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEmpresaPrecoServico_empresa_preco_servico_tipo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmpresaPrecoServicoData.class , getPrimaryKey().getMap().get("id"), "empresa_preco_servico_tipo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServicoTipo.ID_INDEX: + value = getId(); + break; + case EmpresaPrecoServicoTipo.NOME_INDEX: + value = getNome(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServicoTipo.ID_INDEX: + value = this.id; + break; + case EmpresaPrecoServicoTipo.NOME_INDEX: + value = this.nome; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServicoTipo.ID_INDEX: + setId( ( Integer ) value ); + break; + case EmpresaPrecoServicoTipo.NOME_INDEX: + setNome( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EmpresaPrecoServicoTipo.ID_INDEX: + this.id = ( Integer ) value; + break; + case EmpresaPrecoServicoTipo.NOME_INDEX: + this.nome = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EmpresaPrecoServicoTipo.ID_INDEX: + theClass = Integer.class; + break; + case EmpresaPrecoServicoTipo.NOME_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EmpresaPrecoServicoTipo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EmpresaPrecoServicoTipo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Empresas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Empresas.java new file mode 100644 index 00000000..3e73f792 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Empresas.java @@ -0,0 +1,2726 @@ +/* +* Empresas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Empresas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Empresas.ID, Empresas.ID_INDEX ); + FIELD_INDEXES.put( Empresas.ID_FULL, Empresas.ID_INDEX ); + FIELD_INDEXES.put( Empresas.DESIGNACAO_SOCIAL, Empresas.DESIGNACAO_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.DESIGNACAO_SOCIAL_FULL, Empresas.DESIGNACAO_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_SAUDE_TIPO, Empresas.SERVICO_SAUDE_TIPO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_SAUDE_TIPO_FULL, Empresas.SERVICO_SAUDE_TIPO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_SAUDE_DESIGNACAO, Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_SAUDE_DESIGNACAO_FULL, Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_HIGIENE_TIPO, Empresas.SERVICO_HIGIENE_TIPO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_HIGIENE_TIPO_FULL, Empresas.SERVICO_HIGIENE_TIPO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_HIGIENE_DESIGNACAO, Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICO_HIGIENE_DESIGNACAO_FULL, Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX ); + FIELD_INDEXES.put( Empresas.INACTIVO, Empresas.INACTIVO_INDEX ); + FIELD_INDEXES.put( Empresas.INACTIVO_FULL, Empresas.INACTIVO_INDEX ); + FIELD_INDEXES.put( Empresas.MORADA, Empresas.MORADA_INDEX ); + FIELD_INDEXES.put( Empresas.MORADA_FULL, Empresas.MORADA_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_POSTAL, Empresas.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_POSTAL_FULL, Empresas.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Empresas.LOCALIDADE, Empresas.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.LOCALIDADE_FULL, Empresas.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.DISTRITO, Empresas.DISTRITO_INDEX ); + FIELD_INDEXES.put( Empresas.DISTRITO_FULL, Empresas.DISTRITO_INDEX ); + FIELD_INDEXES.put( Empresas.CONCELHO, Empresas.CONCELHO_INDEX ); + FIELD_INDEXES.put( Empresas.CONCELHO_FULL, Empresas.CONCELHO_INDEX ); + FIELD_INDEXES.put( Empresas.NUMERO_TRABALHADORES, Empresas.NUMERO_TRABALHADORES_INDEX ); + FIELD_INDEXES.put( Empresas.NUMERO_TRABALHADORES_FULL, Empresas.NUMERO_TRABALHADORES_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_PROPOSTA, Empresas.DATA_PROPOSTA_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_PROPOSTA_FULL, Empresas.DATA_PROPOSTA_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_ACEITACAO, Empresas.DATA_ACEITACAO_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_ACEITACAO_FULL, Empresas.DATA_ACEITACAO_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_1, Empresas.PERFIL_1_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_1_FULL, Empresas.PERFIL_1_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_2, Empresas.PERFIL_2_INDEX ); + FIELD_INDEXES.put( Empresas.PERFIL_2_FULL, Empresas.PERFIL_2_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_ENVIO_CONTRATO, Empresas.DATA_ENVIO_CONTRATO_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_ENVIO_CONTRATO_FULL, Empresas.DATA_ENVIO_CONTRATO_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_RECEPCAO_CONTRATO, Empresas.DATA_RECEPCAO_CONTRATO_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_RECEPCAO_CONTRATO_FULL, Empresas.DATA_RECEPCAO_CONTRATO_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_ENVIO_IDICT, Empresas.DATA_ENVIO_IDICT_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_ENVIO_IDICT_FULL, Empresas.DATA_ENVIO_IDICT_INDEX ); + FIELD_INDEXES.put( Empresas.CAE, Empresas.CAE_INDEX ); + FIELD_INDEXES.put( Empresas.CAE_FULL, Empresas.CAE_INDEX ); + FIELD_INDEXES.put( Empresas.CONTRIBUINTE, Empresas.CONTRIBUINTE_INDEX ); + FIELD_INDEXES.put( Empresas.CONTRIBUINTE_FULL, Empresas.CONTRIBUINTE_INDEX ); + FIELD_INDEXES.put( Empresas.SEGURANCA_SOCIAL, Empresas.SEGURANCA_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.SEGURANCA_SOCIAL_FULL, Empresas.SEGURANCA_SOCIAL_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_1, Empresas.CODIGO_1_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_1_FULL, Empresas.CODIGO_1_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_2, Empresas.CODIGO_2_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_2_FULL, Empresas.CODIGO_2_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_3, Empresas.CODIGO_3_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_3_FULL, Empresas.CODIGO_3_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICOS, Empresas.SERVICOS_INDEX ); + FIELD_INDEXES.put( Empresas.SERVICOS_FULL, Empresas.SERVICOS_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Empresas.CLASS_IDENTIFIER, Empresas.CONTACTO_1, Empresas.TO_CONTACTO_1 ); + FIELD_INDEXES.put( Empresas.CONTACTO_1, Empresas.CONTACTO_1_INDEX ); + FIELD_INDEXES.put( Empresas.CONTACTO_1_FULL, Empresas.CONTACTO_1_INDEX ); + FIELD_INDEXES.put( Empresas.TO_CONTACTO_1, Empresas.TO_CONTACTO_1_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Empresas.CLASS_IDENTIFIER, Empresas.CONTACTO_2, Empresas.TO_CONTACTO_2 ); + FIELD_INDEXES.put( Empresas.CONTACTO_2, Empresas.CONTACTO_2_INDEX ); + FIELD_INDEXES.put( Empresas.CONTACTO_2_FULL, Empresas.CONTACTO_2_INDEX ); + FIELD_INDEXES.put( Empresas.TO_CONTACTO_2, Empresas.TO_CONTACTO_2_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_RELATORIO_ANUAL, Empresas.DATA_RELATORIO_ANUAL_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_RELATORIO_ANUAL_FULL, Empresas.DATA_RELATORIO_ANUAL_INDEX ); + FIELD_INDEXES.put( Empresas.PERIODICIDADE, Empresas.PERIODICIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.PERIODICIDADE_FULL, Empresas.PERIODICIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.ACTIVIDADE, Empresas.ACTIVIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.ACTIVIDADE_FULL, Empresas.ACTIVIDADE_INDEX ); + FIELD_INDEXES.put( Empresas.ACTUALIZACAO, Empresas.ACTUALIZACAO_INDEX ); + FIELD_INDEXES.put( Empresas.ACTUALIZACAO_FULL, Empresas.ACTUALIZACAO_INDEX ); + FIELD_INDEXES.put( Empresas.DESIGNACAO_SOCIAL_PLAIN, Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX ); + FIELD_INDEXES.put( Empresas.DESIGNACAO_SOCIAL_PLAIN_FULL, Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX ); + FIELD_INDEXES.put( Empresas.A_CONSULTAS, Empresas.A_CONSULTAS_INDEX ); + FIELD_INDEXES.put( Empresas.A_CONSULTAS_FULL, Empresas.A_CONSULTAS_INDEX ); + FIELD_INDEXES.put( Empresas.A_EXAMES, Empresas.A_EXAMES_INDEX ); + FIELD_INDEXES.put( Empresas.A_EXAMES_FULL, Empresas.A_EXAMES_INDEX ); + FIELD_INDEXES.put( Empresas.B_CONSULTAS, Empresas.B_CONSULTAS_INDEX ); + FIELD_INDEXES.put( Empresas.B_CONSULTAS_FULL, Empresas.B_CONSULTAS_INDEX ); + FIELD_INDEXES.put( Empresas.B_EXAMES, Empresas.B_EXAMES_INDEX ); + FIELD_INDEXES.put( Empresas.B_EXAMES_FULL, Empresas.B_EXAMES_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_CANCELAMENTO, Empresas.DATA_CANCELAMENTO_INDEX ); + FIELD_INDEXES.put( Empresas.DATA_CANCELAMENTO_FULL, Empresas.DATA_CANCELAMENTO_INDEX ); + FIELD_INDEXES.put( Empresas.DURACAO, Empresas.DURACAO_INDEX ); + FIELD_INDEXES.put( Empresas.DURACAO_FULL, Empresas.DURACAO_INDEX ); + FIELD_INDEXES.put( Empresas.INICIO_CONTRATO, Empresas.INICIO_CONTRATO_INDEX ); + FIELD_INDEXES.put( Empresas.INICIO_CONTRATO_FULL, Empresas.INICIO_CONTRATO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Empresas.CLASS_IDENTIFIER, Empresas.EMPRESA_LOGO_ID, Empresas.TO_EMPRESA_LOGO_ID ); + FIELD_INDEXES.put( Empresas.EMPRESA_LOGO_ID, Empresas.EMPRESA_LOGO_ID_INDEX ); + FIELD_INDEXES.put( Empresas.EMPRESA_LOGO_ID_FULL, Empresas.EMPRESA_LOGO_ID_INDEX ); + FIELD_INDEXES.put( Empresas.TO_EMPRESA_LOGO_ID, Empresas.TO_EMPRESA_LOGO_ID_INDEX ); + FIELD_INDEXES.put( Empresas.IMPRIMIR_TABELA_ALARGADA, Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX ); + FIELD_INDEXES.put( Empresas.IMPRIMIR_TABELA_ALARGADA_FULL, Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_RELATORIO_UNICO, Empresas.CODIGO_RELATORIO_UNICO_INDEX ); + FIELD_INDEXES.put( Empresas.CODIGO_RELATORIO_UNICO_FULL, Empresas.CODIGO_RELATORIO_UNICO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeycontacto_1Tocontactos = + new com.evolute.entity.ForeignKey( Empresas.class, Empresas.CONTACTO_1, db.data.siprp_local.outer.ContactosData.class, db.data.siprp_local.outer.ContactosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycontacto_2Tocontactos = + new com.evolute.entity.ForeignKey( Empresas.class, Empresas.CONTACTO_2, db.data.siprp_local.outer.ContactosData.class, db.data.siprp_local.outer.ContactosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_logo_idToimage = + new com.evolute.entity.ForeignKey( Empresas.class, Empresas.EMPRESA_LOGO_ID, db.data.siprp_local.outer.ImageData.class, db.data.siprp_local.outer.ImageData.ID ); + + public static final String TABLENAME = "empresas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.empresas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "empresas.id"; + public static final int ID_INDEX = 0; + public static final String DESIGNACAO_SOCIAL = "designacao_social"; + public static final String DESIGNACAO_SOCIAL_FULL = "empresas.designacao_social"; + public static final int DESIGNACAO_SOCIAL_INDEX = 1; + public static final String SERVICO_SAUDE_TIPO = "servico_saude_tipo"; + public static final String SERVICO_SAUDE_TIPO_FULL = "empresas.servico_saude_tipo"; + public static final int SERVICO_SAUDE_TIPO_INDEX = 2; + public static final String SERVICO_SAUDE_DESIGNACAO = "servico_saude_designacao"; + public static final String SERVICO_SAUDE_DESIGNACAO_FULL = "empresas.servico_saude_designacao"; + public static final int SERVICO_SAUDE_DESIGNACAO_INDEX = 3; + public static final String SERVICO_HIGIENE_TIPO = "servico_higiene_tipo"; + public static final String SERVICO_HIGIENE_TIPO_FULL = "empresas.servico_higiene_tipo"; + public static final int SERVICO_HIGIENE_TIPO_INDEX = 4; + public static final String SERVICO_HIGIENE_DESIGNACAO = "servico_higiene_designacao"; + public static final String SERVICO_HIGIENE_DESIGNACAO_FULL = "empresas.servico_higiene_designacao"; + public static final int SERVICO_HIGIENE_DESIGNACAO_INDEX = 5; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "empresas.inactivo"; + public static final int INACTIVO_INDEX = 6; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "empresas.morada"; + public static final int MORADA_INDEX = 7; + public static final String CODIGO_POSTAL = "codigo_postal"; + public static final String CODIGO_POSTAL_FULL = "empresas.codigo_postal"; + public static final int CODIGO_POSTAL_INDEX = 8; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "empresas.localidade"; + public static final int LOCALIDADE_INDEX = 9; + public static final String DISTRITO = "distrito"; + public static final String DISTRITO_FULL = "empresas.distrito"; + public static final int DISTRITO_INDEX = 10; + public static final String CONCELHO = "concelho"; + public static final String CONCELHO_FULL = "empresas.concelho"; + public static final int CONCELHO_INDEX = 11; + public static final String NUMERO_TRABALHADORES = "numero_trabalhadores"; + public static final String NUMERO_TRABALHADORES_FULL = "empresas.numero_trabalhadores"; + public static final int NUMERO_TRABALHADORES_INDEX = 12; + public static final String DATA_PROPOSTA = "data_proposta"; + public static final String DATA_PROPOSTA_FULL = "empresas.data_proposta"; + public static final int DATA_PROPOSTA_INDEX = 13; + public static final String DATA_ACEITACAO = "data_aceitacao"; + public static final String DATA_ACEITACAO_FULL = "empresas.data_aceitacao"; + public static final int DATA_ACEITACAO_INDEX = 14; + public static final String PERFIL_1 = "perfil_1"; + public static final String PERFIL_1_FULL = "empresas.perfil_1"; + public static final int PERFIL_1_INDEX = 15; + public static final String PERFIL_2 = "perfil_2"; + public static final String PERFIL_2_FULL = "empresas.perfil_2"; + public static final int PERFIL_2_INDEX = 16; + public static final String DATA_ENVIO_CONTRATO = "data_envio_contrato"; + public static final String DATA_ENVIO_CONTRATO_FULL = "empresas.data_envio_contrato"; + public static final int DATA_ENVIO_CONTRATO_INDEX = 17; + public static final String DATA_RECEPCAO_CONTRATO = "data_recepcao_contrato"; + public static final String DATA_RECEPCAO_CONTRATO_FULL = "empresas.data_recepcao_contrato"; + public static final int DATA_RECEPCAO_CONTRATO_INDEX = 18; + public static final String DATA_ENVIO_IDICT = "data_envio_idict"; + public static final String DATA_ENVIO_IDICT_FULL = "empresas.data_envio_idict"; + public static final int DATA_ENVIO_IDICT_INDEX = 19; + public static final String CAE = "cae"; + public static final String CAE_FULL = "empresas.cae"; + public static final int CAE_INDEX = 20; + public static final String CONTRIBUINTE = "contribuinte"; + public static final String CONTRIBUINTE_FULL = "empresas.contribuinte"; + public static final int CONTRIBUINTE_INDEX = 21; + public static final String SEGURANCA_SOCIAL = "seguranca_social"; + public static final String SEGURANCA_SOCIAL_FULL = "empresas.seguranca_social"; + public static final int SEGURANCA_SOCIAL_INDEX = 22; + public static final String CODIGO_1 = "codigo_1"; + public static final String CODIGO_1_FULL = "empresas.codigo_1"; + public static final int CODIGO_1_INDEX = 23; + public static final String CODIGO_2 = "codigo_2"; + public static final String CODIGO_2_FULL = "empresas.codigo_2"; + public static final int CODIGO_2_INDEX = 24; + public static final String CODIGO_3 = "codigo_3"; + public static final String CODIGO_3_FULL = "empresas.codigo_3"; + public static final int CODIGO_3_INDEX = 25; + public static final String SERVICOS = "servicos"; + public static final String SERVICOS_FULL = "empresas.servicos"; + public static final int SERVICOS_INDEX = 26; + public static final String CONTACTO_1 = "contacto_1"; + public static final String CONTACTO_1_FULL = "empresas.contacto_1"; + public static final int CONTACTO_1_INDEX = 27; + public static final String TO_CONTACTO_1 = "to_contacto_1"; + public static final String TO_CONTACTO_1_FULL = "empresas.to_contacto_1"; + public static final int TO_CONTACTO_1_INDEX = 28; + public static final String CONTACTO_2 = "contacto_2"; + public static final String CONTACTO_2_FULL = "empresas.contacto_2"; + public static final int CONTACTO_2_INDEX = 29; + public static final String TO_CONTACTO_2 = "to_contacto_2"; + public static final String TO_CONTACTO_2_FULL = "empresas.to_contacto_2"; + public static final int TO_CONTACTO_2_INDEX = 30; + public static final String DATA_RELATORIO_ANUAL = "data_relatorio_anual"; + public static final String DATA_RELATORIO_ANUAL_FULL = "empresas.data_relatorio_anual"; + public static final int DATA_RELATORIO_ANUAL_INDEX = 31; + public static final String PERIODICIDADE = "periodicidade"; + public static final String PERIODICIDADE_FULL = "empresas.periodicidade"; + public static final int PERIODICIDADE_INDEX = 32; + public static final String ACTIVIDADE = "actividade"; + public static final String ACTIVIDADE_FULL = "empresas.actividade"; + public static final int ACTIVIDADE_INDEX = 33; + public static final String ACTUALIZACAO = "actualizacao"; + public static final String ACTUALIZACAO_FULL = "empresas.actualizacao"; + public static final int ACTUALIZACAO_INDEX = 34; + public static final String DESIGNACAO_SOCIAL_PLAIN = "designacao_social_plain"; + public static final String DESIGNACAO_SOCIAL_PLAIN_FULL = "empresas.designacao_social_plain"; + public static final int DESIGNACAO_SOCIAL_PLAIN_INDEX = 35; + public static final String A_CONSULTAS = "a_consultas"; + public static final String A_CONSULTAS_FULL = "empresas.a_consultas"; + public static final int A_CONSULTAS_INDEX = 36; + public static final String A_EXAMES = "a_exames"; + public static final String A_EXAMES_FULL = "empresas.a_exames"; + public static final int A_EXAMES_INDEX = 37; + public static final String B_CONSULTAS = "b_consultas"; + public static final String B_CONSULTAS_FULL = "empresas.b_consultas"; + public static final int B_CONSULTAS_INDEX = 38; + public static final String B_EXAMES = "b_exames"; + public static final String B_EXAMES_FULL = "empresas.b_exames"; + public static final int B_EXAMES_INDEX = 39; + public static final String DATA_CANCELAMENTO = "data_cancelamento"; + public static final String DATA_CANCELAMENTO_FULL = "empresas.data_cancelamento"; + public static final int DATA_CANCELAMENTO_INDEX = 40; + public static final String DURACAO = "duracao"; + public static final String DURACAO_FULL = "empresas.duracao"; + public static final int DURACAO_INDEX = 41; + public static final String INICIO_CONTRATO = "inicio_contrato"; + public static final String INICIO_CONTRATO_FULL = "empresas.inicio_contrato"; + public static final int INICIO_CONTRATO_INDEX = 42; + public static final String EMPRESA_LOGO_ID = "empresa_logo_id"; + public static final String EMPRESA_LOGO_ID_FULL = "empresas.empresa_logo_id"; + public static final int EMPRESA_LOGO_ID_INDEX = 43; + public static final String TO_EMPRESA_LOGO_ID = "to_empresa_logo_id"; + public static final String TO_EMPRESA_LOGO_ID_FULL = "empresas.to_empresa_logo_id"; + public static final int TO_EMPRESA_LOGO_ID_INDEX = 44; + public static final String IMPRIMIR_TABELA_ALARGADA = "imprimir_tabela_alargada"; + public static final String IMPRIMIR_TABELA_ALARGADA_FULL = "empresas.imprimir_tabela_alargada"; + public static final int IMPRIMIR_TABELA_ALARGADA_INDEX = 45; + public static final String CODIGO_RELATORIO_UNICO = "codigo_relatorio_unico"; + public static final String CODIGO_RELATORIO_UNICO_FULL = "empresas.codigo_relatorio_unico"; + public static final int CODIGO_RELATORIO_UNICO_INDEX = 46; + + public static final String FIELD_NAMES[] = new String[]{ + DESIGNACAO_SOCIAL, SERVICO_SAUDE_TIPO, SERVICO_SAUDE_DESIGNACAO, + SERVICO_HIGIENE_TIPO, SERVICO_HIGIENE_DESIGNACAO, INACTIVO, MORADA, + CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, NUMERO_TRABALHADORES, + DATA_PROPOSTA, DATA_ACEITACAO, PERFIL_1, PERFIL_2, DATA_ENVIO_CONTRATO, + DATA_RECEPCAO_CONTRATO, DATA_ENVIO_IDICT, CAE, CONTRIBUINTE, SEGURANCA_SOCIAL, + CODIGO_1, CODIGO_2, CODIGO_3, SERVICOS, CONTACTO_1, TO_CONTACTO_1, CONTACTO_2, + TO_CONTACTO_2, DATA_RELATORIO_ANUAL, PERIODICIDADE, ACTIVIDADE, ACTUALIZACAO, + DESIGNACAO_SOCIAL_PLAIN, A_CONSULTAS, A_EXAMES, B_CONSULTAS, B_EXAMES, + DATA_CANCELAMENTO, DURACAO, INICIO_CONTRATO, EMPRESA_LOGO_ID, + TO_EMPRESA_LOGO_ID, IMPRIMIR_TABELA_ALARGADA, CODIGO_RELATORIO_UNICO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESIGNACAO_SOCIAL, TABLENAME + "." + SERVICO_SAUDE_TIPO, TABLENAME + "." + SERVICO_SAUDE_DESIGNACAO, + TABLENAME + "." + SERVICO_HIGIENE_TIPO, TABLENAME + "." + SERVICO_HIGIENE_DESIGNACAO, TABLENAME + "." + INACTIVO, TABLENAME + "." + MORADA, + TABLENAME + "." + CODIGO_POSTAL, TABLENAME + "." + LOCALIDADE, TABLENAME + "." + DISTRITO, TABLENAME + "." + CONCELHO, TABLENAME + "." + NUMERO_TRABALHADORES, + TABLENAME + "." + DATA_PROPOSTA, TABLENAME + "." + DATA_ACEITACAO, TABLENAME + "." + PERFIL_1, TABLENAME + "." + PERFIL_2, TABLENAME + "." + DATA_ENVIO_CONTRATO, + TABLENAME + "." + DATA_RECEPCAO_CONTRATO, TABLENAME + "." + DATA_ENVIO_IDICT, TABLENAME + "." + CAE, TABLENAME + "." + CONTRIBUINTE, TABLENAME + "." + SEGURANCA_SOCIAL, + TABLENAME + "." + CODIGO_1, TABLENAME + "." + CODIGO_2, TABLENAME + "." + CODIGO_3, TABLENAME + "." + SERVICOS, TABLENAME + "." + CONTACTO_1, TABLENAME + "." + TO_CONTACTO_1, TABLENAME + "." + CONTACTO_2, + TABLENAME + "." + TO_CONTACTO_2, TABLENAME + "." + DATA_RELATORIO_ANUAL, TABLENAME + "." + PERIODICIDADE, TABLENAME + "." + ACTIVIDADE, TABLENAME + "." + ACTUALIZACAO, + TABLENAME + "." + DESIGNACAO_SOCIAL_PLAIN, TABLENAME + "." + A_CONSULTAS, TABLENAME + "." + A_EXAMES, TABLENAME + "." + B_CONSULTAS, TABLENAME + "." + B_EXAMES, + TABLENAME + "." + DATA_CANCELAMENTO, TABLENAME + "." + DURACAO, TABLENAME + "." + INICIO_CONTRATO, TABLENAME + "." + EMPRESA_LOGO_ID, + TABLENAME + "." + TO_EMPRESA_LOGO_ID, TABLENAME + "." + IMPRIMIR_TABELA_ALARGADA, TABLENAME + "." + CODIGO_RELATORIO_UNICO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESIGNACAO_SOCIAL, SERVICO_SAUDE_TIPO, SERVICO_SAUDE_DESIGNACAO, + SERVICO_HIGIENE_TIPO, SERVICO_HIGIENE_DESIGNACAO, INACTIVO, MORADA, + CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, NUMERO_TRABALHADORES, + DATA_PROPOSTA, DATA_ACEITACAO, PERFIL_1, PERFIL_2, DATA_ENVIO_CONTRATO, + DATA_RECEPCAO_CONTRATO, DATA_ENVIO_IDICT, CAE, CONTRIBUINTE, SEGURANCA_SOCIAL, + CODIGO_1, CODIGO_2, CODIGO_3, SERVICOS, CONTACTO_1, CONTACTO_2, + DATA_RELATORIO_ANUAL, PERIODICIDADE, ACTIVIDADE, ACTUALIZACAO, + DESIGNACAO_SOCIAL_PLAIN, A_CONSULTAS, A_EXAMES, B_CONSULTAS, B_EXAMES, + DATA_CANCELAMENTO, DURACAO, INICIO_CONTRATO, EMPRESA_LOGO_ID, + IMPRIMIR_TABELA_ALARGADA, CODIGO_RELATORIO_UNICO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESIGNACAO_SOCIAL, SERVICO_SAUDE_TIPO, SERVICO_SAUDE_DESIGNACAO, + SERVICO_HIGIENE_TIPO, SERVICO_HIGIENE_DESIGNACAO, INACTIVO, MORADA, + CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, NUMERO_TRABALHADORES, + DATA_PROPOSTA, DATA_ACEITACAO, PERFIL_1, PERFIL_2, DATA_ENVIO_CONTRATO, + DATA_RECEPCAO_CONTRATO, DATA_ENVIO_IDICT, CAE, CONTRIBUINTE, SEGURANCA_SOCIAL, + CODIGO_1, CODIGO_2, CODIGO_3, SERVICOS, CONTACTO_1, CONTACTO_2, + DATA_RELATORIO_ANUAL, PERIODICIDADE, ACTIVIDADE, ACTUALIZACAO, + DESIGNACAO_SOCIAL_PLAIN, A_CONSULTAS, A_EXAMES, B_CONSULTAS, B_EXAMES, + DATA_CANCELAMENTO, DURACAO, INICIO_CONTRATO, EMPRESA_LOGO_ID, + IMPRIMIR_TABELA_ALARGADA, CODIGO_RELATORIO_UNICO, }; + + private Integer id; + private String designacao_social; + private Integer servico_saude_tipo; + private String servico_saude_designacao; + private Integer servico_higiene_tipo; + private String servico_higiene_designacao; + private String inactivo; + private String morada; + private String codigo_postal; + private String localidade; + private String distrito; + private String concelho; + private Integer numero_trabalhadores; + private java.util.Date data_proposta; + private java.util.Date data_aceitacao; + private String perfil_1; + private String perfil_2; + private java.util.Date data_envio_contrato; + private java.util.Date data_recepcao_contrato; + private java.util.Date data_envio_idict; + private String cae; + private String contribuinte; + private String seguranca_social; + private String codigo_1; + private String codigo_2; + private String codigo_3; + private Integer servicos; + private Integer contacto_1; + private db.data.siprp_local.outer.ContactosData to_contacto_1; + private Integer contacto_2; + private db.data.siprp_local.outer.ContactosData to_contacto_2; + private java.util.Date data_relatorio_anual; + private String periodicidade; + private String actividade; + private java.sql.Timestamp actualizacao; + private String designacao_social_plain; + private String a_consultas; + private String a_exames; + private String b_consultas; + private String b_exames; + private java.util.Date data_cancelamento; + private Integer duracao; + private java.util.Date inicio_contrato; + private Integer empresa_logo_id; + private db.data.siprp_local.outer.ImageData to_empresa_logo_id; + private Boolean imprimir_tabela_alargada; + private String codigo_relatorio_unico; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Empresas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAvisos_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEmpresaPrecoServico_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmpresaPrecoServicoData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEstabelecimentos_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsArea_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsAreaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsEmailEmpresa_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsEmailEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsLegislacaoEmpresa_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsLegislacaoEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsNormalizacaoEmpresa_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsNormalizacaoEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRiscoEmpresa_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRiscoEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromLembretes_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesEmpresa_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesEmpresaData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromPrtElementosProtocolo_empresa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrtElementosProtocoloData.class , getPrimaryKey().getMap().get("id"), "empresa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDesignacao_social() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESIGNACAO_SOCIAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.designacao_social; + } + + public void setDesignacao_social( String designacao_social ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESIGNACAO_SOCIAL, designacao_social ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.designacao_social = designacao_social; + LAZY_LOADED_OBJECTS.put( DESIGNACAO_SOCIAL, Boolean.TRUE ); + } + + public Integer getServico_saude_tipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SERVICO_SAUDE_TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.servico_saude_tipo; + } + + public void setServico_saude_tipo( Integer servico_saude_tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( SERVICO_SAUDE_TIPO, servico_saude_tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.servico_saude_tipo = servico_saude_tipo; + LAZY_LOADED_OBJECTS.put( SERVICO_SAUDE_TIPO, Boolean.TRUE ); + } + + public String getServico_saude_designacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SERVICO_SAUDE_DESIGNACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.servico_saude_designacao; + } + + public void setServico_saude_designacao( String servico_saude_designacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( SERVICO_SAUDE_DESIGNACAO, servico_saude_designacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.servico_saude_designacao = servico_saude_designacao; + LAZY_LOADED_OBJECTS.put( SERVICO_SAUDE_DESIGNACAO, Boolean.TRUE ); + } + + public Integer getServico_higiene_tipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SERVICO_HIGIENE_TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.servico_higiene_tipo; + } + + public void setServico_higiene_tipo( Integer servico_higiene_tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( SERVICO_HIGIENE_TIPO, servico_higiene_tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.servico_higiene_tipo = servico_higiene_tipo; + LAZY_LOADED_OBJECTS.put( SERVICO_HIGIENE_TIPO, Boolean.TRUE ); + } + + public String getServico_higiene_designacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SERVICO_HIGIENE_DESIGNACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.servico_higiene_designacao; + } + + public void setServico_higiene_designacao( String servico_higiene_designacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( SERVICO_HIGIENE_DESIGNACAO, servico_higiene_designacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.servico_higiene_designacao = servico_higiene_designacao; + LAZY_LOADED_OBJECTS.put( SERVICO_HIGIENE_DESIGNACAO, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + setLockedForRefresh( true ); + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCodigo_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_postal; + } + + public void setCodigo_postal( String codigo_postal ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_POSTAL, codigo_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_postal = codigo_postal; + LAZY_LOADED_OBJECTS.put( CODIGO_POSTAL, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public String getDistrito() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DISTRITO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.distrito; + } + + public void setDistrito( String distrito ) + { + try + { + setLockedForRefresh( true ); + preProcess( DISTRITO, distrito ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.distrito = distrito; + LAZY_LOADED_OBJECTS.put( DISTRITO, Boolean.TRUE ); + } + + public String getConcelho() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONCELHO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.concelho; + } + + public void setConcelho( String concelho ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONCELHO, concelho ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.concelho = concelho; + LAZY_LOADED_OBJECTS.put( CONCELHO, Boolean.TRUE ); + } + + public Integer getNumero_trabalhadores() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_TRABALHADORES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_trabalhadores; + } + + public void setNumero_trabalhadores( Integer numero_trabalhadores ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_TRABALHADORES, numero_trabalhadores ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_trabalhadores = numero_trabalhadores; + LAZY_LOADED_OBJECTS.put( NUMERO_TRABALHADORES, Boolean.TRUE ); + } + + public java.util.Date getData_proposta() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_PROPOSTA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_proposta; + } + + public void setData_proposta( java.util.Date data_proposta ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_PROPOSTA, data_proposta ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_proposta = data_proposta; + LAZY_LOADED_OBJECTS.put( DATA_PROPOSTA, Boolean.TRUE ); + } + + public java.util.Date getData_aceitacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ACEITACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_aceitacao; + } + + public void setData_aceitacao( java.util.Date data_aceitacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ACEITACAO, data_aceitacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_aceitacao = data_aceitacao; + LAZY_LOADED_OBJECTS.put( DATA_ACEITACAO, Boolean.TRUE ); + } + + public String getPerfil_1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL_1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil_1; + } + + public void setPerfil_1( String perfil_1 ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERFIL_1, perfil_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil_1 = perfil_1; + LAZY_LOADED_OBJECTS.put( PERFIL_1, Boolean.TRUE ); + } + + public String getPerfil_2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL_2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil_2; + } + + public void setPerfil_2( String perfil_2 ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERFIL_2, perfil_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil_2 = perfil_2; + LAZY_LOADED_OBJECTS.put( PERFIL_2, Boolean.TRUE ); + } + + public java.util.Date getData_envio_contrato() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ENVIO_CONTRATO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_envio_contrato; + } + + public void setData_envio_contrato( java.util.Date data_envio_contrato ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ENVIO_CONTRATO, data_envio_contrato ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_envio_contrato = data_envio_contrato; + LAZY_LOADED_OBJECTS.put( DATA_ENVIO_CONTRATO, Boolean.TRUE ); + } + + public java.util.Date getData_recepcao_contrato() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RECEPCAO_CONTRATO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_recepcao_contrato; + } + + public void setData_recepcao_contrato( java.util.Date data_recepcao_contrato ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_RECEPCAO_CONTRATO, data_recepcao_contrato ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_recepcao_contrato = data_recepcao_contrato; + LAZY_LOADED_OBJECTS.put( DATA_RECEPCAO_CONTRATO, Boolean.TRUE ); + } + + public java.util.Date getData_envio_idict() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ENVIO_IDICT ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_envio_idict; + } + + public void setData_envio_idict( java.util.Date data_envio_idict ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ENVIO_IDICT, data_envio_idict ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_envio_idict = data_envio_idict; + LAZY_LOADED_OBJECTS.put( DATA_ENVIO_IDICT, Boolean.TRUE ); + } + + public String getCae() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cae; + } + + public void setCae( String cae ) + { + try + { + setLockedForRefresh( true ); + preProcess( CAE, cae ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cae = cae; + LAZY_LOADED_OBJECTS.put( CAE, Boolean.TRUE ); + } + + public String getContribuinte() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTRIBUINTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contribuinte; + } + + public void setContribuinte( String contribuinte ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTRIBUINTE, contribuinte ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contribuinte = contribuinte; + LAZY_LOADED_OBJECTS.put( CONTRIBUINTE, Boolean.TRUE ); + } + + public String getSeguranca_social() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEGURANCA_SOCIAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.seguranca_social; + } + + public void setSeguranca_social( String seguranca_social ) + { + try + { + setLockedForRefresh( true ); + preProcess( SEGURANCA_SOCIAL, seguranca_social ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.seguranca_social = seguranca_social; + LAZY_LOADED_OBJECTS.put( SEGURANCA_SOCIAL, Boolean.TRUE ); + } + + public String getCodigo_1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_1; + } + + public void setCodigo_1( String codigo_1 ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_1, codigo_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_1 = codigo_1; + LAZY_LOADED_OBJECTS.put( CODIGO_1, Boolean.TRUE ); + } + + public String getCodigo_2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_2; + } + + public void setCodigo_2( String codigo_2 ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_2, codigo_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_2 = codigo_2; + LAZY_LOADED_OBJECTS.put( CODIGO_2, Boolean.TRUE ); + } + + public String getCodigo_3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_3; + } + + public void setCodigo_3( String codigo_3 ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_3, codigo_3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_3 = codigo_3; + LAZY_LOADED_OBJECTS.put( CODIGO_3, Boolean.TRUE ); + } + + public Integer getServicos() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SERVICOS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.servicos; + } + + public void setServicos( Integer servicos ) + { + try + { + setLockedForRefresh( true ); + preProcess( SERVICOS, servicos ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.servicos = servicos; + LAZY_LOADED_OBJECTS.put( SERVICOS, Boolean.TRUE ); + } + + public Integer getContacto_1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTACTO_1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contacto_1; + } + + public void setContacto_1( Integer contacto_1 ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTACTO_1, contacto_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contacto_1 = contacto_1; + LAZY_LOADED_OBJECTS.put( CONTACTO_1, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ContactosData toContacto_1() + { + try + { + prepare( TO_CONTACTO_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_contacto_1; + } + + public void setToContacto_1( db.data.siprp_local.outer.ContactosData to_contacto_1 ) + { + try + { + preProcess( TO_CONTACTO_1, to_contacto_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_contacto_1 = to_contacto_1; + } + + public Integer getContacto_2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTACTO_2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contacto_2; + } + + public void setContacto_2( Integer contacto_2 ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTACTO_2, contacto_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contacto_2 = contacto_2; + LAZY_LOADED_OBJECTS.put( CONTACTO_2, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ContactosData toContacto_2() + { + try + { + prepare( TO_CONTACTO_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_contacto_2; + } + + public void setToContacto_2( db.data.siprp_local.outer.ContactosData to_contacto_2 ) + { + try + { + preProcess( TO_CONTACTO_2, to_contacto_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_contacto_2 = to_contacto_2; + } + + public java.util.Date getData_relatorio_anual() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RELATORIO_ANUAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_relatorio_anual; + } + + public void setData_relatorio_anual( java.util.Date data_relatorio_anual ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_RELATORIO_ANUAL, data_relatorio_anual ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_relatorio_anual = data_relatorio_anual; + LAZY_LOADED_OBJECTS.put( DATA_RELATORIO_ANUAL, Boolean.TRUE ); + } + + public String getPeriodicidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERIODICIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.periodicidade; + } + + public void setPeriodicidade( String periodicidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERIODICIDADE, periodicidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.periodicidade = periodicidade; + LAZY_LOADED_OBJECTS.put( PERIODICIDADE, Boolean.TRUE ); + } + + public String getActividade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.actividade; + } + + public void setActividade( String actividade ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVIDADE, actividade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.actividade = actividade; + LAZY_LOADED_OBJECTS.put( ACTIVIDADE, Boolean.TRUE ); + } + + public java.sql.Timestamp getActualizacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTUALIZACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.actualizacao; + } + + public void setActualizacao( java.sql.Timestamp actualizacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTUALIZACAO, actualizacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.actualizacao = actualizacao; + LAZY_LOADED_OBJECTS.put( ACTUALIZACAO, Boolean.TRUE ); + } + + public String getDesignacao_social_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESIGNACAO_SOCIAL_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.designacao_social_plain; + } + + public void setDesignacao_social_plain( String designacao_social_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESIGNACAO_SOCIAL_PLAIN, designacao_social_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.designacao_social_plain = designacao_social_plain; + LAZY_LOADED_OBJECTS.put( DESIGNACAO_SOCIAL_PLAIN, Boolean.TRUE ); + } + + public String getA_consultas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( A_CONSULTAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.a_consultas; + } + + public void setA_consultas( String a_consultas ) + { + try + { + setLockedForRefresh( true ); + preProcess( A_CONSULTAS, a_consultas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.a_consultas = a_consultas; + LAZY_LOADED_OBJECTS.put( A_CONSULTAS, Boolean.TRUE ); + } + + public String getA_exames() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( A_EXAMES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.a_exames; + } + + public void setA_exames( String a_exames ) + { + try + { + setLockedForRefresh( true ); + preProcess( A_EXAMES, a_exames ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.a_exames = a_exames; + LAZY_LOADED_OBJECTS.put( A_EXAMES, Boolean.TRUE ); + } + + public String getB_consultas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( B_CONSULTAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.b_consultas; + } + + public void setB_consultas( String b_consultas ) + { + try + { + setLockedForRefresh( true ); + preProcess( B_CONSULTAS, b_consultas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.b_consultas = b_consultas; + LAZY_LOADED_OBJECTS.put( B_CONSULTAS, Boolean.TRUE ); + } + + public String getB_exames() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( B_EXAMES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.b_exames; + } + + public void setB_exames( String b_exames ) + { + try + { + setLockedForRefresh( true ); + preProcess( B_EXAMES, b_exames ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.b_exames = b_exames; + LAZY_LOADED_OBJECTS.put( B_EXAMES, Boolean.TRUE ); + } + + public java.util.Date getData_cancelamento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_CANCELAMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_cancelamento; + } + + public void setData_cancelamento( java.util.Date data_cancelamento ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_CANCELAMENTO, data_cancelamento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_cancelamento = data_cancelamento; + LAZY_LOADED_OBJECTS.put( DATA_CANCELAMENTO, Boolean.TRUE ); + } + + public Integer getDuracao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DURACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.duracao; + } + + public void setDuracao( Integer duracao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DURACAO, duracao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.duracao = duracao; + LAZY_LOADED_OBJECTS.put( DURACAO, Boolean.TRUE ); + } + + public java.util.Date getInicio_contrato() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INICIO_CONTRATO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inicio_contrato; + } + + public void setInicio_contrato( java.util.Date inicio_contrato ) + { + try + { + setLockedForRefresh( true ); + preProcess( INICIO_CONTRATO, inicio_contrato ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inicio_contrato = inicio_contrato; + LAZY_LOADED_OBJECTS.put( INICIO_CONTRATO, Boolean.TRUE ); + } + + public Integer getEmpresa_logo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_LOGO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_logo_id; + } + + public void setEmpresa_logo_id( Integer empresa_logo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_LOGO_ID, empresa_logo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_logo_id = empresa_logo_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_LOGO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ImageData toEmpresa_logo_id() + { + try + { + prepare( TO_EMPRESA_LOGO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_logo_id; + } + + public void setToEmpresa_logo_id( db.data.siprp_local.outer.ImageData to_empresa_logo_id ) + { + try + { + preProcess( TO_EMPRESA_LOGO_ID, to_empresa_logo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_logo_id = to_empresa_logo_id; + } + + public Boolean getImprimir_tabela_alargada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMPRIMIR_TABELA_ALARGADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.imprimir_tabela_alargada; + } + + public void setImprimir_tabela_alargada( Boolean imprimir_tabela_alargada ) + { + try + { + setLockedForRefresh( true ); + preProcess( IMPRIMIR_TABELA_ALARGADA, imprimir_tabela_alargada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.imprimir_tabela_alargada = imprimir_tabela_alargada; + LAZY_LOADED_OBJECTS.put( IMPRIMIR_TABELA_ALARGADA, Boolean.TRUE ); + } + + public String getCodigo_relatorio_unico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_RELATORIO_UNICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_relatorio_unico; + } + + public void setCodigo_relatorio_unico( String codigo_relatorio_unico ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_RELATORIO_UNICO, codigo_relatorio_unico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_relatorio_unico = codigo_relatorio_unico; + LAZY_LOADED_OBJECTS.put( CODIGO_RELATORIO_UNICO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + value = getId(); + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + value = getDesignacao_social(); + break; + case Empresas.SERVICO_SAUDE_TIPO_INDEX: + value = getServico_saude_tipo(); + break; + case Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX: + value = getServico_saude_designacao(); + break; + case Empresas.SERVICO_HIGIENE_TIPO_INDEX: + value = getServico_higiene_tipo(); + break; + case Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX: + value = getServico_higiene_designacao(); + break; + case Empresas.INACTIVO_INDEX: + value = getInactivo(); + break; + case Empresas.MORADA_INDEX: + value = getMorada(); + break; + case Empresas.CODIGO_POSTAL_INDEX: + value = getCodigo_postal(); + break; + case Empresas.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case Empresas.DISTRITO_INDEX: + value = getDistrito(); + break; + case Empresas.CONCELHO_INDEX: + value = getConcelho(); + break; + case Empresas.NUMERO_TRABALHADORES_INDEX: + value = getNumero_trabalhadores(); + break; + case Empresas.DATA_PROPOSTA_INDEX: + value = getData_proposta(); + break; + case Empresas.DATA_ACEITACAO_INDEX: + value = getData_aceitacao(); + break; + case Empresas.PERFIL_1_INDEX: + value = getPerfil_1(); + break; + case Empresas.PERFIL_2_INDEX: + value = getPerfil_2(); + break; + case Empresas.DATA_ENVIO_CONTRATO_INDEX: + value = getData_envio_contrato(); + break; + case Empresas.DATA_RECEPCAO_CONTRATO_INDEX: + value = getData_recepcao_contrato(); + break; + case Empresas.DATA_ENVIO_IDICT_INDEX: + value = getData_envio_idict(); + break; + case Empresas.CAE_INDEX: + value = getCae(); + break; + case Empresas.CONTRIBUINTE_INDEX: + value = getContribuinte(); + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + value = getSeguranca_social(); + break; + case Empresas.CODIGO_1_INDEX: + value = getCodigo_1(); + break; + case Empresas.CODIGO_2_INDEX: + value = getCodigo_2(); + break; + case Empresas.CODIGO_3_INDEX: + value = getCodigo_3(); + break; + case Empresas.SERVICOS_INDEX: + value = getServicos(); + break; + case Empresas.CONTACTO_1_INDEX: + value = getContacto_1(); + break; + case Empresas.TO_CONTACTO_1_INDEX: + value = toContacto_1(); + break; + case Empresas.CONTACTO_2_INDEX: + value = getContacto_2(); + break; + case Empresas.TO_CONTACTO_2_INDEX: + value = toContacto_2(); + break; + case Empresas.DATA_RELATORIO_ANUAL_INDEX: + value = getData_relatorio_anual(); + break; + case Empresas.PERIODICIDADE_INDEX: + value = getPeriodicidade(); + break; + case Empresas.ACTIVIDADE_INDEX: + value = getActividade(); + break; + case Empresas.ACTUALIZACAO_INDEX: + value = getActualizacao(); + break; + case Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX: + value = getDesignacao_social_plain(); + break; + case Empresas.A_CONSULTAS_INDEX: + value = getA_consultas(); + break; + case Empresas.A_EXAMES_INDEX: + value = getA_exames(); + break; + case Empresas.B_CONSULTAS_INDEX: + value = getB_consultas(); + break; + case Empresas.B_EXAMES_INDEX: + value = getB_exames(); + break; + case Empresas.DATA_CANCELAMENTO_INDEX: + value = getData_cancelamento(); + break; + case Empresas.DURACAO_INDEX: + value = getDuracao(); + break; + case Empresas.INICIO_CONTRATO_INDEX: + value = getInicio_contrato(); + break; + case Empresas.EMPRESA_LOGO_ID_INDEX: + value = getEmpresa_logo_id(); + break; + case Empresas.TO_EMPRESA_LOGO_ID_INDEX: + value = toEmpresa_logo_id(); + break; + case Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX: + value = getImprimir_tabela_alargada(); + break; + case Empresas.CODIGO_RELATORIO_UNICO_INDEX: + value = getCodigo_relatorio_unico(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + value = this.id; + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + value = this.designacao_social; + break; + case Empresas.SERVICO_SAUDE_TIPO_INDEX: + value = this.servico_saude_tipo; + break; + case Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX: + value = this.servico_saude_designacao; + break; + case Empresas.SERVICO_HIGIENE_TIPO_INDEX: + value = this.servico_higiene_tipo; + break; + case Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX: + value = this.servico_higiene_designacao; + break; + case Empresas.INACTIVO_INDEX: + value = this.inactivo; + break; + case Empresas.MORADA_INDEX: + value = this.morada; + break; + case Empresas.CODIGO_POSTAL_INDEX: + value = this.codigo_postal; + break; + case Empresas.LOCALIDADE_INDEX: + value = this.localidade; + break; + case Empresas.DISTRITO_INDEX: + value = this.distrito; + break; + case Empresas.CONCELHO_INDEX: + value = this.concelho; + break; + case Empresas.NUMERO_TRABALHADORES_INDEX: + value = this.numero_trabalhadores; + break; + case Empresas.DATA_PROPOSTA_INDEX: + value = this.data_proposta; + break; + case Empresas.DATA_ACEITACAO_INDEX: + value = this.data_aceitacao; + break; + case Empresas.PERFIL_1_INDEX: + value = this.perfil_1; + break; + case Empresas.PERFIL_2_INDEX: + value = this.perfil_2; + break; + case Empresas.DATA_ENVIO_CONTRATO_INDEX: + value = this.data_envio_contrato; + break; + case Empresas.DATA_RECEPCAO_CONTRATO_INDEX: + value = this.data_recepcao_contrato; + break; + case Empresas.DATA_ENVIO_IDICT_INDEX: + value = this.data_envio_idict; + break; + case Empresas.CAE_INDEX: + value = this.cae; + break; + case Empresas.CONTRIBUINTE_INDEX: + value = this.contribuinte; + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + value = this.seguranca_social; + break; + case Empresas.CODIGO_1_INDEX: + value = this.codigo_1; + break; + case Empresas.CODIGO_2_INDEX: + value = this.codigo_2; + break; + case Empresas.CODIGO_3_INDEX: + value = this.codigo_3; + break; + case Empresas.SERVICOS_INDEX: + value = this.servicos; + break; + case Empresas.CONTACTO_1_INDEX: + value = this.contacto_1; + break; + case Empresas.TO_CONTACTO_1_INDEX: + value = this.to_contacto_1; + break; + case Empresas.CONTACTO_2_INDEX: + value = this.contacto_2; + break; + case Empresas.TO_CONTACTO_2_INDEX: + value = this.to_contacto_2; + break; + case Empresas.DATA_RELATORIO_ANUAL_INDEX: + value = this.data_relatorio_anual; + break; + case Empresas.PERIODICIDADE_INDEX: + value = this.periodicidade; + break; + case Empresas.ACTIVIDADE_INDEX: + value = this.actividade; + break; + case Empresas.ACTUALIZACAO_INDEX: + value = this.actualizacao; + break; + case Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX: + value = this.designacao_social_plain; + break; + case Empresas.A_CONSULTAS_INDEX: + value = this.a_consultas; + break; + case Empresas.A_EXAMES_INDEX: + value = this.a_exames; + break; + case Empresas.B_CONSULTAS_INDEX: + value = this.b_consultas; + break; + case Empresas.B_EXAMES_INDEX: + value = this.b_exames; + break; + case Empresas.DATA_CANCELAMENTO_INDEX: + value = this.data_cancelamento; + break; + case Empresas.DURACAO_INDEX: + value = this.duracao; + break; + case Empresas.INICIO_CONTRATO_INDEX: + value = this.inicio_contrato; + break; + case Empresas.EMPRESA_LOGO_ID_INDEX: + value = this.empresa_logo_id; + break; + case Empresas.TO_EMPRESA_LOGO_ID_INDEX: + value = this.to_empresa_logo_id; + break; + case Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX: + value = this.imprimir_tabela_alargada; + break; + case Empresas.CODIGO_RELATORIO_UNICO_INDEX: + value = this.codigo_relatorio_unico; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + setId( ( Integer ) value ); + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + setDesignacao_social( ( String ) value ); + break; + case Empresas.SERVICO_SAUDE_TIPO_INDEX: + setServico_saude_tipo( ( Integer ) value ); + break; + case Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX: + setServico_saude_designacao( ( String ) value ); + break; + case Empresas.SERVICO_HIGIENE_TIPO_INDEX: + setServico_higiene_tipo( ( Integer ) value ); + break; + case Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX: + setServico_higiene_designacao( ( String ) value ); + break; + case Empresas.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + case Empresas.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case Empresas.CODIGO_POSTAL_INDEX: + setCodigo_postal( ( String ) value ); + break; + case Empresas.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case Empresas.DISTRITO_INDEX: + setDistrito( ( String ) value ); + break; + case Empresas.CONCELHO_INDEX: + setConcelho( ( String ) value ); + break; + case Empresas.NUMERO_TRABALHADORES_INDEX: + setNumero_trabalhadores( ( Integer ) value ); + break; + case Empresas.DATA_PROPOSTA_INDEX: + setData_proposta( ( java.util.Date ) value ); + break; + case Empresas.DATA_ACEITACAO_INDEX: + setData_aceitacao( ( java.util.Date ) value ); + break; + case Empresas.PERFIL_1_INDEX: + setPerfil_1( ( String ) value ); + break; + case Empresas.PERFIL_2_INDEX: + setPerfil_2( ( String ) value ); + break; + case Empresas.DATA_ENVIO_CONTRATO_INDEX: + setData_envio_contrato( ( java.util.Date ) value ); + break; + case Empresas.DATA_RECEPCAO_CONTRATO_INDEX: + setData_recepcao_contrato( ( java.util.Date ) value ); + break; + case Empresas.DATA_ENVIO_IDICT_INDEX: + setData_envio_idict( ( java.util.Date ) value ); + break; + case Empresas.CAE_INDEX: + setCae( ( String ) value ); + break; + case Empresas.CONTRIBUINTE_INDEX: + setContribuinte( ( String ) value ); + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + setSeguranca_social( ( String ) value ); + break; + case Empresas.CODIGO_1_INDEX: + setCodigo_1( ( String ) value ); + break; + case Empresas.CODIGO_2_INDEX: + setCodigo_2( ( String ) value ); + break; + case Empresas.CODIGO_3_INDEX: + setCodigo_3( ( String ) value ); + break; + case Empresas.SERVICOS_INDEX: + setServicos( ( Integer ) value ); + break; + case Empresas.CONTACTO_1_INDEX: + setContacto_1( ( Integer ) value ); + break; + case Empresas.TO_CONTACTO_1_INDEX: + setToContacto_1( ( db.data.siprp_local.outer.ContactosData ) value ); + break; + case Empresas.CONTACTO_2_INDEX: + setContacto_2( ( Integer ) value ); + break; + case Empresas.TO_CONTACTO_2_INDEX: + setToContacto_2( ( db.data.siprp_local.outer.ContactosData ) value ); + break; + case Empresas.DATA_RELATORIO_ANUAL_INDEX: + setData_relatorio_anual( ( java.util.Date ) value ); + break; + case Empresas.PERIODICIDADE_INDEX: + setPeriodicidade( ( String ) value ); + break; + case Empresas.ACTIVIDADE_INDEX: + setActividade( ( String ) value ); + break; + case Empresas.ACTUALIZACAO_INDEX: + setActualizacao( ( java.sql.Timestamp ) value ); + break; + case Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX: + setDesignacao_social_plain( ( String ) value ); + break; + case Empresas.A_CONSULTAS_INDEX: + setA_consultas( ( String ) value ); + break; + case Empresas.A_EXAMES_INDEX: + setA_exames( ( String ) value ); + break; + case Empresas.B_CONSULTAS_INDEX: + setB_consultas( ( String ) value ); + break; + case Empresas.B_EXAMES_INDEX: + setB_exames( ( String ) value ); + break; + case Empresas.DATA_CANCELAMENTO_INDEX: + setData_cancelamento( ( java.util.Date ) value ); + break; + case Empresas.DURACAO_INDEX: + setDuracao( ( Integer ) value ); + break; + case Empresas.INICIO_CONTRATO_INDEX: + setInicio_contrato( ( java.util.Date ) value ); + break; + case Empresas.EMPRESA_LOGO_ID_INDEX: + setEmpresa_logo_id( ( Integer ) value ); + break; + case Empresas.TO_EMPRESA_LOGO_ID_INDEX: + setToEmpresa_logo_id( ( db.data.siprp_local.outer.ImageData ) value ); + break; + case Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX: + setImprimir_tabela_alargada( ( Boolean ) value ); + break; + case Empresas.CODIGO_RELATORIO_UNICO_INDEX: + setCodigo_relatorio_unico( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Empresas.ID_INDEX: + this.id = ( Integer ) value; + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + this.designacao_social = ( String ) value; + break; + case Empresas.SERVICO_SAUDE_TIPO_INDEX: + this.servico_saude_tipo = ( Integer ) value; + break; + case Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX: + this.servico_saude_designacao = ( String ) value; + break; + case Empresas.SERVICO_HIGIENE_TIPO_INDEX: + this.servico_higiene_tipo = ( Integer ) value; + break; + case Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX: + this.servico_higiene_designacao = ( String ) value; + break; + case Empresas.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + case Empresas.MORADA_INDEX: + this.morada = ( String ) value; + break; + case Empresas.CODIGO_POSTAL_INDEX: + this.codigo_postal = ( String ) value; + break; + case Empresas.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case Empresas.DISTRITO_INDEX: + this.distrito = ( String ) value; + break; + case Empresas.CONCELHO_INDEX: + this.concelho = ( String ) value; + break; + case Empresas.NUMERO_TRABALHADORES_INDEX: + this.numero_trabalhadores = ( Integer ) value; + break; + case Empresas.DATA_PROPOSTA_INDEX: + this.data_proposta = ( java.util.Date ) value; + break; + case Empresas.DATA_ACEITACAO_INDEX: + this.data_aceitacao = ( java.util.Date ) value; + break; + case Empresas.PERFIL_1_INDEX: + this.perfil_1 = ( String ) value; + break; + case Empresas.PERFIL_2_INDEX: + this.perfil_2 = ( String ) value; + break; + case Empresas.DATA_ENVIO_CONTRATO_INDEX: + this.data_envio_contrato = ( java.util.Date ) value; + break; + case Empresas.DATA_RECEPCAO_CONTRATO_INDEX: + this.data_recepcao_contrato = ( java.util.Date ) value; + break; + case Empresas.DATA_ENVIO_IDICT_INDEX: + this.data_envio_idict = ( java.util.Date ) value; + break; + case Empresas.CAE_INDEX: + this.cae = ( String ) value; + break; + case Empresas.CONTRIBUINTE_INDEX: + this.contribuinte = ( String ) value; + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + this.seguranca_social = ( String ) value; + break; + case Empresas.CODIGO_1_INDEX: + this.codigo_1 = ( String ) value; + break; + case Empresas.CODIGO_2_INDEX: + this.codigo_2 = ( String ) value; + break; + case Empresas.CODIGO_3_INDEX: + this.codigo_3 = ( String ) value; + break; + case Empresas.SERVICOS_INDEX: + this.servicos = ( Integer ) value; + break; + case Empresas.CONTACTO_1_INDEX: + this.contacto_1 = ( Integer ) value; + break; + case Empresas.TO_CONTACTO_1_INDEX: + this.to_contacto_1 = ( db.data.siprp_local.outer.ContactosData ) value; + break; + case Empresas.CONTACTO_2_INDEX: + this.contacto_2 = ( Integer ) value; + break; + case Empresas.TO_CONTACTO_2_INDEX: + this.to_contacto_2 = ( db.data.siprp_local.outer.ContactosData ) value; + break; + case Empresas.DATA_RELATORIO_ANUAL_INDEX: + this.data_relatorio_anual = ( java.util.Date ) value; + break; + case Empresas.PERIODICIDADE_INDEX: + this.periodicidade = ( String ) value; + break; + case Empresas.ACTIVIDADE_INDEX: + this.actividade = ( String ) value; + break; + case Empresas.ACTUALIZACAO_INDEX: + this.actualizacao = ( java.sql.Timestamp ) value; + break; + case Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX: + this.designacao_social_plain = ( String ) value; + break; + case Empresas.A_CONSULTAS_INDEX: + this.a_consultas = ( String ) value; + break; + case Empresas.A_EXAMES_INDEX: + this.a_exames = ( String ) value; + break; + case Empresas.B_CONSULTAS_INDEX: + this.b_consultas = ( String ) value; + break; + case Empresas.B_EXAMES_INDEX: + this.b_exames = ( String ) value; + break; + case Empresas.DATA_CANCELAMENTO_INDEX: + this.data_cancelamento = ( java.util.Date ) value; + break; + case Empresas.DURACAO_INDEX: + this.duracao = ( Integer ) value; + break; + case Empresas.INICIO_CONTRATO_INDEX: + this.inicio_contrato = ( java.util.Date ) value; + break; + case Empresas.EMPRESA_LOGO_ID_INDEX: + this.empresa_logo_id = ( Integer ) value; + break; + case Empresas.TO_EMPRESA_LOGO_ID_INDEX: + this.to_empresa_logo_id = ( db.data.siprp_local.outer.ImageData ) value; + break; + case Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX: + this.imprimir_tabela_alargada = ( Boolean ) value; + break; + case Empresas.CODIGO_RELATORIO_UNICO_INDEX: + this.codigo_relatorio_unico = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Empresas.ID_INDEX: + theClass = Integer.class; + break; + case Empresas.DESIGNACAO_SOCIAL_INDEX: + theClass = String.class; + break; + case Empresas.SERVICO_SAUDE_TIPO_INDEX: + theClass = Integer.class; + break; + case Empresas.SERVICO_SAUDE_DESIGNACAO_INDEX: + theClass = String.class; + break; + case Empresas.SERVICO_HIGIENE_TIPO_INDEX: + theClass = Integer.class; + break; + case Empresas.SERVICO_HIGIENE_DESIGNACAO_INDEX: + theClass = String.class; + break; + case Empresas.INACTIVO_INDEX: + theClass = String.class; + break; + case Empresas.MORADA_INDEX: + theClass = String.class; + break; + case Empresas.CODIGO_POSTAL_INDEX: + theClass = String.class; + break; + case Empresas.LOCALIDADE_INDEX: + theClass = String.class; + break; + case Empresas.DISTRITO_INDEX: + theClass = String.class; + break; + case Empresas.CONCELHO_INDEX: + theClass = String.class; + break; + case Empresas.NUMERO_TRABALHADORES_INDEX: + theClass = Integer.class; + break; + case Empresas.DATA_PROPOSTA_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.DATA_ACEITACAO_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.PERFIL_1_INDEX: + theClass = String.class; + break; + case Empresas.PERFIL_2_INDEX: + theClass = String.class; + break; + case Empresas.DATA_ENVIO_CONTRATO_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.DATA_RECEPCAO_CONTRATO_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.DATA_ENVIO_IDICT_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.CAE_INDEX: + theClass = String.class; + break; + case Empresas.CONTRIBUINTE_INDEX: + theClass = String.class; + break; + case Empresas.SEGURANCA_SOCIAL_INDEX: + theClass = String.class; + break; + case Empresas.CODIGO_1_INDEX: + theClass = String.class; + break; + case Empresas.CODIGO_2_INDEX: + theClass = String.class; + break; + case Empresas.CODIGO_3_INDEX: + theClass = String.class; + break; + case Empresas.SERVICOS_INDEX: + theClass = Integer.class; + break; + case Empresas.CONTACTO_1_INDEX: + theClass = Integer.class; + break; + case Empresas.TO_CONTACTO_1_INDEX: + theClass = db.data.siprp_local.outer.ContactosData.class; + break; + case Empresas.CONTACTO_2_INDEX: + theClass = Integer.class; + break; + case Empresas.TO_CONTACTO_2_INDEX: + theClass = db.data.siprp_local.outer.ContactosData.class; + break; + case Empresas.DATA_RELATORIO_ANUAL_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.PERIODICIDADE_INDEX: + theClass = String.class; + break; + case Empresas.ACTIVIDADE_INDEX: + theClass = String.class; + break; + case Empresas.ACTUALIZACAO_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Empresas.DESIGNACAO_SOCIAL_PLAIN_INDEX: + theClass = String.class; + break; + case Empresas.A_CONSULTAS_INDEX: + theClass = String.class; + break; + case Empresas.A_EXAMES_INDEX: + theClass = String.class; + break; + case Empresas.B_CONSULTAS_INDEX: + theClass = String.class; + break; + case Empresas.B_EXAMES_INDEX: + theClass = String.class; + break; + case Empresas.DATA_CANCELAMENTO_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.DURACAO_INDEX: + theClass = Integer.class; + break; + case Empresas.INICIO_CONTRATO_INDEX: + theClass = java.util.Date.class; + break; + case Empresas.EMPRESA_LOGO_ID_INDEX: + theClass = Integer.class; + break; + case Empresas.TO_EMPRESA_LOGO_ID_INDEX: + theClass = db.data.siprp_local.outer.ImageData.class; + break; + case Empresas.IMPRIMIR_TABELA_ALARGADA_INDEX: + theClass = Boolean.class; + break; + case Empresas.CODIGO_RELATORIO_UNICO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Empresas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Empresas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Errors.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Errors.java new file mode 100644 index 00000000..0649e573 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Errors.java @@ -0,0 +1,431 @@ +/* +* Errors.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Errors extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Errors.ID, Errors.ID_INDEX ); + FIELD_INDEXES.put( Errors.ID_FULL, Errors.ID_INDEX ); + FIELD_INDEXES.put( Errors.DATE, Errors.DATE_INDEX ); + FIELD_INDEXES.put( Errors.DATE_FULL, Errors.DATE_INDEX ); + FIELD_INDEXES.put( Errors.TYPE, Errors.TYPE_INDEX ); + FIELD_INDEXES.put( Errors.TYPE_FULL, Errors.TYPE_INDEX ); + FIELD_INDEXES.put( Errors.ENVIRONMENT, Errors.ENVIRONMENT_INDEX ); + FIELD_INDEXES.put( Errors.ENVIRONMENT_FULL, Errors.ENVIRONMENT_INDEX ); + FIELD_INDEXES.put( Errors.DESCRIPTION, Errors.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( Errors.DESCRIPTION_FULL, Errors.DESCRIPTION_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "errors"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.errors"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "errors.id"; + public static final int ID_INDEX = 0; + public static final String DATE = "date"; + public static final String DATE_FULL = "errors.date"; + public static final int DATE_INDEX = 1; + public static final String TYPE = "type"; + public static final String TYPE_FULL = "errors.type"; + public static final int TYPE_INDEX = 2; + public static final String ENVIRONMENT = "environment"; + public static final String ENVIRONMENT_FULL = "errors.environment"; + public static final int ENVIRONMENT_INDEX = 3; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "errors.description"; + public static final int DESCRIPTION_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DATE, TYPE, ENVIRONMENT, DESCRIPTION, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATE, TABLENAME + "." + TYPE, TABLENAME + "." + ENVIRONMENT, TABLENAME + "." + DESCRIPTION, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATE, TYPE, ENVIRONMENT, DESCRIPTION, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATE, TYPE, ENVIRONMENT, DESCRIPTION, }; + + private Integer id; + private java.sql.Timestamp date; + private String type; + private String environment; + private String description; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Errors() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getDate() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.date; + } + + public void setDate( java.sql.Timestamp date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATE, date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.date = date; + LAZY_LOADED_OBJECTS.put( DATE, Boolean.TRUE ); + } + + public String getType() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TYPE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.type; + } + + public void setType( String type ) + { + try + { + setLockedForRefresh( true ); + preProcess( TYPE, type ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.type = type; + LAZY_LOADED_OBJECTS.put( TYPE, Boolean.TRUE ); + } + + public String getEnvironment() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ENVIRONMENT ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.environment; + } + + public void setEnvironment( String environment ) + { + try + { + setLockedForRefresh( true ); + preProcess( ENVIRONMENT, environment ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.environment = environment; + LAZY_LOADED_OBJECTS.put( ENVIRONMENT, Boolean.TRUE ); + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + value = getId(); + break; + case Errors.DATE_INDEX: + value = getDate(); + break; + case Errors.TYPE_INDEX: + value = getType(); + break; + case Errors.ENVIRONMENT_INDEX: + value = getEnvironment(); + break; + case Errors.DESCRIPTION_INDEX: + value = getDescription(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + value = this.id; + break; + case Errors.DATE_INDEX: + value = this.date; + break; + case Errors.TYPE_INDEX: + value = this.type; + break; + case Errors.ENVIRONMENT_INDEX: + value = this.environment; + break; + case Errors.DESCRIPTION_INDEX: + value = this.description; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + setId( ( Integer ) value ); + break; + case Errors.DATE_INDEX: + setDate( ( java.sql.Timestamp ) value ); + break; + case Errors.TYPE_INDEX: + setType( ( String ) value ); + break; + case Errors.ENVIRONMENT_INDEX: + setEnvironment( ( String ) value ); + break; + case Errors.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Errors.ID_INDEX: + this.id = ( Integer ) value; + break; + case Errors.DATE_INDEX: + this.date = ( java.sql.Timestamp ) value; + break; + case Errors.TYPE_INDEX: + this.type = ( String ) value; + break; + case Errors.ENVIRONMENT_INDEX: + this.environment = ( String ) value; + break; + case Errors.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Errors.ID_INDEX: + theClass = Integer.class; + break; + case Errors.DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Errors.TYPE_INDEX: + theClass = String.class; + break; + case Errors.ENVIRONMENT_INDEX: + theClass = String.class; + break; + case Errors.DESCRIPTION_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Errors._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Errors.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Estabelecimentos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Estabelecimentos.java new file mode 100644 index 00000000..30bbda4c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Estabelecimentos.java @@ -0,0 +1,1347 @@ +/* +* Estabelecimentos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Estabelecimentos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Estabelecimentos.ID, Estabelecimentos.ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.ID_FULL, Estabelecimentos.ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.NOME, Estabelecimentos.NOME_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.NOME_FULL, Estabelecimentos.NOME_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.LOCALIDADE, Estabelecimentos.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.LOCALIDADE_FULL, Estabelecimentos.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.INACTIVO, Estabelecimentos.INACTIVO_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.INACTIVO_FULL, Estabelecimentos.INACTIVO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Estabelecimentos.CLASS_IDENTIFIER, Estabelecimentos.EMPRESA_ID, Estabelecimentos.TO_EMPRESA_ID ); + FIELD_INDEXES.put( Estabelecimentos.EMPRESA_ID, Estabelecimentos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.EMPRESA_ID_FULL, Estabelecimentos.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.TO_EMPRESA_ID, Estabelecimentos.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MORADA, Estabelecimentos.MORADA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MORADA_FULL, Estabelecimentos.MORADA_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CODIGO_POSTAL, Estabelecimentos.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CODIGO_POSTAL_FULL, Estabelecimentos.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CONTACTO_BACKUP, Estabelecimentos.CONTACTO_BACKUP_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CONTACTO_BACKUP_FULL, Estabelecimentos.CONTACTO_BACKUP_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.HISTORICO, Estabelecimentos.HISTORICO_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.HISTORICO_FULL, Estabelecimentos.HISTORICO_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.ACTUALIZACAO, Estabelecimentos.ACTUALIZACAO_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.ACTUALIZACAO_FULL, Estabelecimentos.ACTUALIZACAO_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.NOME_PLAIN, Estabelecimentos.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.NOME_PLAIN_FULL, Estabelecimentos.NOME_PLAIN_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Estabelecimentos.CLASS_IDENTIFIER, Estabelecimentos.MEDICO_ID, Estabelecimentos.TO_MEDICO_ID ); + FIELD_INDEXES.put( Estabelecimentos.MEDICO_ID, Estabelecimentos.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.MEDICO_ID_FULL, Estabelecimentos.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.TO_MEDICO_ID, Estabelecimentos.TO_MEDICO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Estabelecimentos.CLASS_IDENTIFIER, Estabelecimentos.PRESTADOR_CONSULTA_ID, Estabelecimentos.TO_PRESTADOR_CONSULTA_ID ); + FIELD_INDEXES.put( Estabelecimentos.PRESTADOR_CONSULTA_ID, Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.PRESTADOR_CONSULTA_ID_FULL, Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.TO_PRESTADOR_CONSULTA_ID, Estabelecimentos.TO_PRESTADOR_CONSULTA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Estabelecimentos.CLASS_IDENTIFIER, Estabelecimentos.PRESTADOR_ECDS_ID, Estabelecimentos.TO_PRESTADOR_ECDS_ID ); + FIELD_INDEXES.put( Estabelecimentos.PRESTADOR_ECDS_ID, Estabelecimentos.PRESTADOR_ECDS_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.PRESTADOR_ECDS_ID_FULL, Estabelecimentos.PRESTADOR_ECDS_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.TO_PRESTADOR_ECDS_ID, Estabelecimentos.TO_PRESTADOR_ECDS_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Estabelecimentos.CLASS_IDENTIFIER, Estabelecimentos.CONTACTO_ID, Estabelecimentos.TO_CONTACTO_ID ); + FIELD_INDEXES.put( Estabelecimentos.CONTACTO_ID, Estabelecimentos.CONTACTO_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.CONTACTO_ID_FULL, Estabelecimentos.CONTACTO_ID_INDEX ); + FIELD_INDEXES.put( Estabelecimentos.TO_CONTACTO_ID, Estabelecimentos.TO_CONTACTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( Estabelecimentos.class, Estabelecimentos.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymedico_idTomedicos = + new com.evolute.entity.ForeignKey( Estabelecimentos.class, Estabelecimentos.MEDICO_ID, db.data.siprp_local.outer.MedicosData.class, db.data.siprp_local.outer.MedicosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_consulta_idToprestadores = + new com.evolute.entity.ForeignKey( Estabelecimentos.class, Estabelecimentos.PRESTADOR_CONSULTA_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_ecds_idToprestadores = + new com.evolute.entity.ForeignKey( Estabelecimentos.class, Estabelecimentos.PRESTADOR_ECDS_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeycontacto_idTocontactos = + new com.evolute.entity.ForeignKey( Estabelecimentos.class, Estabelecimentos.CONTACTO_ID, db.data.siprp_local.outer.ContactosData.class, db.data.siprp_local.outer.ContactosData.ID ); + + public static final String TABLENAME = "estabelecimentos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.estabelecimentos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "estabelecimentos.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "estabelecimentos.nome"; + public static final int NOME_INDEX = 1; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "estabelecimentos.localidade"; + public static final int LOCALIDADE_INDEX = 2; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "estabelecimentos.inactivo"; + public static final int INACTIVO_INDEX = 3; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "estabelecimentos.empresa_id"; + public static final int EMPRESA_ID_INDEX = 4; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "estabelecimentos.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 5; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "estabelecimentos.morada"; + public static final int MORADA_INDEX = 6; + public static final String CODIGO_POSTAL = "codigo_postal"; + public static final String CODIGO_POSTAL_FULL = "estabelecimentos.codigo_postal"; + public static final int CODIGO_POSTAL_INDEX = 7; + public static final String CONTACTO_BACKUP = "contacto_backup"; + public static final String CONTACTO_BACKUP_FULL = "estabelecimentos.contacto_backup"; + public static final int CONTACTO_BACKUP_INDEX = 8; + public static final String HISTORICO = "historico"; + public static final String HISTORICO_FULL = "estabelecimentos.historico"; + public static final int HISTORICO_INDEX = 9; + public static final String ACTUALIZACAO = "actualizacao"; + public static final String ACTUALIZACAO_FULL = "estabelecimentos.actualizacao"; + public static final int ACTUALIZACAO_INDEX = 10; + public static final String NOME_PLAIN = "nome_plain"; + public static final String NOME_PLAIN_FULL = "estabelecimentos.nome_plain"; + public static final int NOME_PLAIN_INDEX = 11; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "estabelecimentos.medico_id"; + public static final int MEDICO_ID_INDEX = 12; + public static final String TO_MEDICO_ID = "to_medico_id"; + public static final String TO_MEDICO_ID_FULL = "estabelecimentos.to_medico_id"; + public static final int TO_MEDICO_ID_INDEX = 13; + public static final String PRESTADOR_CONSULTA_ID = "prestador_consulta_id"; + public static final String PRESTADOR_CONSULTA_ID_FULL = "estabelecimentos.prestador_consulta_id"; + public static final int PRESTADOR_CONSULTA_ID_INDEX = 14; + public static final String TO_PRESTADOR_CONSULTA_ID = "to_prestador_consulta_id"; + public static final String TO_PRESTADOR_CONSULTA_ID_FULL = "estabelecimentos.to_prestador_consulta_id"; + public static final int TO_PRESTADOR_CONSULTA_ID_INDEX = 15; + public static final String PRESTADOR_ECDS_ID = "prestador_ecds_id"; + public static final String PRESTADOR_ECDS_ID_FULL = "estabelecimentos.prestador_ecds_id"; + public static final int PRESTADOR_ECDS_ID_INDEX = 16; + public static final String TO_PRESTADOR_ECDS_ID = "to_prestador_ecds_id"; + public static final String TO_PRESTADOR_ECDS_ID_FULL = "estabelecimentos.to_prestador_ecds_id"; + public static final int TO_PRESTADOR_ECDS_ID_INDEX = 17; + public static final String CONTACTO_ID = "contacto_id"; + public static final String CONTACTO_ID_FULL = "estabelecimentos.contacto_id"; + public static final int CONTACTO_ID_INDEX = 18; + public static final String TO_CONTACTO_ID = "to_contacto_id"; + public static final String TO_CONTACTO_ID_FULL = "estabelecimentos.to_contacto_id"; + public static final int TO_CONTACTO_ID_INDEX = 19; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, LOCALIDADE, INACTIVO, EMPRESA_ID, TO_EMPRESA_ID, MORADA, CODIGO_POSTAL, + CONTACTO_BACKUP, HISTORICO, ACTUALIZACAO, NOME_PLAIN, MEDICO_ID, TO_MEDICO_ID, + PRESTADOR_CONSULTA_ID, TO_PRESTADOR_CONSULTA_ID, PRESTADOR_ECDS_ID, + TO_PRESTADOR_ECDS_ID, CONTACTO_ID, TO_CONTACTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + LOCALIDADE, TABLENAME + "." + INACTIVO, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + MORADA, TABLENAME + "." + CODIGO_POSTAL, + TABLENAME + "." + CONTACTO_BACKUP, TABLENAME + "." + HISTORICO, TABLENAME + "." + ACTUALIZACAO, TABLENAME + "." + NOME_PLAIN, TABLENAME + "." + MEDICO_ID, TABLENAME + "." + TO_MEDICO_ID, + TABLENAME + "." + PRESTADOR_CONSULTA_ID, TABLENAME + "." + TO_PRESTADOR_CONSULTA_ID, TABLENAME + "." + PRESTADOR_ECDS_ID, + TABLENAME + "." + TO_PRESTADOR_ECDS_ID, TABLENAME + "." + CONTACTO_ID, TABLENAME + "." + TO_CONTACTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, LOCALIDADE, INACTIVO, EMPRESA_ID, MORADA, CODIGO_POSTAL, CONTACTO_BACKUP, + HISTORICO, ACTUALIZACAO, NOME_PLAIN, MEDICO_ID, PRESTADOR_CONSULTA_ID, + PRESTADOR_ECDS_ID, CONTACTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, LOCALIDADE, INACTIVO, EMPRESA_ID, MORADA, CODIGO_POSTAL, CONTACTO_BACKUP, + HISTORICO, ACTUALIZACAO, NOME_PLAIN, MEDICO_ID, PRESTADOR_CONSULTA_ID, + PRESTADOR_ECDS_ID, CONTACTO_ID, }; + + private Integer id; + private String nome; + private String localidade; + private String inactivo; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private String morada; + private String codigo_postal; + private String contacto_backup; + private String historico; + private java.sql.Timestamp actualizacao; + private String nome_plain; + private Integer medico_id; + private db.data.siprp_local.outer.MedicosData to_medico_id; + private Integer prestador_consulta_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_consulta_id; + private Integer prestador_ecds_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_ecds_id; + private Integer contacto_id; + private db.data.siprp_local.outer.ContactosData to_contacto_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Estabelecimentos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false + , false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAptSegurancaAlimentar_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.AptSegurancaAlimentarData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromAvisos_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEmailPlanoDeActuacao_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmailPlanoDeActuacaoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHistoricoEstabelecimento_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HistoricoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsEmailEstabelecimento_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsEmailEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsLegislacaoEstabelecimento_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsLegislacaoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsNormalizacaoEstabelecimento_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsNormalizacaoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsPostoEstabelecimento_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromLembretes_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesEstabelecimento_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadores_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresData.class , getPrimaryKey().getMap().get("id"), "estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + setLockedForRefresh( true ); + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCodigo_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_postal; + } + + public void setCodigo_postal( String codigo_postal ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_POSTAL, codigo_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_postal = codigo_postal; + LAZY_LOADED_OBJECTS.put( CODIGO_POSTAL, Boolean.TRUE ); + } + + public String getContacto_backup() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTACTO_BACKUP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contacto_backup; + } + + public void setContacto_backup( String contacto_backup ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTACTO_BACKUP, contacto_backup ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contacto_backup = contacto_backup; + LAZY_LOADED_OBJECTS.put( CONTACTO_BACKUP, Boolean.TRUE ); + } + + public String getHistorico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HISTORICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.historico; + } + + public void setHistorico( String historico ) + { + try + { + setLockedForRefresh( true ); + preProcess( HISTORICO, historico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.historico = historico; + LAZY_LOADED_OBJECTS.put( HISTORICO, Boolean.TRUE ); + } + + public java.sql.Timestamp getActualizacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTUALIZACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.actualizacao; + } + + public void setActualizacao( java.sql.Timestamp actualizacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTUALIZACAO, actualizacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.actualizacao = actualizacao; + LAZY_LOADED_OBJECTS.put( ACTUALIZACAO, Boolean.TRUE ); + } + + public String getNome_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_plain; + } + + public void setNome_plain( String nome_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME_PLAIN, nome_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_plain = nome_plain; + LAZY_LOADED_OBJECTS.put( NOME_PLAIN, Boolean.TRUE ); + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MedicosData toMedico_id() + { + try + { + prepare( TO_MEDICO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medico_id; + } + + public void setToMedico_id( db.data.siprp_local.outer.MedicosData to_medico_id ) + { + try + { + preProcess( TO_MEDICO_ID, to_medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medico_id = to_medico_id; + } + + public Integer getPrestador_consulta_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_CONSULTA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_consulta_id; + } + + public void setPrestador_consulta_id( Integer prestador_consulta_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_CONSULTA_ID, prestador_consulta_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_consulta_id = prestador_consulta_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_CONSULTA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_consulta_id() + { + try + { + prepare( TO_PRESTADOR_CONSULTA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_consulta_id; + } + + public void setToPrestador_consulta_id( db.data.siprp_local.outer.PrestadoresData to_prestador_consulta_id ) + { + try + { + preProcess( TO_PRESTADOR_CONSULTA_ID, to_prestador_consulta_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_consulta_id = to_prestador_consulta_id; + } + + public Integer getPrestador_ecds_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ECDS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_ecds_id; + } + + public void setPrestador_ecds_id( Integer prestador_ecds_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ECDS_ID, prestador_ecds_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_ecds_id = prestador_ecds_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ECDS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_ecds_id() + { + try + { + prepare( TO_PRESTADOR_ECDS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_ecds_id; + } + + public void setToPrestador_ecds_id( db.data.siprp_local.outer.PrestadoresData to_prestador_ecds_id ) + { + try + { + preProcess( TO_PRESTADOR_ECDS_ID, to_prestador_ecds_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_ecds_id = to_prestador_ecds_id; + } + + public Integer getContacto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTACTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contacto_id; + } + + public void setContacto_id( Integer contacto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTACTO_ID, contacto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contacto_id = contacto_id; + LAZY_LOADED_OBJECTS.put( CONTACTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ContactosData toContacto_id() + { + try + { + prepare( TO_CONTACTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_contacto_id; + } + + public void setToContacto_id( db.data.siprp_local.outer.ContactosData to_contacto_id ) + { + try + { + preProcess( TO_CONTACTO_ID, to_contacto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_contacto_id = to_contacto_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + value = getId(); + break; + case Estabelecimentos.NOME_INDEX: + value = getNome(); + break; + case Estabelecimentos.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case Estabelecimentos.INACTIVO_INDEX: + value = getInactivo(); + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case Estabelecimentos.MORADA_INDEX: + value = getMorada(); + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + value = getCodigo_postal(); + break; + case Estabelecimentos.CONTACTO_BACKUP_INDEX: + value = getContacto_backup(); + break; + case Estabelecimentos.HISTORICO_INDEX: + value = getHistorico(); + break; + case Estabelecimentos.ACTUALIZACAO_INDEX: + value = getActualizacao(); + break; + case Estabelecimentos.NOME_PLAIN_INDEX: + value = getNome_plain(); + break; + case Estabelecimentos.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + case Estabelecimentos.TO_MEDICO_ID_INDEX: + value = toMedico_id(); + break; + case Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX: + value = getPrestador_consulta_id(); + break; + case Estabelecimentos.TO_PRESTADOR_CONSULTA_ID_INDEX: + value = toPrestador_consulta_id(); + break; + case Estabelecimentos.PRESTADOR_ECDS_ID_INDEX: + value = getPrestador_ecds_id(); + break; + case Estabelecimentos.TO_PRESTADOR_ECDS_ID_INDEX: + value = toPrestador_ecds_id(); + break; + case Estabelecimentos.CONTACTO_ID_INDEX: + value = getContacto_id(); + break; + case Estabelecimentos.TO_CONTACTO_ID_INDEX: + value = toContacto_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + value = this.id; + break; + case Estabelecimentos.NOME_INDEX: + value = this.nome; + break; + case Estabelecimentos.LOCALIDADE_INDEX: + value = this.localidade; + break; + case Estabelecimentos.INACTIVO_INDEX: + value = this.inactivo; + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case Estabelecimentos.MORADA_INDEX: + value = this.morada; + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + value = this.codigo_postal; + break; + case Estabelecimentos.CONTACTO_BACKUP_INDEX: + value = this.contacto_backup; + break; + case Estabelecimentos.HISTORICO_INDEX: + value = this.historico; + break; + case Estabelecimentos.ACTUALIZACAO_INDEX: + value = this.actualizacao; + break; + case Estabelecimentos.NOME_PLAIN_INDEX: + value = this.nome_plain; + break; + case Estabelecimentos.MEDICO_ID_INDEX: + value = this.medico_id; + break; + case Estabelecimentos.TO_MEDICO_ID_INDEX: + value = this.to_medico_id; + break; + case Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX: + value = this.prestador_consulta_id; + break; + case Estabelecimentos.TO_PRESTADOR_CONSULTA_ID_INDEX: + value = this.to_prestador_consulta_id; + break; + case Estabelecimentos.PRESTADOR_ECDS_ID_INDEX: + value = this.prestador_ecds_id; + break; + case Estabelecimentos.TO_PRESTADOR_ECDS_ID_INDEX: + value = this.to_prestador_ecds_id; + break; + case Estabelecimentos.CONTACTO_ID_INDEX: + value = this.contacto_id; + break; + case Estabelecimentos.TO_CONTACTO_ID_INDEX: + value = this.to_contacto_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Estabelecimentos.NOME_INDEX: + setNome( ( String ) value ); + break; + case Estabelecimentos.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case Estabelecimentos.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case Estabelecimentos.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + setCodigo_postal( ( String ) value ); + break; + case Estabelecimentos.CONTACTO_BACKUP_INDEX: + setContacto_backup( ( String ) value ); + break; + case Estabelecimentos.HISTORICO_INDEX: + setHistorico( ( String ) value ); + break; + case Estabelecimentos.ACTUALIZACAO_INDEX: + setActualizacao( ( java.sql.Timestamp ) value ); + break; + case Estabelecimentos.NOME_PLAIN_INDEX: + setNome_plain( ( String ) value ); + break; + case Estabelecimentos.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + case Estabelecimentos.TO_MEDICO_ID_INDEX: + setToMedico_id( ( db.data.siprp_local.outer.MedicosData ) value ); + break; + case Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX: + setPrestador_consulta_id( ( Integer ) value ); + break; + case Estabelecimentos.TO_PRESTADOR_CONSULTA_ID_INDEX: + setToPrestador_consulta_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case Estabelecimentos.PRESTADOR_ECDS_ID_INDEX: + setPrestador_ecds_id( ( Integer ) value ); + break; + case Estabelecimentos.TO_PRESTADOR_ECDS_ID_INDEX: + setToPrestador_ecds_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case Estabelecimentos.CONTACTO_ID_INDEX: + setContacto_id( ( Integer ) value ); + break; + case Estabelecimentos.TO_CONTACTO_ID_INDEX: + setToContacto_id( ( db.data.siprp_local.outer.ContactosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Estabelecimentos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Estabelecimentos.NOME_INDEX: + this.nome = ( String ) value; + break; + case Estabelecimentos.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case Estabelecimentos.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case Estabelecimentos.MORADA_INDEX: + this.morada = ( String ) value; + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + this.codigo_postal = ( String ) value; + break; + case Estabelecimentos.CONTACTO_BACKUP_INDEX: + this.contacto_backup = ( String ) value; + break; + case Estabelecimentos.HISTORICO_INDEX: + this.historico = ( String ) value; + break; + case Estabelecimentos.ACTUALIZACAO_INDEX: + this.actualizacao = ( java.sql.Timestamp ) value; + break; + case Estabelecimentos.NOME_PLAIN_INDEX: + this.nome_plain = ( String ) value; + break; + case Estabelecimentos.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + case Estabelecimentos.TO_MEDICO_ID_INDEX: + this.to_medico_id = ( db.data.siprp_local.outer.MedicosData ) value; + break; + case Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX: + this.prestador_consulta_id = ( Integer ) value; + break; + case Estabelecimentos.TO_PRESTADOR_CONSULTA_ID_INDEX: + this.to_prestador_consulta_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case Estabelecimentos.PRESTADOR_ECDS_ID_INDEX: + this.prestador_ecds_id = ( Integer ) value; + break; + case Estabelecimentos.TO_PRESTADOR_ECDS_ID_INDEX: + this.to_prestador_ecds_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case Estabelecimentos.CONTACTO_ID_INDEX: + this.contacto_id = ( Integer ) value; + break; + case Estabelecimentos.TO_CONTACTO_ID_INDEX: + this.to_contacto_id = ( db.data.siprp_local.outer.ContactosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Estabelecimentos.ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.NOME_INDEX: + theClass = String.class; + break; + case Estabelecimentos.LOCALIDADE_INDEX: + theClass = String.class; + break; + case Estabelecimentos.INACTIVO_INDEX: + theClass = String.class; + break; + case Estabelecimentos.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case Estabelecimentos.MORADA_INDEX: + theClass = String.class; + break; + case Estabelecimentos.CODIGO_POSTAL_INDEX: + theClass = String.class; + break; + case Estabelecimentos.CONTACTO_BACKUP_INDEX: + theClass = String.class; + break; + case Estabelecimentos.HISTORICO_INDEX: + theClass = String.class; + break; + case Estabelecimentos.ACTUALIZACAO_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Estabelecimentos.NOME_PLAIN_INDEX: + theClass = String.class; + break; + case Estabelecimentos.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.TO_MEDICO_ID_INDEX: + theClass = db.data.siprp_local.outer.MedicosData.class; + break; + case Estabelecimentos.PRESTADOR_CONSULTA_ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.TO_PRESTADOR_CONSULTA_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case Estabelecimentos.PRESTADOR_ECDS_ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.TO_PRESTADOR_ECDS_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case Estabelecimentos.CONTACTO_ID_INDEX: + theClass = Integer.class; + break; + case Estabelecimentos.TO_CONTACTO_ID_INDEX: + theClass = db.data.siprp_local.outer.ContactosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Estabelecimentos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Estabelecimentos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Etiquetas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Etiquetas.java new file mode 100644 index 00000000..676abf37 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Etiquetas.java @@ -0,0 +1,890 @@ +/* +* Etiquetas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Etiquetas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Etiquetas.ID, Etiquetas.ID_INDEX ); + FIELD_INDEXES.put( Etiquetas.ID_FULL, Etiquetas.ID_INDEX ); + FIELD_INDEXES.put( Etiquetas.DESCRICAO, Etiquetas.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Etiquetas.DESCRICAO_FULL, Etiquetas.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Etiquetas.DESCRICAO_PLAIN, Etiquetas.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( Etiquetas.DESCRICAO_PLAIN_FULL, Etiquetas.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( Etiquetas.ALTURA, Etiquetas.ALTURA_INDEX ); + FIELD_INDEXES.put( Etiquetas.ALTURA_FULL, Etiquetas.ALTURA_INDEX ); + FIELD_INDEXES.put( Etiquetas.LARGURA, Etiquetas.LARGURA_INDEX ); + FIELD_INDEXES.put( Etiquetas.LARGURA_FULL, Etiquetas.LARGURA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_ESQUERDA, Etiquetas.MARGEM_ESQUERDA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_ESQUERDA_FULL, Etiquetas.MARGEM_ESQUERDA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_CIMA, Etiquetas.MARGEM_CIMA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_CIMA_FULL, Etiquetas.MARGEM_CIMA_INDEX ); + FIELD_INDEXES.put( Etiquetas.COLUNAS, Etiquetas.COLUNAS_INDEX ); + FIELD_INDEXES.put( Etiquetas.COLUNAS_FULL, Etiquetas.COLUNAS_INDEX ); + FIELD_INDEXES.put( Etiquetas.LINHAS, Etiquetas.LINHAS_INDEX ); + FIELD_INDEXES.put( Etiquetas.LINHAS_FULL, Etiquetas.LINHAS_INDEX ); + FIELD_INDEXES.put( Etiquetas.CONTINUA, Etiquetas.CONTINUA_INDEX ); + FIELD_INDEXES.put( Etiquetas.CONTINUA_FULL, Etiquetas.CONTINUA_INDEX ); + FIELD_INDEXES.put( Etiquetas.ALTURA_FOLHA, Etiquetas.ALTURA_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.ALTURA_FOLHA_FULL, Etiquetas.ALTURA_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.LARGURA_FOLHA, Etiquetas.LARGURA_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.LARGURA_FOLHA_FULL, Etiquetas.LARGURA_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_VERTICAL_FOLHA, Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_VERTICAL_FOLHA_FULL, Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_HORIZONTAL_FOLHA, Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX ); + FIELD_INDEXES.put( Etiquetas.MARGEM_HORIZONTAL_FOLHA_FULL, Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "etiquetas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.etiquetas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "etiquetas.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "etiquetas.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DESCRICAO_PLAIN = "descricao_plain"; + public static final String DESCRICAO_PLAIN_FULL = "etiquetas.descricao_plain"; + public static final int DESCRICAO_PLAIN_INDEX = 2; + public static final String ALTURA = "altura"; + public static final String ALTURA_FULL = "etiquetas.altura"; + public static final int ALTURA_INDEX = 3; + public static final String LARGURA = "largura"; + public static final String LARGURA_FULL = "etiquetas.largura"; + public static final int LARGURA_INDEX = 4; + public static final String MARGEM_ESQUERDA = "margem_esquerda"; + public static final String MARGEM_ESQUERDA_FULL = "etiquetas.margem_esquerda"; + public static final int MARGEM_ESQUERDA_INDEX = 5; + public static final String MARGEM_CIMA = "margem_cima"; + public static final String MARGEM_CIMA_FULL = "etiquetas.margem_cima"; + public static final int MARGEM_CIMA_INDEX = 6; + public static final String COLUNAS = "colunas"; + public static final String COLUNAS_FULL = "etiquetas.colunas"; + public static final int COLUNAS_INDEX = 7; + public static final String LINHAS = "linhas"; + public static final String LINHAS_FULL = "etiquetas.linhas"; + public static final int LINHAS_INDEX = 8; + public static final String CONTINUA = "continua"; + public static final String CONTINUA_FULL = "etiquetas.continua"; + public static final int CONTINUA_INDEX = 9; + public static final String ALTURA_FOLHA = "altura_folha"; + public static final String ALTURA_FOLHA_FULL = "etiquetas.altura_folha"; + public static final int ALTURA_FOLHA_INDEX = 10; + public static final String LARGURA_FOLHA = "largura_folha"; + public static final String LARGURA_FOLHA_FULL = "etiquetas.largura_folha"; + public static final int LARGURA_FOLHA_INDEX = 11; + public static final String MARGEM_VERTICAL_FOLHA = "margem_vertical_folha"; + public static final String MARGEM_VERTICAL_FOLHA_FULL = "etiquetas.margem_vertical_folha"; + public static final int MARGEM_VERTICAL_FOLHA_INDEX = 12; + public static final String MARGEM_HORIZONTAL_FOLHA = "margem_horizontal_folha"; + public static final String MARGEM_HORIZONTAL_FOLHA_FULL = "etiquetas.margem_horizontal_folha"; + public static final int MARGEM_HORIZONTAL_FOLHA_INDEX = 13; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DESCRICAO_PLAIN, ALTURA, LARGURA, MARGEM_ESQUERDA, MARGEM_CIMA, COLUNAS, + LINHAS, CONTINUA, ALTURA_FOLHA, LARGURA_FOLHA, MARGEM_VERTICAL_FOLHA, + MARGEM_HORIZONTAL_FOLHA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + ALTURA, TABLENAME + "." + LARGURA, TABLENAME + "." + MARGEM_ESQUERDA, TABLENAME + "." + MARGEM_CIMA, TABLENAME + "." + COLUNAS, + TABLENAME + "." + LINHAS, TABLENAME + "." + CONTINUA, TABLENAME + "." + ALTURA_FOLHA, TABLENAME + "." + LARGURA_FOLHA, TABLENAME + "." + MARGEM_VERTICAL_FOLHA, + TABLENAME + "." + MARGEM_HORIZONTAL_FOLHA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DESCRICAO_PLAIN, ALTURA, LARGURA, MARGEM_ESQUERDA, MARGEM_CIMA, + COLUNAS, LINHAS, CONTINUA, ALTURA_FOLHA, LARGURA_FOLHA, MARGEM_VERTICAL_FOLHA, + MARGEM_HORIZONTAL_FOLHA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DESCRICAO_PLAIN, ALTURA, LARGURA, MARGEM_ESQUERDA, MARGEM_CIMA, + COLUNAS, LINHAS, CONTINUA, ALTURA_FOLHA, LARGURA_FOLHA, MARGEM_VERTICAL_FOLHA, + MARGEM_HORIZONTAL_FOLHA, }; + + private Integer id; + private String descricao; + private String descricao_plain; + private Float altura; + private Float largura; + private Float margem_esquerda; + private Float margem_cima; + private Integer colunas; + private Integer linhas; + private String continua; + private Float altura_folha; + private Float largura_folha; + private Float margem_vertical_folha; + private Float margem_horizontal_folha; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Etiquetas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getDescricao_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao_plain; + } + + public void setDescricao_plain( String descricao_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO_PLAIN, descricao_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao_plain = descricao_plain; + LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, Boolean.TRUE ); + } + + public Float getAltura() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ALTURA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.altura; + } + + public void setAltura( Float altura ) + { + try + { + setLockedForRefresh( true ); + preProcess( ALTURA, altura ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.altura = altura; + LAZY_LOADED_OBJECTS.put( ALTURA, Boolean.TRUE ); + } + + public Float getLargura() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LARGURA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.largura; + } + + public void setLargura( Float largura ) + { + try + { + setLockedForRefresh( true ); + preProcess( LARGURA, largura ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.largura = largura; + LAZY_LOADED_OBJECTS.put( LARGURA, Boolean.TRUE ); + } + + public Float getMargem_esquerda() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARGEM_ESQUERDA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.margem_esquerda; + } + + public void setMargem_esquerda( Float margem_esquerda ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARGEM_ESQUERDA, margem_esquerda ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.margem_esquerda = margem_esquerda; + LAZY_LOADED_OBJECTS.put( MARGEM_ESQUERDA, Boolean.TRUE ); + } + + public Float getMargem_cima() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARGEM_CIMA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.margem_cima; + } + + public void setMargem_cima( Float margem_cima ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARGEM_CIMA, margem_cima ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.margem_cima = margem_cima; + LAZY_LOADED_OBJECTS.put( MARGEM_CIMA, Boolean.TRUE ); + } + + public Integer getColunas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( COLUNAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.colunas; + } + + public void setColunas( Integer colunas ) + { + try + { + setLockedForRefresh( true ); + preProcess( COLUNAS, colunas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.colunas = colunas; + LAZY_LOADED_OBJECTS.put( COLUNAS, Boolean.TRUE ); + } + + public Integer getLinhas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LINHAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.linhas; + } + + public void setLinhas( Integer linhas ) + { + try + { + setLockedForRefresh( true ); + preProcess( LINHAS, linhas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.linhas = linhas; + LAZY_LOADED_OBJECTS.put( LINHAS, Boolean.TRUE ); + } + + public String getContinua() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTINUA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.continua; + } + + public void setContinua( String continua ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTINUA, continua ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.continua = continua; + LAZY_LOADED_OBJECTS.put( CONTINUA, Boolean.TRUE ); + } + + public Float getAltura_folha() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ALTURA_FOLHA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.altura_folha; + } + + public void setAltura_folha( Float altura_folha ) + { + try + { + setLockedForRefresh( true ); + preProcess( ALTURA_FOLHA, altura_folha ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.altura_folha = altura_folha; + LAZY_LOADED_OBJECTS.put( ALTURA_FOLHA, Boolean.TRUE ); + } + + public Float getLargura_folha() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LARGURA_FOLHA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.largura_folha; + } + + public void setLargura_folha( Float largura_folha ) + { + try + { + setLockedForRefresh( true ); + preProcess( LARGURA_FOLHA, largura_folha ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.largura_folha = largura_folha; + LAZY_LOADED_OBJECTS.put( LARGURA_FOLHA, Boolean.TRUE ); + } + + public Float getMargem_vertical_folha() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARGEM_VERTICAL_FOLHA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.margem_vertical_folha; + } + + public void setMargem_vertical_folha( Float margem_vertical_folha ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARGEM_VERTICAL_FOLHA, margem_vertical_folha ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.margem_vertical_folha = margem_vertical_folha; + LAZY_LOADED_OBJECTS.put( MARGEM_VERTICAL_FOLHA, Boolean.TRUE ); + } + + public Float getMargem_horizontal_folha() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARGEM_HORIZONTAL_FOLHA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.margem_horizontal_folha; + } + + public void setMargem_horizontal_folha( Float margem_horizontal_folha ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARGEM_HORIZONTAL_FOLHA, margem_horizontal_folha ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.margem_horizontal_folha = margem_horizontal_folha; + LAZY_LOADED_OBJECTS.put( MARGEM_HORIZONTAL_FOLHA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Etiquetas.ID_INDEX: + value = getId(); + break; + case Etiquetas.DESCRICAO_INDEX: + value = getDescricao(); + break; + case Etiquetas.DESCRICAO_PLAIN_INDEX: + value = getDescricao_plain(); + break; + case Etiquetas.ALTURA_INDEX: + value = getAltura(); + break; + case Etiquetas.LARGURA_INDEX: + value = getLargura(); + break; + case Etiquetas.MARGEM_ESQUERDA_INDEX: + value = getMargem_esquerda(); + break; + case Etiquetas.MARGEM_CIMA_INDEX: + value = getMargem_cima(); + break; + case Etiquetas.COLUNAS_INDEX: + value = getColunas(); + break; + case Etiquetas.LINHAS_INDEX: + value = getLinhas(); + break; + case Etiquetas.CONTINUA_INDEX: + value = getContinua(); + break; + case Etiquetas.ALTURA_FOLHA_INDEX: + value = getAltura_folha(); + break; + case Etiquetas.LARGURA_FOLHA_INDEX: + value = getLargura_folha(); + break; + case Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX: + value = getMargem_vertical_folha(); + break; + case Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX: + value = getMargem_horizontal_folha(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Etiquetas.ID_INDEX: + value = this.id; + break; + case Etiquetas.DESCRICAO_INDEX: + value = this.descricao; + break; + case Etiquetas.DESCRICAO_PLAIN_INDEX: + value = this.descricao_plain; + break; + case Etiquetas.ALTURA_INDEX: + value = this.altura; + break; + case Etiquetas.LARGURA_INDEX: + value = this.largura; + break; + case Etiquetas.MARGEM_ESQUERDA_INDEX: + value = this.margem_esquerda; + break; + case Etiquetas.MARGEM_CIMA_INDEX: + value = this.margem_cima; + break; + case Etiquetas.COLUNAS_INDEX: + value = this.colunas; + break; + case Etiquetas.LINHAS_INDEX: + value = this.linhas; + break; + case Etiquetas.CONTINUA_INDEX: + value = this.continua; + break; + case Etiquetas.ALTURA_FOLHA_INDEX: + value = this.altura_folha; + break; + case Etiquetas.LARGURA_FOLHA_INDEX: + value = this.largura_folha; + break; + case Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX: + value = this.margem_vertical_folha; + break; + case Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX: + value = this.margem_horizontal_folha; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Etiquetas.ID_INDEX: + setId( ( Integer ) value ); + break; + case Etiquetas.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case Etiquetas.DESCRICAO_PLAIN_INDEX: + setDescricao_plain( ( String ) value ); + break; + case Etiquetas.ALTURA_INDEX: + setAltura( ( Float ) value ); + break; + case Etiquetas.LARGURA_INDEX: + setLargura( ( Float ) value ); + break; + case Etiquetas.MARGEM_ESQUERDA_INDEX: + setMargem_esquerda( ( Float ) value ); + break; + case Etiquetas.MARGEM_CIMA_INDEX: + setMargem_cima( ( Float ) value ); + break; + case Etiquetas.COLUNAS_INDEX: + setColunas( ( Integer ) value ); + break; + case Etiquetas.LINHAS_INDEX: + setLinhas( ( Integer ) value ); + break; + case Etiquetas.CONTINUA_INDEX: + setContinua( ( String ) value ); + break; + case Etiquetas.ALTURA_FOLHA_INDEX: + setAltura_folha( ( Float ) value ); + break; + case Etiquetas.LARGURA_FOLHA_INDEX: + setLargura_folha( ( Float ) value ); + break; + case Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX: + setMargem_vertical_folha( ( Float ) value ); + break; + case Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX: + setMargem_horizontal_folha( ( Float ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Etiquetas.ID_INDEX: + this.id = ( Integer ) value; + break; + case Etiquetas.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case Etiquetas.DESCRICAO_PLAIN_INDEX: + this.descricao_plain = ( String ) value; + break; + case Etiquetas.ALTURA_INDEX: + this.altura = ( Float ) value; + break; + case Etiquetas.LARGURA_INDEX: + this.largura = ( Float ) value; + break; + case Etiquetas.MARGEM_ESQUERDA_INDEX: + this.margem_esquerda = ( Float ) value; + break; + case Etiquetas.MARGEM_CIMA_INDEX: + this.margem_cima = ( Float ) value; + break; + case Etiquetas.COLUNAS_INDEX: + this.colunas = ( Integer ) value; + break; + case Etiquetas.LINHAS_INDEX: + this.linhas = ( Integer ) value; + break; + case Etiquetas.CONTINUA_INDEX: + this.continua = ( String ) value; + break; + case Etiquetas.ALTURA_FOLHA_INDEX: + this.altura_folha = ( Float ) value; + break; + case Etiquetas.LARGURA_FOLHA_INDEX: + this.largura_folha = ( Float ) value; + break; + case Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX: + this.margem_vertical_folha = ( Float ) value; + break; + case Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX: + this.margem_horizontal_folha = ( Float ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Etiquetas.ID_INDEX: + theClass = Integer.class; + break; + case Etiquetas.DESCRICAO_INDEX: + theClass = String.class; + break; + case Etiquetas.DESCRICAO_PLAIN_INDEX: + theClass = String.class; + break; + case Etiquetas.ALTURA_INDEX: + theClass = Float.class; + break; + case Etiquetas.LARGURA_INDEX: + theClass = Float.class; + break; + case Etiquetas.MARGEM_ESQUERDA_INDEX: + theClass = Float.class; + break; + case Etiquetas.MARGEM_CIMA_INDEX: + theClass = Float.class; + break; + case Etiquetas.COLUNAS_INDEX: + theClass = Integer.class; + break; + case Etiquetas.LINHAS_INDEX: + theClass = Integer.class; + break; + case Etiquetas.CONTINUA_INDEX: + theClass = String.class; + break; + case Etiquetas.ALTURA_FOLHA_INDEX: + theClass = Float.class; + break; + case Etiquetas.LARGURA_FOLHA_INDEX: + theClass = Float.class; + break; + case Etiquetas.MARGEM_VERTICAL_FOLHA_INDEX: + theClass = Float.class; + break; + case Etiquetas.MARGEM_HORIZONTAL_FOLHA_INDEX: + theClass = Float.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Etiquetas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Etiquetas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoPessoa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoPessoa.java new file mode 100644 index 00000000..46abf268 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoPessoa.java @@ -0,0 +1,914 @@ +/* +* EvoPessoa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoPessoa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EvoPessoa.ID, EvoPessoa.ID_INDEX ); + FIELD_INDEXES.put( EvoPessoa.ID_FULL, EvoPessoa.ID_INDEX ); + FIELD_INDEXES.put( EvoPessoa.NOME, EvoPessoa.NOME_INDEX ); + FIELD_INDEXES.put( EvoPessoa.NOME_FULL, EvoPessoa.NOME_INDEX ); + FIELD_INDEXES.put( EvoPessoa.MORADA, EvoPessoa.MORADA_INDEX ); + FIELD_INDEXES.put( EvoPessoa.MORADA_FULL, EvoPessoa.MORADA_INDEX ); + FIELD_INDEXES.put( EvoPessoa.CIDADE, EvoPessoa.CIDADE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.CIDADE_FULL, EvoPessoa.CIDADE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.LOCALIDADE, EvoPessoa.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.LOCALIDADE_FULL, EvoPessoa.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.CODIGO_POSTAL, EvoPessoa.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( EvoPessoa.CODIGO_POSTAL_FULL, EvoPessoa.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( EvoPessoa.EMAIL, EvoPessoa.EMAIL_INDEX ); + FIELD_INDEXES.put( EvoPessoa.EMAIL_FULL, EvoPessoa.EMAIL_INDEX ); + FIELD_INDEXES.put( EvoPessoa.TELEFONE, EvoPessoa.TELEFONE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.TELEFONE_FULL, EvoPessoa.TELEFONE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.TELEMOVEL, EvoPessoa.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( EvoPessoa.TELEMOVEL_FULL, EvoPessoa.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( EvoPessoa.DATA_NASCIMENTO, EvoPessoa.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( EvoPessoa.DATA_NASCIMENTO_FULL, EvoPessoa.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( EvoPessoa.NATURALIDADE, EvoPessoa.NATURALIDADE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.NATURALIDADE_FULL, EvoPessoa.NATURALIDADE_INDEX ); + FIELD_INDEXES.put( EvoPessoa.NACIONALIDADE_ID, EvoPessoa.NACIONALIDADE_ID_INDEX ); + FIELD_INDEXES.put( EvoPessoa.NACIONALIDADE_ID_FULL, EvoPessoa.NACIONALIDADE_ID_INDEX ); + FIELD_INDEXES.put( EvoPessoa.SEXO, EvoPessoa.SEXO_INDEX ); + FIELD_INDEXES.put( EvoPessoa.SEXO_FULL, EvoPessoa.SEXO_INDEX ); + FIELD_INDEXES.put( EvoPessoa.PROFISSAO, EvoPessoa.PROFISSAO_INDEX ); + FIELD_INDEXES.put( EvoPessoa.PROFISSAO_FULL, EvoPessoa.PROFISSAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "evo_pessoa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_pessoa"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "evo_pessoa.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "evo_pessoa.nome"; + public static final int NOME_INDEX = 1; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "evo_pessoa.morada"; + public static final int MORADA_INDEX = 2; + public static final String CIDADE = "cidade"; + public static final String CIDADE_FULL = "evo_pessoa.cidade"; + public static final int CIDADE_INDEX = 3; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "evo_pessoa.localidade"; + public static final int LOCALIDADE_INDEX = 4; + public static final String CODIGO_POSTAL = "codigo_postal"; + public static final String CODIGO_POSTAL_FULL = "evo_pessoa.codigo_postal"; + public static final int CODIGO_POSTAL_INDEX = 5; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "evo_pessoa.email"; + public static final int EMAIL_INDEX = 6; + public static final String TELEFONE = "telefone"; + public static final String TELEFONE_FULL = "evo_pessoa.telefone"; + public static final int TELEFONE_INDEX = 7; + public static final String TELEMOVEL = "telemovel"; + public static final String TELEMOVEL_FULL = "evo_pessoa.telemovel"; + public static final int TELEMOVEL_INDEX = 8; + public static final String DATA_NASCIMENTO = "data_nascimento"; + public static final String DATA_NASCIMENTO_FULL = "evo_pessoa.data_nascimento"; + public static final int DATA_NASCIMENTO_INDEX = 9; + public static final String NATURALIDADE = "naturalidade"; + public static final String NATURALIDADE_FULL = "evo_pessoa.naturalidade"; + public static final int NATURALIDADE_INDEX = 10; + public static final String NACIONALIDADE_ID = "nacionalidade_id"; + public static final String NACIONALIDADE_ID_FULL = "evo_pessoa.nacionalidade_id"; + public static final int NACIONALIDADE_ID_INDEX = 11; + public static final String SEXO = "sexo"; + public static final String SEXO_FULL = "evo_pessoa.sexo"; + public static final int SEXO_INDEX = 12; + public static final String PROFISSAO = "profissao"; + public static final String PROFISSAO_FULL = "evo_pessoa.profissao"; + public static final int PROFISSAO_INDEX = 13; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, MORADA, CIDADE, LOCALIDADE, CODIGO_POSTAL, EMAIL, TELEFONE, TELEMOVEL, + DATA_NASCIMENTO, NATURALIDADE, NACIONALIDADE_ID, SEXO, PROFISSAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + MORADA, TABLENAME + "." + CIDADE, TABLENAME + "." + LOCALIDADE, TABLENAME + "." + CODIGO_POSTAL, TABLENAME + "." + EMAIL, TABLENAME + "." + TELEFONE, TABLENAME + "." + TELEMOVEL, + TABLENAME + "." + DATA_NASCIMENTO, TABLENAME + "." + NATURALIDADE, TABLENAME + "." + NACIONALIDADE_ID, TABLENAME + "." + SEXO, TABLENAME + "." + PROFISSAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, MORADA, CIDADE, LOCALIDADE, CODIGO_POSTAL, EMAIL, TELEFONE, TELEMOVEL, + DATA_NASCIMENTO, NATURALIDADE, NACIONALIDADE_ID, SEXO, PROFISSAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, MORADA, CIDADE, LOCALIDADE, CODIGO_POSTAL, EMAIL, TELEFONE, TELEMOVEL, + DATA_NASCIMENTO, NATURALIDADE, NACIONALIDADE_ID, SEXO, PROFISSAO, }; + + private Integer id; + private String nome; + private String morada; + private String cidade; + private String localidade; + private String codigo_postal; + private String email; + private String telefone; + private Integer telemovel; + private java.util.Date data_nascimento; + private String naturalidade; + private Integer nacionalidade_id; + private String sexo; + private String profissao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoPessoa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPesPessoaDocumento_pessoa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PesPessoaDocumentoData.class , getPrimaryKey().getMap().get("id"), "pessoa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadores_pessoa_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresData.class , getPrimaryKey().getMap().get("id"), "pessoa_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + setLockedForRefresh( true ); + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cidade; + } + + public void setCidade( String cidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( CIDADE, cidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cidade = cidade; + LAZY_LOADED_OBJECTS.put( CIDADE, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public String getCodigo_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_postal; + } + + public void setCodigo_postal( String codigo_postal ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_POSTAL, codigo_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_postal = codigo_postal; + LAZY_LOADED_OBJECTS.put( CODIGO_POSTAL, Boolean.TRUE ); + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public String getTelefone() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEFONE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telefone; + } + + public void setTelefone( String telefone ) + { + try + { + setLockedForRefresh( true ); + preProcess( TELEFONE, telefone ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telefone = telefone; + LAZY_LOADED_OBJECTS.put( TELEFONE, Boolean.TRUE ); + } + + public Integer getTelemovel() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEMOVEL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telemovel; + } + + public void setTelemovel( Integer telemovel ) + { + try + { + setLockedForRefresh( true ); + preProcess( TELEMOVEL, telemovel ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telemovel = telemovel; + LAZY_LOADED_OBJECTS.put( TELEMOVEL, Boolean.TRUE ); + } + + public java.util.Date getData_nascimento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_NASCIMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_nascimento; + } + + public void setData_nascimento( java.util.Date data_nascimento ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_NASCIMENTO, data_nascimento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_nascimento = data_nascimento; + LAZY_LOADED_OBJECTS.put( DATA_NASCIMENTO, Boolean.TRUE ); + } + + public String getNaturalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NATURALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.naturalidade; + } + + public void setNaturalidade( String naturalidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( NATURALIDADE, naturalidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.naturalidade = naturalidade; + LAZY_LOADED_OBJECTS.put( NATURALIDADE, Boolean.TRUE ); + } + + public Integer getNacionalidade_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NACIONALIDADE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nacionalidade_id; + } + + public void setNacionalidade_id( Integer nacionalidade_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( NACIONALIDADE_ID, nacionalidade_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nacionalidade_id = nacionalidade_id; + LAZY_LOADED_OBJECTS.put( NACIONALIDADE_ID, Boolean.TRUE ); + } + + public String getSexo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEXO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.sexo; + } + + public void setSexo( String sexo ) + { + try + { + setLockedForRefresh( true ); + preProcess( SEXO, sexo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.sexo = sexo; + LAZY_LOADED_OBJECTS.put( SEXO, Boolean.TRUE ); + } + + public String getProfissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROFISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.profissao; + } + + public void setProfissao( String profissao ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROFISSAO, profissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.profissao = profissao; + LAZY_LOADED_OBJECTS.put( PROFISSAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoPessoa.ID_INDEX: + value = getId(); + break; + case EvoPessoa.NOME_INDEX: + value = getNome(); + break; + case EvoPessoa.MORADA_INDEX: + value = getMorada(); + break; + case EvoPessoa.CIDADE_INDEX: + value = getCidade(); + break; + case EvoPessoa.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case EvoPessoa.CODIGO_POSTAL_INDEX: + value = getCodigo_postal(); + break; + case EvoPessoa.EMAIL_INDEX: + value = getEmail(); + break; + case EvoPessoa.TELEFONE_INDEX: + value = getTelefone(); + break; + case EvoPessoa.TELEMOVEL_INDEX: + value = getTelemovel(); + break; + case EvoPessoa.DATA_NASCIMENTO_INDEX: + value = getData_nascimento(); + break; + case EvoPessoa.NATURALIDADE_INDEX: + value = getNaturalidade(); + break; + case EvoPessoa.NACIONALIDADE_ID_INDEX: + value = getNacionalidade_id(); + break; + case EvoPessoa.SEXO_INDEX: + value = getSexo(); + break; + case EvoPessoa.PROFISSAO_INDEX: + value = getProfissao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoPessoa.ID_INDEX: + value = this.id; + break; + case EvoPessoa.NOME_INDEX: + value = this.nome; + break; + case EvoPessoa.MORADA_INDEX: + value = this.morada; + break; + case EvoPessoa.CIDADE_INDEX: + value = this.cidade; + break; + case EvoPessoa.LOCALIDADE_INDEX: + value = this.localidade; + break; + case EvoPessoa.CODIGO_POSTAL_INDEX: + value = this.codigo_postal; + break; + case EvoPessoa.EMAIL_INDEX: + value = this.email; + break; + case EvoPessoa.TELEFONE_INDEX: + value = this.telefone; + break; + case EvoPessoa.TELEMOVEL_INDEX: + value = this.telemovel; + break; + case EvoPessoa.DATA_NASCIMENTO_INDEX: + value = this.data_nascimento; + break; + case EvoPessoa.NATURALIDADE_INDEX: + value = this.naturalidade; + break; + case EvoPessoa.NACIONALIDADE_ID_INDEX: + value = this.nacionalidade_id; + break; + case EvoPessoa.SEXO_INDEX: + value = this.sexo; + break; + case EvoPessoa.PROFISSAO_INDEX: + value = this.profissao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoPessoa.ID_INDEX: + setId( ( Integer ) value ); + break; + case EvoPessoa.NOME_INDEX: + setNome( ( String ) value ); + break; + case EvoPessoa.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case EvoPessoa.CIDADE_INDEX: + setCidade( ( String ) value ); + break; + case EvoPessoa.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case EvoPessoa.CODIGO_POSTAL_INDEX: + setCodigo_postal( ( String ) value ); + break; + case EvoPessoa.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + case EvoPessoa.TELEFONE_INDEX: + setTelefone( ( String ) value ); + break; + case EvoPessoa.TELEMOVEL_INDEX: + setTelemovel( ( Integer ) value ); + break; + case EvoPessoa.DATA_NASCIMENTO_INDEX: + setData_nascimento( ( java.util.Date ) value ); + break; + case EvoPessoa.NATURALIDADE_INDEX: + setNaturalidade( ( String ) value ); + break; + case EvoPessoa.NACIONALIDADE_ID_INDEX: + setNacionalidade_id( ( Integer ) value ); + break; + case EvoPessoa.SEXO_INDEX: + setSexo( ( String ) value ); + break; + case EvoPessoa.PROFISSAO_INDEX: + setProfissao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoPessoa.ID_INDEX: + this.id = ( Integer ) value; + break; + case EvoPessoa.NOME_INDEX: + this.nome = ( String ) value; + break; + case EvoPessoa.MORADA_INDEX: + this.morada = ( String ) value; + break; + case EvoPessoa.CIDADE_INDEX: + this.cidade = ( String ) value; + break; + case EvoPessoa.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case EvoPessoa.CODIGO_POSTAL_INDEX: + this.codigo_postal = ( String ) value; + break; + case EvoPessoa.EMAIL_INDEX: + this.email = ( String ) value; + break; + case EvoPessoa.TELEFONE_INDEX: + this.telefone = ( String ) value; + break; + case EvoPessoa.TELEMOVEL_INDEX: + this.telemovel = ( Integer ) value; + break; + case EvoPessoa.DATA_NASCIMENTO_INDEX: + this.data_nascimento = ( java.util.Date ) value; + break; + case EvoPessoa.NATURALIDADE_INDEX: + this.naturalidade = ( String ) value; + break; + case EvoPessoa.NACIONALIDADE_ID_INDEX: + this.nacionalidade_id = ( Integer ) value; + break; + case EvoPessoa.SEXO_INDEX: + this.sexo = ( String ) value; + break; + case EvoPessoa.PROFISSAO_INDEX: + this.profissao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoPessoa.ID_INDEX: + theClass = Integer.class; + break; + case EvoPessoa.NOME_INDEX: + theClass = String.class; + break; + case EvoPessoa.MORADA_INDEX: + theClass = String.class; + break; + case EvoPessoa.CIDADE_INDEX: + theClass = String.class; + break; + case EvoPessoa.LOCALIDADE_INDEX: + theClass = String.class; + break; + case EvoPessoa.CODIGO_POSTAL_INDEX: + theClass = String.class; + break; + case EvoPessoa.EMAIL_INDEX: + theClass = String.class; + break; + case EvoPessoa.TELEFONE_INDEX: + theClass = String.class; + break; + case EvoPessoa.TELEMOVEL_INDEX: + theClass = Integer.class; + break; + case EvoPessoa.DATA_NASCIMENTO_INDEX: + theClass = java.util.Date.class; + break; + case EvoPessoa.NATURALIDADE_INDEX: + theClass = String.class; + break; + case EvoPessoa.NACIONALIDADE_ID_INDEX: + theClass = Integer.class; + break; + case EvoPessoa.SEXO_INDEX: + theClass = String.class; + break; + case EvoPessoa.PROFISSAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoPessoa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoPessoa.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUpdate.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUpdate.java new file mode 100644 index 00000000..e3bab506 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUpdate.java @@ -0,0 +1,330 @@ +/* +* EvoUpdate.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoUpdate extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EvoUpdate.ID, EvoUpdate.ID_INDEX ); + FIELD_INDEXES.put( EvoUpdate.ID_FULL, EvoUpdate.ID_INDEX ); + FIELD_INDEXES.put( EvoUpdate.TIME, EvoUpdate.TIME_INDEX ); + FIELD_INDEXES.put( EvoUpdate.TIME_FULL, EvoUpdate.TIME_INDEX ); + FIELD_INDEXES.put( EvoUpdate.DUMMY, EvoUpdate.DUMMY_INDEX ); + FIELD_INDEXES.put( EvoUpdate.DUMMY_FULL, EvoUpdate.DUMMY_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "evo_update"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_update"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "evo_update.id"; + public static final int ID_INDEX = 0; + public static final String TIME = "time"; + public static final String TIME_FULL = "evo_update.time"; + public static final int TIME_INDEX = 1; + public static final String DUMMY = "dummy"; + public static final String DUMMY_FULL = "evo_update.dummy"; + public static final int DUMMY_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + TIME, DUMMY, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIME, TABLENAME + "." + DUMMY, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIME, DUMMY, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIME, DUMMY, }; + + private Integer id; + private java.sql.Timestamp time; + private Integer dummy; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoUpdate() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getTime() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.time; + } + + public void setTime( java.sql.Timestamp time ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIME, time ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.time = time; + LAZY_LOADED_OBJECTS.put( TIME, Boolean.TRUE ); + } + + public Integer getDummy() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DUMMY ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.dummy; + } + + public void setDummy( Integer dummy ) + { + try + { + setLockedForRefresh( true ); + preProcess( DUMMY, dummy ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.dummy = dummy; + LAZY_LOADED_OBJECTS.put( DUMMY, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUpdate.ID_INDEX: + value = getId(); + break; + case EvoUpdate.TIME_INDEX: + value = getTime(); + break; + case EvoUpdate.DUMMY_INDEX: + value = getDummy(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUpdate.ID_INDEX: + value = this.id; + break; + case EvoUpdate.TIME_INDEX: + value = this.time; + break; + case EvoUpdate.DUMMY_INDEX: + value = this.dummy; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUpdate.ID_INDEX: + setId( ( Integer ) value ); + break; + case EvoUpdate.TIME_INDEX: + setTime( ( java.sql.Timestamp ) value ); + break; + case EvoUpdate.DUMMY_INDEX: + setDummy( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUpdate.ID_INDEX: + this.id = ( Integer ) value; + break; + case EvoUpdate.TIME_INDEX: + this.time = ( java.sql.Timestamp ) value; + break; + case EvoUpdate.DUMMY_INDEX: + this.dummy = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoUpdate.ID_INDEX: + theClass = Integer.class; + break; + case EvoUpdate.TIME_INDEX: + theClass = java.sql.Timestamp.class; + break; + case EvoUpdate.DUMMY_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoUpdate._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoUpdate.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrPermission.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrPermission.java new file mode 100644 index 00000000..b90e7ce1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrPermission.java @@ -0,0 +1,445 @@ +/* +* EvoUsrPermission.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoUsrPermission extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EvoUsrPermission.ID, EvoUsrPermission.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.ID_FULL, EvoUsrPermission.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.CLASS_, EvoUsrPermission.CLASS__INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.CLASS__FULL, EvoUsrPermission.CLASS__INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.KEY, EvoUsrPermission.KEY_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.KEY_FULL, EvoUsrPermission.KEY_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.DESCRIPTION, EvoUsrPermission.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.DESCRIPTION_FULL, EvoUsrPermission.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.DELETED_DATE, EvoUsrPermission.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( EvoUsrPermission.DELETED_DATE_FULL, EvoUsrPermission.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "evo_usr_permission"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_usr_permission"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "evo_usr_permission.id"; + public static final int ID_INDEX = 0; + public static final String CLASS_ = "class"; + public static final String CLASS__FULL = "evo_usr_permission.class"; + public static final int CLASS__INDEX = 1; + public static final String KEY = "key"; + public static final String KEY_FULL = "evo_usr_permission.key"; + public static final int KEY_INDEX = 2; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "evo_usr_permission.description"; + public static final int DESCRIPTION_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "evo_usr_permission.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + CLASS_, KEY, DESCRIPTION, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CLASS_, TABLENAME + "." + KEY, TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, CLASS_, KEY, DESCRIPTION, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, CLASS_, KEY, DESCRIPTION, DELETED_DATE, }; + + private Integer id; + private String class_; + private String key; + private String description; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoUsrPermission() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEvoUsrRolesPermissions_permission_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EvoUsrRolesPermissionsData.class , getPrimaryKey().getMap().get("id"), "permission_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getClass_() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CLASS_ ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.class_; + } + + public void setClass_( String class_ ) + { + try + { + setLockedForRefresh( true ); + preProcess( CLASS_, class_ ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.class_ = class_; + LAZY_LOADED_OBJECTS.put( CLASS_, Boolean.TRUE ); + } + + public String getKey() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( KEY ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.key; + } + + public void setKey( String key ) + { + try + { + setLockedForRefresh( true ); + preProcess( KEY, key ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.key = key; + LAZY_LOADED_OBJECTS.put( KEY, Boolean.TRUE ); + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrPermission.ID_INDEX: + value = getId(); + break; + case EvoUsrPermission.CLASS__INDEX: + value = getClass_(); + break; + case EvoUsrPermission.KEY_INDEX: + value = getKey(); + break; + case EvoUsrPermission.DESCRIPTION_INDEX: + value = getDescription(); + break; + case EvoUsrPermission.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrPermission.ID_INDEX: + value = this.id; + break; + case EvoUsrPermission.CLASS__INDEX: + value = this.class_; + break; + case EvoUsrPermission.KEY_INDEX: + value = this.key; + break; + case EvoUsrPermission.DESCRIPTION_INDEX: + value = this.description; + break; + case EvoUsrPermission.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrPermission.ID_INDEX: + setId( ( Integer ) value ); + break; + case EvoUsrPermission.CLASS__INDEX: + setClass_( ( String ) value ); + break; + case EvoUsrPermission.KEY_INDEX: + setKey( ( String ) value ); + break; + case EvoUsrPermission.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case EvoUsrPermission.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrPermission.ID_INDEX: + this.id = ( Integer ) value; + break; + case EvoUsrPermission.CLASS__INDEX: + this.class_ = ( String ) value; + break; + case EvoUsrPermission.KEY_INDEX: + this.key = ( String ) value; + break; + case EvoUsrPermission.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case EvoUsrPermission.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoUsrPermission.ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrPermission.CLASS__INDEX: + theClass = String.class; + break; + case EvoUsrPermission.KEY_INDEX: + theClass = String.class; + break; + case EvoUsrPermission.DESCRIPTION_INDEX: + theClass = String.class; + break; + case EvoUsrPermission.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoUsrPermission._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoUsrPermission.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrRole.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrRole.java new file mode 100644 index 00000000..ba2ea89a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrRole.java @@ -0,0 +1,358 @@ +/* +* EvoUsrRole.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoUsrRole extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EvoUsrRole.ID, EvoUsrRole.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRole.ID_FULL, EvoUsrRole.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRole.NAME, EvoUsrRole.NAME_INDEX ); + FIELD_INDEXES.put( EvoUsrRole.NAME_FULL, EvoUsrRole.NAME_INDEX ); + FIELD_INDEXES.put( EvoUsrRole.DELETED_STAMP, EvoUsrRole.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( EvoUsrRole.DELETED_STAMP_FULL, EvoUsrRole.DELETED_STAMP_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "evo_usr_role"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_usr_role"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "evo_usr_role.id"; + public static final int ID_INDEX = 0; + public static final String NAME = "name"; + public static final String NAME_FULL = "evo_usr_role.name"; + public static final int NAME_INDEX = 1; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "evo_usr_role.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + NAME, DELETED_STAMP, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NAME, TABLENAME + "." + DELETED_STAMP, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NAME, DELETED_STAMP, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NAME, DELETED_STAMP, }; + + private Integer id; + private String name; + private java.sql.Timestamp deleted_stamp; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoUsrRole() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEvoUsrRolesPermissions_role_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EvoUsrRolesPermissionsData.class , getPrimaryKey().getMap().get("id"), "role_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEvoUsrUsersRoles_role_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EvoUsrUsersRolesData.class , getPrimaryKey().getMap().get("id"), "role_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getName() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.name; + } + + public void setName( String name ) + { + try + { + setLockedForRefresh( true ); + preProcess( NAME, name ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.name = name; + LAZY_LOADED_OBJECTS.put( NAME, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRole.ID_INDEX: + value = getId(); + break; + case EvoUsrRole.NAME_INDEX: + value = getName(); + break; + case EvoUsrRole.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRole.ID_INDEX: + value = this.id; + break; + case EvoUsrRole.NAME_INDEX: + value = this.name; + break; + case EvoUsrRole.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRole.ID_INDEX: + setId( ( Integer ) value ); + break; + case EvoUsrRole.NAME_INDEX: + setName( ( String ) value ); + break; + case EvoUsrRole.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRole.ID_INDEX: + this.id = ( Integer ) value; + break; + case EvoUsrRole.NAME_INDEX: + this.name = ( String ) value; + break; + case EvoUsrRole.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoUsrRole.ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrRole.NAME_INDEX: + theClass = String.class; + break; + case EvoUsrRole.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoUsrRole._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoUsrRole.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrRolesPermissions.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrRolesPermissions.java new file mode 100644 index 00000000..960ed704 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrRolesPermissions.java @@ -0,0 +1,481 @@ +/* +* EvoUsrRolesPermissions.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoUsrRolesPermissions extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( EvoUsrRolesPermissions.CLASS_IDENTIFIER, EvoUsrRolesPermissions.ROLE_ID, EvoUsrRolesPermissions.TO_ROLE_ID ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.ROLE_ID, EvoUsrRolesPermissions.ROLE_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.ROLE_ID_FULL, EvoUsrRolesPermissions.ROLE_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.TO_ROLE_ID, EvoUsrRolesPermissions.TO_ROLE_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( EvoUsrRolesPermissions.CLASS_IDENTIFIER, EvoUsrRolesPermissions.PERMISSION_ID, EvoUsrRolesPermissions.TO_PERMISSION_ID ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.PERMISSION_ID, EvoUsrRolesPermissions.PERMISSION_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.PERMISSION_ID_FULL, EvoUsrRolesPermissions.PERMISSION_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.TO_PERMISSION_ID, EvoUsrRolesPermissions.TO_PERMISSION_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.ID, EvoUsrRolesPermissions.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.ID_FULL, EvoUsrRolesPermissions.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.REMOVE, EvoUsrRolesPermissions.REMOVE_INDEX ); + FIELD_INDEXES.put( EvoUsrRolesPermissions.REMOVE_FULL, EvoUsrRolesPermissions.REMOVE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrole_idToevo_usr_role = + new com.evolute.entity.ForeignKey( EvoUsrRolesPermissions.class, EvoUsrRolesPermissions.ROLE_ID, db.data.siprp_local.outer.EvoUsrRoleData.class, db.data.siprp_local.outer.EvoUsrRoleData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeypermission_idToevo_usr_permission = + new com.evolute.entity.ForeignKey( EvoUsrRolesPermissions.class, EvoUsrRolesPermissions.PERMISSION_ID, db.data.siprp_local.outer.EvoUsrPermissionData.class, db.data.siprp_local.outer.EvoUsrPermissionData.ID ); + + public static final String TABLENAME = "evo_usr_roles_permissions"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_usr_roles_permissions"; + + public static final int _INVALID__INDEX = -1; + public static final String ROLE_ID = "role_id"; + public static final String ROLE_ID_FULL = "evo_usr_roles_permissions.role_id"; + public static final int ROLE_ID_INDEX = 0; + public static final String TO_ROLE_ID = "to_role_id"; + public static final String TO_ROLE_ID_FULL = "evo_usr_roles_permissions.to_role_id"; + public static final int TO_ROLE_ID_INDEX = 1; + public static final String PERMISSION_ID = "permission_id"; + public static final String PERMISSION_ID_FULL = "evo_usr_roles_permissions.permission_id"; + public static final int PERMISSION_ID_INDEX = 2; + public static final String TO_PERMISSION_ID = "to_permission_id"; + public static final String TO_PERMISSION_ID_FULL = "evo_usr_roles_permissions.to_permission_id"; + public static final int TO_PERMISSION_ID_INDEX = 3; + public static final String ID = "id"; + public static final String ID_FULL = "evo_usr_roles_permissions.id"; + public static final int ID_INDEX = 4; + public static final String REMOVE = "remove"; + public static final String REMOVE_FULL = "evo_usr_roles_permissions.remove"; + public static final int REMOVE_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + ROLE_ID, TO_ROLE_ID, PERMISSION_ID, TO_PERMISSION_ID, REMOVE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ROLE_ID, TABLENAME + "." + TO_ROLE_ID, TABLENAME + "." + PERMISSION_ID, TABLENAME + "." + TO_PERMISSION_ID, TABLENAME + "." + REMOVE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ROLE_ID, PERMISSION_ID, ID, REMOVE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ROLE_ID, PERMISSION_ID, ID, REMOVE, }; + + private Integer role_id; + private db.data.siprp_local.outer.EvoUsrRoleData to_role_id; + private Integer permission_id; + private db.data.siprp_local.outer.EvoUsrPermissionData to_permission_id; + private Integer id; + private Boolean remove; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoUsrRolesPermissions() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false }; + } + + public Integer getRole_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ROLE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.role_id; + } + + public void setRole_id( Integer role_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ROLE_ID, role_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.role_id = role_id; + LAZY_LOADED_OBJECTS.put( ROLE_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoUsrRoleData toRole_id() + { + try + { + prepare( TO_ROLE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_role_id; + } + + public void setToRole_id( db.data.siprp_local.outer.EvoUsrRoleData to_role_id ) + { + try + { + preProcess( TO_ROLE_ID, to_role_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_role_id = to_role_id; + } + + public Integer getPermission_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERMISSION_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.permission_id; + } + + public void setPermission_id( Integer permission_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERMISSION_ID, permission_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.permission_id = permission_id; + LAZY_LOADED_OBJECTS.put( PERMISSION_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoUsrPermissionData toPermission_id() + { + try + { + prepare( TO_PERMISSION_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_permission_id; + } + + public void setToPermission_id( db.data.siprp_local.outer.EvoUsrPermissionData to_permission_id ) + { + try + { + preProcess( TO_PERMISSION_ID, to_permission_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_permission_id = to_permission_id; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Boolean getRemove() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REMOVE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.remove; + } + + public void setRemove( Boolean remove ) + { + try + { + setLockedForRefresh( true ); + preProcess( REMOVE, remove ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.remove = remove; + LAZY_LOADED_OBJECTS.put( REMOVE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRolesPermissions.ROLE_ID_INDEX: + value = getRole_id(); + break; + case EvoUsrRolesPermissions.TO_ROLE_ID_INDEX: + value = toRole_id(); + break; + case EvoUsrRolesPermissions.PERMISSION_ID_INDEX: + value = getPermission_id(); + break; + case EvoUsrRolesPermissions.TO_PERMISSION_ID_INDEX: + value = toPermission_id(); + break; + case EvoUsrRolesPermissions.ID_INDEX: + value = getId(); + break; + case EvoUsrRolesPermissions.REMOVE_INDEX: + value = getRemove(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRolesPermissions.ROLE_ID_INDEX: + value = this.role_id; + break; + case EvoUsrRolesPermissions.TO_ROLE_ID_INDEX: + value = this.to_role_id; + break; + case EvoUsrRolesPermissions.PERMISSION_ID_INDEX: + value = this.permission_id; + break; + case EvoUsrRolesPermissions.TO_PERMISSION_ID_INDEX: + value = this.to_permission_id; + break; + case EvoUsrRolesPermissions.ID_INDEX: + value = this.id; + break; + case EvoUsrRolesPermissions.REMOVE_INDEX: + value = this.remove; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRolesPermissions.ROLE_ID_INDEX: + setRole_id( ( Integer ) value ); + break; + case EvoUsrRolesPermissions.TO_ROLE_ID_INDEX: + setToRole_id( ( db.data.siprp_local.outer.EvoUsrRoleData ) value ); + break; + case EvoUsrRolesPermissions.PERMISSION_ID_INDEX: + setPermission_id( ( Integer ) value ); + break; + case EvoUsrRolesPermissions.TO_PERMISSION_ID_INDEX: + setToPermission_id( ( db.data.siprp_local.outer.EvoUsrPermissionData ) value ); + break; + case EvoUsrRolesPermissions.ID_INDEX: + setId( ( Integer ) value ); + break; + case EvoUsrRolesPermissions.REMOVE_INDEX: + setRemove( ( Boolean ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrRolesPermissions.ROLE_ID_INDEX: + this.role_id = ( Integer ) value; + break; + case EvoUsrRolesPermissions.TO_ROLE_ID_INDEX: + this.to_role_id = ( db.data.siprp_local.outer.EvoUsrRoleData ) value; + break; + case EvoUsrRolesPermissions.PERMISSION_ID_INDEX: + this.permission_id = ( Integer ) value; + break; + case EvoUsrRolesPermissions.TO_PERMISSION_ID_INDEX: + this.to_permission_id = ( db.data.siprp_local.outer.EvoUsrPermissionData ) value; + break; + case EvoUsrRolesPermissions.ID_INDEX: + this.id = ( Integer ) value; + break; + case EvoUsrRolesPermissions.REMOVE_INDEX: + this.remove = ( Boolean ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoUsrRolesPermissions.ROLE_ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrRolesPermissions.TO_ROLE_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoUsrRoleData.class; + break; + case EvoUsrRolesPermissions.PERMISSION_ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrRolesPermissions.TO_PERMISSION_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoUsrPermissionData.class; + break; + case EvoUsrRolesPermissions.ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrRolesPermissions.REMOVE_INDEX: + theClass = Boolean.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoUsrRolesPermissions._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoUsrRolesPermissions.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrUser.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrUser.java new file mode 100644 index 00000000..2c2a44c3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrUser.java @@ -0,0 +1,864 @@ +/* +* EvoUsrUser.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoUsrUser extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( EvoUsrUser.ID, EvoUsrUser.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.ID_FULL, EvoUsrUser.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.LOGIN, EvoUsrUser.LOGIN_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.LOGIN_FULL, EvoUsrUser.LOGIN_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.NAME, EvoUsrUser.NAME_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.NAME_FULL, EvoUsrUser.NAME_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.CREATED_STAMP, EvoUsrUser.CREATED_STAMP_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.CREATED_STAMP_FULL, EvoUsrUser.CREATED_STAMP_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.DELETED_STAMP, EvoUsrUser.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.DELETED_STAMP_FULL, EvoUsrUser.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.PASSWORD, EvoUsrUser.PASSWORD_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.PASSWORD_FULL, EvoUsrUser.PASSWORD_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.PERSON_ID, EvoUsrUser.PERSON_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.PERSON_ID_FULL, EvoUsrUser.PERSON_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.DEVEL, EvoUsrUser.DEVEL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.DEVEL_FULL, EvoUsrUser.DEVEL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.ACTIVE, EvoUsrUser.ACTIVE_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.ACTIVE_FULL, EvoUsrUser.ACTIVE_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.EMAIL, EvoUsrUser.EMAIL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.EMAIL_FULL, EvoUsrUser.EMAIL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.TELEMOVEL, EvoUsrUser.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.TELEMOVEL_FULL, EvoUsrUser.TELEMOVEL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.TELEFONE, EvoUsrUser.TELEFONE_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.TELEFONE_FULL, EvoUsrUser.TELEFONE_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.USER_LEVEL, EvoUsrUser.USER_LEVEL_INDEX ); + FIELD_INDEXES.put( EvoUsrUser.USER_LEVEL_FULL, EvoUsrUser.USER_LEVEL_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "evo_usr_user"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_usr_user"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "evo_usr_user.id"; + public static final int ID_INDEX = 0; + public static final String LOGIN = "login"; + public static final String LOGIN_FULL = "evo_usr_user.login"; + public static final int LOGIN_INDEX = 1; + public static final String NAME = "name"; + public static final String NAME_FULL = "evo_usr_user.name"; + public static final int NAME_INDEX = 2; + public static final String CREATED_STAMP = "created_stamp"; + public static final String CREATED_STAMP_FULL = "evo_usr_user.created_stamp"; + public static final int CREATED_STAMP_INDEX = 3; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "evo_usr_user.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 4; + public static final String PASSWORD = "password"; + public static final String PASSWORD_FULL = "evo_usr_user.password"; + public static final int PASSWORD_INDEX = 5; + public static final String PERSON_ID = "person_id"; + public static final String PERSON_ID_FULL = "evo_usr_user.person_id"; + public static final int PERSON_ID_INDEX = 6; + public static final String DEVEL = "devel"; + public static final String DEVEL_FULL = "evo_usr_user.devel"; + public static final int DEVEL_INDEX = 7; + public static final String ACTIVE = "active"; + public static final String ACTIVE_FULL = "evo_usr_user.active"; + public static final int ACTIVE_INDEX = 8; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "evo_usr_user.email"; + public static final int EMAIL_INDEX = 9; + public static final String TELEMOVEL = "telemovel"; + public static final String TELEMOVEL_FULL = "evo_usr_user.telemovel"; + public static final int TELEMOVEL_INDEX = 10; + public static final String TELEFONE = "telefone"; + public static final String TELEFONE_FULL = "evo_usr_user.telefone"; + public static final int TELEFONE_INDEX = 11; + public static final String USER_LEVEL = "user_level"; + public static final String USER_LEVEL_FULL = "evo_usr_user.user_level"; + public static final int USER_LEVEL_INDEX = 12; + + public static final String FIELD_NAMES[] = new String[]{ + LOGIN, NAME, CREATED_STAMP, DELETED_STAMP, PASSWORD, PERSON_ID, DEVEL, ACTIVE, EMAIL, + TELEMOVEL, TELEFONE, USER_LEVEL, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + LOGIN, TABLENAME + "." + NAME, TABLENAME + "." + CREATED_STAMP, TABLENAME + "." + DELETED_STAMP, TABLENAME + "." + PASSWORD, TABLENAME + "." + PERSON_ID, TABLENAME + "." + DEVEL, TABLENAME + "." + ACTIVE, TABLENAME + "." + EMAIL, + TABLENAME + "." + TELEMOVEL, TABLENAME + "." + TELEFONE, TABLENAME + "." + USER_LEVEL, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, LOGIN, NAME, CREATED_STAMP, DELETED_STAMP, PASSWORD, PERSON_ID, DEVEL, ACTIVE, EMAIL, + TELEMOVEL, TELEFONE, USER_LEVEL, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, LOGIN, NAME, CREATED_STAMP, DELETED_STAMP, PASSWORD, PERSON_ID, DEVEL, ACTIVE, EMAIL, + TELEMOVEL, TELEFONE, USER_LEVEL, }; + + private Integer id; + private String login; + private String name; + private java.sql.Timestamp created_stamp; + private java.sql.Timestamp deleted_stamp; + private String password; + private Integer person_id; + private Boolean devel; + private Boolean active; + private String email; + private Integer telemovel; + private Integer telefone; + private Integer user_level; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoUsrUser() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEvoUsrUsersRoles_user_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EvoUsrUsersRolesData.class , getPrimaryKey().getMap().get("id"), "user_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromFilFile_user_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.FilFileData.class , getPrimaryKey().getMap().get("id"), "user_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getLogin() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOGIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.login; + } + + public void setLogin( String login ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOGIN, login ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.login = login; + LAZY_LOADED_OBJECTS.put( LOGIN, Boolean.TRUE ); + } + + public String getName() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.name; + } + + public void setName( String name ) + { + try + { + setLockedForRefresh( true ); + preProcess( NAME, name ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.name = name; + LAZY_LOADED_OBJECTS.put( NAME, Boolean.TRUE ); + } + + public java.sql.Timestamp getCreated_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CREATED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.created_stamp; + } + + public void setCreated_stamp( java.sql.Timestamp created_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( CREATED_STAMP, created_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.created_stamp = created_stamp; + LAZY_LOADED_OBJECTS.put( CREATED_STAMP, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public String getPassword() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PASSWORD ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.password; + } + + public void setPassword( String password ) + { + try + { + setLockedForRefresh( true ); + preProcess( PASSWORD, password ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.password = password; + LAZY_LOADED_OBJECTS.put( PASSWORD, Boolean.TRUE ); + } + + public Integer getPerson_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERSON_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.person_id; + } + + public void setPerson_id( Integer person_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERSON_ID, person_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.person_id = person_id; + LAZY_LOADED_OBJECTS.put( PERSON_ID, Boolean.TRUE ); + } + + public Boolean getDevel() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DEVEL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.devel; + } + + public void setDevel( Boolean devel ) + { + try + { + setLockedForRefresh( true ); + preProcess( DEVEL, devel ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.devel = devel; + LAZY_LOADED_OBJECTS.put( DEVEL, Boolean.TRUE ); + } + + public Boolean getActive() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.active; + } + + public void setActive( Boolean active ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVE, active ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.active = active; + LAZY_LOADED_OBJECTS.put( ACTIVE, Boolean.TRUE ); + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public Integer getTelemovel() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEMOVEL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telemovel; + } + + public void setTelemovel( Integer telemovel ) + { + try + { + setLockedForRefresh( true ); + preProcess( TELEMOVEL, telemovel ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telemovel = telemovel; + LAZY_LOADED_OBJECTS.put( TELEMOVEL, Boolean.TRUE ); + } + + public Integer getTelefone() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TELEFONE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.telefone; + } + + public void setTelefone( Integer telefone ) + { + try + { + setLockedForRefresh( true ); + preProcess( TELEFONE, telefone ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.telefone = telefone; + LAZY_LOADED_OBJECTS.put( TELEFONE, Boolean.TRUE ); + } + + public Integer getUser_level() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_LEVEL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_level; + } + + public void setUser_level( Integer user_level ) + { + try + { + setLockedForRefresh( true ); + preProcess( USER_LEVEL, user_level ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_level = user_level; + LAZY_LOADED_OBJECTS.put( USER_LEVEL, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUser.ID_INDEX: + value = getId(); + break; + case EvoUsrUser.LOGIN_INDEX: + value = getLogin(); + break; + case EvoUsrUser.NAME_INDEX: + value = getName(); + break; + case EvoUsrUser.CREATED_STAMP_INDEX: + value = getCreated_stamp(); + break; + case EvoUsrUser.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + case EvoUsrUser.PASSWORD_INDEX: + value = getPassword(); + break; + case EvoUsrUser.PERSON_ID_INDEX: + value = getPerson_id(); + break; + case EvoUsrUser.DEVEL_INDEX: + value = getDevel(); + break; + case EvoUsrUser.ACTIVE_INDEX: + value = getActive(); + break; + case EvoUsrUser.EMAIL_INDEX: + value = getEmail(); + break; + case EvoUsrUser.TELEMOVEL_INDEX: + value = getTelemovel(); + break; + case EvoUsrUser.TELEFONE_INDEX: + value = getTelefone(); + break; + case EvoUsrUser.USER_LEVEL_INDEX: + value = getUser_level(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUser.ID_INDEX: + value = this.id; + break; + case EvoUsrUser.LOGIN_INDEX: + value = this.login; + break; + case EvoUsrUser.NAME_INDEX: + value = this.name; + break; + case EvoUsrUser.CREATED_STAMP_INDEX: + value = this.created_stamp; + break; + case EvoUsrUser.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + case EvoUsrUser.PASSWORD_INDEX: + value = this.password; + break; + case EvoUsrUser.PERSON_ID_INDEX: + value = this.person_id; + break; + case EvoUsrUser.DEVEL_INDEX: + value = this.devel; + break; + case EvoUsrUser.ACTIVE_INDEX: + value = this.active; + break; + case EvoUsrUser.EMAIL_INDEX: + value = this.email; + break; + case EvoUsrUser.TELEMOVEL_INDEX: + value = this.telemovel; + break; + case EvoUsrUser.TELEFONE_INDEX: + value = this.telefone; + break; + case EvoUsrUser.USER_LEVEL_INDEX: + value = this.user_level; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUser.ID_INDEX: + setId( ( Integer ) value ); + break; + case EvoUsrUser.LOGIN_INDEX: + setLogin( ( String ) value ); + break; + case EvoUsrUser.NAME_INDEX: + setName( ( String ) value ); + break; + case EvoUsrUser.CREATED_STAMP_INDEX: + setCreated_stamp( ( java.sql.Timestamp ) value ); + break; + case EvoUsrUser.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + case EvoUsrUser.PASSWORD_INDEX: + setPassword( ( String ) value ); + break; + case EvoUsrUser.PERSON_ID_INDEX: + setPerson_id( ( Integer ) value ); + break; + case EvoUsrUser.DEVEL_INDEX: + setDevel( ( Boolean ) value ); + break; + case EvoUsrUser.ACTIVE_INDEX: + setActive( ( Boolean ) value ); + break; + case EvoUsrUser.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + case EvoUsrUser.TELEMOVEL_INDEX: + setTelemovel( ( Integer ) value ); + break; + case EvoUsrUser.TELEFONE_INDEX: + setTelefone( ( Integer ) value ); + break; + case EvoUsrUser.USER_LEVEL_INDEX: + setUser_level( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUser.ID_INDEX: + this.id = ( Integer ) value; + break; + case EvoUsrUser.LOGIN_INDEX: + this.login = ( String ) value; + break; + case EvoUsrUser.NAME_INDEX: + this.name = ( String ) value; + break; + case EvoUsrUser.CREATED_STAMP_INDEX: + this.created_stamp = ( java.sql.Timestamp ) value; + break; + case EvoUsrUser.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + case EvoUsrUser.PASSWORD_INDEX: + this.password = ( String ) value; + break; + case EvoUsrUser.PERSON_ID_INDEX: + this.person_id = ( Integer ) value; + break; + case EvoUsrUser.DEVEL_INDEX: + this.devel = ( Boolean ) value; + break; + case EvoUsrUser.ACTIVE_INDEX: + this.active = ( Boolean ) value; + break; + case EvoUsrUser.EMAIL_INDEX: + this.email = ( String ) value; + break; + case EvoUsrUser.TELEMOVEL_INDEX: + this.telemovel = ( Integer ) value; + break; + case EvoUsrUser.TELEFONE_INDEX: + this.telefone = ( Integer ) value; + break; + case EvoUsrUser.USER_LEVEL_INDEX: + this.user_level = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoUsrUser.ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrUser.LOGIN_INDEX: + theClass = String.class; + break; + case EvoUsrUser.NAME_INDEX: + theClass = String.class; + break; + case EvoUsrUser.CREATED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case EvoUsrUser.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case EvoUsrUser.PASSWORD_INDEX: + theClass = String.class; + break; + case EvoUsrUser.PERSON_ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrUser.DEVEL_INDEX: + theClass = Boolean.class; + break; + case EvoUsrUser.ACTIVE_INDEX: + theClass = Boolean.class; + break; + case EvoUsrUser.EMAIL_INDEX: + theClass = String.class; + break; + case EvoUsrUser.TELEMOVEL_INDEX: + theClass = Integer.class; + break; + case EvoUsrUser.TELEFONE_INDEX: + theClass = Integer.class; + break; + case EvoUsrUser.USER_LEVEL_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoUsrUser._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoUsrUser.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrUsersRoles.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrUsersRoles.java new file mode 100644 index 00000000..e2604c41 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/EvoUsrUsersRoles.java @@ -0,0 +1,431 @@ +/* +* EvoUsrUsersRoles.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class EvoUsrUsersRoles extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( EvoUsrUsersRoles.CLASS_IDENTIFIER, EvoUsrUsersRoles.USER_ID, EvoUsrUsersRoles.TO_USER_ID ); + FIELD_INDEXES.put( EvoUsrUsersRoles.USER_ID, EvoUsrUsersRoles.USER_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUsersRoles.USER_ID_FULL, EvoUsrUsersRoles.USER_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUsersRoles.TO_USER_ID, EvoUsrUsersRoles.TO_USER_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( EvoUsrUsersRoles.CLASS_IDENTIFIER, EvoUsrUsersRoles.ROLE_ID, EvoUsrUsersRoles.TO_ROLE_ID ); + FIELD_INDEXES.put( EvoUsrUsersRoles.ROLE_ID, EvoUsrUsersRoles.ROLE_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUsersRoles.ROLE_ID_FULL, EvoUsrUsersRoles.ROLE_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUsersRoles.TO_ROLE_ID, EvoUsrUsersRoles.TO_ROLE_ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUsersRoles.ID, EvoUsrUsersRoles.ID_INDEX ); + FIELD_INDEXES.put( EvoUsrUsersRoles.ID_FULL, EvoUsrUsersRoles.ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyuser_idToevo_usr_user = + new com.evolute.entity.ForeignKey( EvoUsrUsersRoles.class, EvoUsrUsersRoles.USER_ID, db.data.siprp_local.outer.EvoUsrUserData.class, db.data.siprp_local.outer.EvoUsrUserData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyrole_idToevo_usr_role = + new com.evolute.entity.ForeignKey( EvoUsrUsersRoles.class, EvoUsrUsersRoles.ROLE_ID, db.data.siprp_local.outer.EvoUsrRoleData.class, db.data.siprp_local.outer.EvoUsrRoleData.ID ); + + public static final String TABLENAME = "evo_usr_users_roles"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.evo_usr_users_roles"; + + public static final int _INVALID__INDEX = -1; + public static final String USER_ID = "user_id"; + public static final String USER_ID_FULL = "evo_usr_users_roles.user_id"; + public static final int USER_ID_INDEX = 0; + public static final String TO_USER_ID = "to_user_id"; + public static final String TO_USER_ID_FULL = "evo_usr_users_roles.to_user_id"; + public static final int TO_USER_ID_INDEX = 1; + public static final String ROLE_ID = "role_id"; + public static final String ROLE_ID_FULL = "evo_usr_users_roles.role_id"; + public static final int ROLE_ID_INDEX = 2; + public static final String TO_ROLE_ID = "to_role_id"; + public static final String TO_ROLE_ID_FULL = "evo_usr_users_roles.to_role_id"; + public static final int TO_ROLE_ID_INDEX = 3; + public static final String ID = "id"; + public static final String ID_FULL = "evo_usr_users_roles.id"; + public static final int ID_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + USER_ID, TO_USER_ID, ROLE_ID, TO_ROLE_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + USER_ID, TABLENAME + "." + TO_USER_ID, TABLENAME + "." + ROLE_ID, TABLENAME + "." + TO_ROLE_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + USER_ID, ROLE_ID, ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + USER_ID, ROLE_ID, ID, }; + + private Integer user_id; + private db.data.siprp_local.outer.EvoUsrUserData to_user_id; + private Integer role_id; + private db.data.siprp_local.outer.EvoUsrRoleData to_role_id; + private Integer id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public EvoUsrUsersRoles() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getUser_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_id; + } + + public void setUser_id( Integer user_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( USER_ID, user_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_id = user_id; + LAZY_LOADED_OBJECTS.put( USER_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoUsrUserData toUser_id() + { + try + { + prepare( TO_USER_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_user_id; + } + + public void setToUser_id( db.data.siprp_local.outer.EvoUsrUserData to_user_id ) + { + try + { + preProcess( TO_USER_ID, to_user_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_user_id = to_user_id; + } + + public Integer getRole_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ROLE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.role_id; + } + + public void setRole_id( Integer role_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ROLE_ID, role_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.role_id = role_id; + LAZY_LOADED_OBJECTS.put( ROLE_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoUsrRoleData toRole_id() + { + try + { + prepare( TO_ROLE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_role_id; + } + + public void setToRole_id( db.data.siprp_local.outer.EvoUsrRoleData to_role_id ) + { + try + { + preProcess( TO_ROLE_ID, to_role_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_role_id = to_role_id; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUsersRoles.USER_ID_INDEX: + value = getUser_id(); + break; + case EvoUsrUsersRoles.TO_USER_ID_INDEX: + value = toUser_id(); + break; + case EvoUsrUsersRoles.ROLE_ID_INDEX: + value = getRole_id(); + break; + case EvoUsrUsersRoles.TO_ROLE_ID_INDEX: + value = toRole_id(); + break; + case EvoUsrUsersRoles.ID_INDEX: + value = getId(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUsersRoles.USER_ID_INDEX: + value = this.user_id; + break; + case EvoUsrUsersRoles.TO_USER_ID_INDEX: + value = this.to_user_id; + break; + case EvoUsrUsersRoles.ROLE_ID_INDEX: + value = this.role_id; + break; + case EvoUsrUsersRoles.TO_ROLE_ID_INDEX: + value = this.to_role_id; + break; + case EvoUsrUsersRoles.ID_INDEX: + value = this.id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUsersRoles.USER_ID_INDEX: + setUser_id( ( Integer ) value ); + break; + case EvoUsrUsersRoles.TO_USER_ID_INDEX: + setToUser_id( ( db.data.siprp_local.outer.EvoUsrUserData ) value ); + break; + case EvoUsrUsersRoles.ROLE_ID_INDEX: + setRole_id( ( Integer ) value ); + break; + case EvoUsrUsersRoles.TO_ROLE_ID_INDEX: + setToRole_id( ( db.data.siprp_local.outer.EvoUsrRoleData ) value ); + break; + case EvoUsrUsersRoles.ID_INDEX: + setId( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case EvoUsrUsersRoles.USER_ID_INDEX: + this.user_id = ( Integer ) value; + break; + case EvoUsrUsersRoles.TO_USER_ID_INDEX: + this.to_user_id = ( db.data.siprp_local.outer.EvoUsrUserData ) value; + break; + case EvoUsrUsersRoles.ROLE_ID_INDEX: + this.role_id = ( Integer ) value; + break; + case EvoUsrUsersRoles.TO_ROLE_ID_INDEX: + this.to_role_id = ( db.data.siprp_local.outer.EvoUsrRoleData ) value; + break; + case EvoUsrUsersRoles.ID_INDEX: + this.id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case EvoUsrUsersRoles.USER_ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrUsersRoles.TO_USER_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoUsrUserData.class; + break; + case EvoUsrUsersRoles.ROLE_ID_INDEX: + theClass = Integer.class; + break; + case EvoUsrUsersRoles.TO_ROLE_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoUsrRoleData.class; + break; + case EvoUsrUsersRoles.ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : EvoUsrUsersRoles._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, EvoUsrUsersRoles.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Exames.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Exames.java new file mode 100644 index 00000000..6d0bcf23 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Exames.java @@ -0,0 +1,1235 @@ +/* +* Exames.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Exames extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Exames.ID, Exames.ID_INDEX ); + FIELD_INDEXES.put( Exames.ID_FULL, Exames.ID_INDEX ); + FIELD_INDEXES.put( Exames.DATA, Exames.DATA_INDEX ); + FIELD_INDEXES.put( Exames.DATA_FULL, Exames.DATA_INDEX ); + FIELD_INDEXES.put( Exames.TIPO, Exames.TIPO_INDEX ); + FIELD_INDEXES.put( Exames.TIPO_FULL, Exames.TIPO_INDEX ); + FIELD_INDEXES.put( Exames.OCASIONAL, Exames.OCASIONAL_INDEX ); + FIELD_INDEXES.put( Exames.OCASIONAL_FULL, Exames.OCASIONAL_INDEX ); + FIELD_INDEXES.put( Exames.OUTRO_TIPO, Exames.OUTRO_TIPO_INDEX ); + FIELD_INDEXES.put( Exames.OUTRO_TIPO_FULL, Exames.OUTRO_TIPO_INDEX ); + FIELD_INDEXES.put( Exames.RESULTADO, Exames.RESULTADO_INDEX ); + FIELD_INDEXES.put( Exames.RESULTADO_FULL, Exames.RESULTADO_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_1, Exames.OUTRA_FUNCAO_1_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_1_FULL, Exames.OUTRA_FUNCAO_1_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_2, Exames.OUTRA_FUNCAO_2_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_2_FULL, Exames.OUTRA_FUNCAO_2_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_3, Exames.OUTRA_FUNCAO_3_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_3_FULL, Exames.OUTRA_FUNCAO_3_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_4, Exames.OUTRA_FUNCAO_4_INDEX ); + FIELD_INDEXES.put( Exames.OUTRA_FUNCAO_4_FULL, Exames.OUTRA_FUNCAO_4_INDEX ); + FIELD_INDEXES.put( Exames.PROXIMO_EXAME, Exames.PROXIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Exames.PROXIMO_EXAME_FULL, Exames.PROXIMO_EXAME_INDEX ); + FIELD_INDEXES.put( Exames.OUTRAS_RECOMENDACOES, Exames.OUTRAS_RECOMENDACOES_INDEX ); + FIELD_INDEXES.put( Exames.OUTRAS_RECOMENDACOES_FULL, Exames.OUTRAS_RECOMENDACOES_INDEX ); + FIELD_INDEXES.put( Exames.INACTIVO, Exames.INACTIVO_INDEX ); + FIELD_INDEXES.put( Exames.INACTIVO_FULL, Exames.INACTIVO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Exames.CLASS_IDENTIFIER, Exames.TRABALHADOR_ID, Exames.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( Exames.TRABALHADOR_ID, Exames.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Exames.TRABALHADOR_ID_FULL, Exames.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Exames.TO_TRABALHADOR_ID, Exames.TO_TRABALHADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Exames.CLASS_IDENTIFIER, Exames.MEDICO_ID, Exames.TO_MEDICO_ID ); + FIELD_INDEXES.put( Exames.MEDICO_ID, Exames.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Exames.MEDICO_ID_FULL, Exames.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Exames.TO_MEDICO_ID, Exames.TO_MEDICO_ID_INDEX ); + FIELD_INDEXES.put( Exames.PDF, Exames.PDF_INDEX ); + FIELD_INDEXES.put( Exames.PDF_FULL, Exames.PDF_INDEX ); + FIELD_INDEXES.put( Exames.FO, Exames.FO_INDEX ); + FIELD_INDEXES.put( Exames.FO_FULL, Exames.FO_INDEX ); + FIELD_INDEXES.put( Exames.IMPRESSO_STAMP, Exames.IMPRESSO_STAMP_INDEX ); + FIELD_INDEXES.put( Exames.IMPRESSO_STAMP_FULL, Exames.IMPRESSO_STAMP_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( Exames.class, Exames.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymedico_idTomedicos = + new com.evolute.entity.ForeignKey( Exames.class, Exames.MEDICO_ID, db.data.siprp_local.outer.MedicosData.class, db.data.siprp_local.outer.MedicosData.ID ); + + public static final String TABLENAME = "exames"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.exames"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "exames.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "exames.data"; + public static final int DATA_INDEX = 1; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "exames.tipo"; + public static final int TIPO_INDEX = 2; + public static final String OCASIONAL = "ocasional"; + public static final String OCASIONAL_FULL = "exames.ocasional"; + public static final int OCASIONAL_INDEX = 3; + public static final String OUTRO_TIPO = "outro_tipo"; + public static final String OUTRO_TIPO_FULL = "exames.outro_tipo"; + public static final int OUTRO_TIPO_INDEX = 4; + public static final String RESULTADO = "resultado"; + public static final String RESULTADO_FULL = "exames.resultado"; + public static final int RESULTADO_INDEX = 5; + public static final String OUTRA_FUNCAO_1 = "outra_funcao_1"; + public static final String OUTRA_FUNCAO_1_FULL = "exames.outra_funcao_1"; + public static final int OUTRA_FUNCAO_1_INDEX = 6; + public static final String OUTRA_FUNCAO_2 = "outra_funcao_2"; + public static final String OUTRA_FUNCAO_2_FULL = "exames.outra_funcao_2"; + public static final int OUTRA_FUNCAO_2_INDEX = 7; + public static final String OUTRA_FUNCAO_3 = "outra_funcao_3"; + public static final String OUTRA_FUNCAO_3_FULL = "exames.outra_funcao_3"; + public static final int OUTRA_FUNCAO_3_INDEX = 8; + public static final String OUTRA_FUNCAO_4 = "outra_funcao_4"; + public static final String OUTRA_FUNCAO_4_FULL = "exames.outra_funcao_4"; + public static final int OUTRA_FUNCAO_4_INDEX = 9; + public static final String PROXIMO_EXAME = "proximo_exame"; + public static final String PROXIMO_EXAME_FULL = "exames.proximo_exame"; + public static final int PROXIMO_EXAME_INDEX = 10; + public static final String OUTRAS_RECOMENDACOES = "outras_recomendacoes"; + public static final String OUTRAS_RECOMENDACOES_FULL = "exames.outras_recomendacoes"; + public static final int OUTRAS_RECOMENDACOES_INDEX = 11; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "exames.inactivo"; + public static final int INACTIVO_INDEX = 12; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "exames.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 13; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "exames.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 14; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "exames.medico_id"; + public static final int MEDICO_ID_INDEX = 15; + public static final String TO_MEDICO_ID = "to_medico_id"; + public static final String TO_MEDICO_ID_FULL = "exames.to_medico_id"; + public static final int TO_MEDICO_ID_INDEX = 16; + public static final String PDF = "pdf"; + public static final String PDF_FULL = "exames.pdf"; + public static final int PDF_INDEX = 17; + public static final String FO = "fo"; + public static final String FO_FULL = "exames.fo"; + public static final int FO_INDEX = 18; + public static final String IMPRESSO_STAMP = "impresso_stamp"; + public static final String IMPRESSO_STAMP_FULL = "exames.impresso_stamp"; + public static final int IMPRESSO_STAMP_INDEX = 19; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2, + OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES, INACTIVO, + TRABALHADOR_ID, TO_TRABALHADOR_ID, MEDICO_ID, TO_MEDICO_ID, PDF, FO, + IMPRESSO_STAMP, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + TIPO, TABLENAME + "." + OCASIONAL, TABLENAME + "." + OUTRO_TIPO, TABLENAME + "." + RESULTADO, TABLENAME + "." + OUTRA_FUNCAO_1, TABLENAME + "." + OUTRA_FUNCAO_2, + TABLENAME + "." + OUTRA_FUNCAO_3, TABLENAME + "." + OUTRA_FUNCAO_4, TABLENAME + "." + PROXIMO_EXAME, TABLENAME + "." + OUTRAS_RECOMENDACOES, TABLENAME + "." + INACTIVO, + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + MEDICO_ID, TABLENAME + "." + TO_MEDICO_ID, TABLENAME + "." + PDF, TABLENAME + "." + FO, + TABLENAME + "." + IMPRESSO_STAMP, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2, + OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES, INACTIVO, + TRABALHADOR_ID, MEDICO_ID, PDF, FO, IMPRESSO_STAMP, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2, + OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES, INACTIVO, + TRABALHADOR_ID, MEDICO_ID, IMPRESSO_STAMP, }; + + private Integer id; + private java.util.Date data; + private Integer tipo; + private Integer ocasional; + private String outro_tipo; + private Integer resultado; + private String outra_funcao_1; + private String outra_funcao_2; + private String outra_funcao_3; + private String outra_funcao_4; + private java.util.Date proximo_exame; + private String outras_recomendacoes; + private String inactivo; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private Integer medico_id; + private db.data.siprp_local.outer.MedicosData to_medico_id; + private byte[] pdf; + private byte[] fo; + private java.sql.Timestamp impresso_stamp; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Exames() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromLembretes_exame_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "exame_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresFichasAptidao_exame_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresFichasAptidaoData.class , getPrimaryKey().getMap().get("id"), "exame_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public Integer getOcasional() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OCASIONAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ocasional; + } + + public void setOcasional( Integer ocasional ) + { + try + { + setLockedForRefresh( true ); + preProcess( OCASIONAL, ocasional ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ocasional = ocasional; + LAZY_LOADED_OBJECTS.put( OCASIONAL, Boolean.TRUE ); + } + + public String getOutro_tipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRO_TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outro_tipo; + } + + public void setOutro_tipo( String outro_tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( OUTRO_TIPO, outro_tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outro_tipo = outro_tipo; + LAZY_LOADED_OBJECTS.put( OUTRO_TIPO, Boolean.TRUE ); + } + + public Integer getResultado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RESULTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.resultado; + } + + public void setResultado( Integer resultado ) + { + try + { + setLockedForRefresh( true ); + preProcess( RESULTADO, resultado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.resultado = resultado; + LAZY_LOADED_OBJECTS.put( RESULTADO, Boolean.TRUE ); + } + + public String getOutra_funcao_1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_1; + } + + public void setOutra_funcao_1( String outra_funcao_1 ) + { + try + { + setLockedForRefresh( true ); + preProcess( OUTRA_FUNCAO_1, outra_funcao_1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_1 = outra_funcao_1; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_1, Boolean.TRUE ); + } + + public String getOutra_funcao_2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_2; + } + + public void setOutra_funcao_2( String outra_funcao_2 ) + { + try + { + setLockedForRefresh( true ); + preProcess( OUTRA_FUNCAO_2, outra_funcao_2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_2 = outra_funcao_2; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_2, Boolean.TRUE ); + } + + public String getOutra_funcao_3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_3; + } + + public void setOutra_funcao_3( String outra_funcao_3 ) + { + try + { + setLockedForRefresh( true ); + preProcess( OUTRA_FUNCAO_3, outra_funcao_3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_3 = outra_funcao_3; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_3, Boolean.TRUE ); + } + + public String getOutra_funcao_4() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRA_FUNCAO_4 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outra_funcao_4; + } + + public void setOutra_funcao_4( String outra_funcao_4 ) + { + try + { + setLockedForRefresh( true ); + preProcess( OUTRA_FUNCAO_4, outra_funcao_4 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outra_funcao_4 = outra_funcao_4; + LAZY_LOADED_OBJECTS.put( OUTRA_FUNCAO_4, Boolean.TRUE ); + } + + public java.util.Date getProximo_exame() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROXIMO_EXAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.proximo_exame; + } + + public void setProximo_exame( java.util.Date proximo_exame ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROXIMO_EXAME, proximo_exame ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.proximo_exame = proximo_exame; + LAZY_LOADED_OBJECTS.put( PROXIMO_EXAME, Boolean.TRUE ); + } + + public String getOutras_recomendacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OUTRAS_RECOMENDACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.outras_recomendacoes; + } + + public void setOutras_recomendacoes( String outras_recomendacoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( OUTRAS_RECOMENDACOES, outras_recomendacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.outras_recomendacoes = outras_recomendacoes; + LAZY_LOADED_OBJECTS.put( OUTRAS_RECOMENDACOES, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MedicosData toMedico_id() + { + try + { + prepare( TO_MEDICO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medico_id; + } + + public void setToMedico_id( db.data.siprp_local.outer.MedicosData to_medico_id ) + { + try + { + preProcess( TO_MEDICO_ID, to_medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medico_id = to_medico_id; + } + + public byte[] getPdf() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PDF ); + Boolean isLazyLoaded = isPropertyLoaded( PDF ); + if ( ! isLazyLoaded ) + { + this.pdf = ( byte[] ) getProvider().loadFieldFromDatabase( PDF, this ); + LAZY_LOADED_OBJECTS.put( PDF, Boolean.TRUE ); + } + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.pdf; + } + + public void setPdf( byte[] pdf ) + { + try + { + setLockedForRefresh( true ); + preProcess( PDF, pdf ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.pdf = pdf; + LAZY_LOADED_OBJECTS.put( PDF, Boolean.TRUE ); + } + + public byte[] getFo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FO ); + Boolean isLazyLoaded = isPropertyLoaded( FO ); + if ( ! isLazyLoaded ) + { + this.fo = ( byte[] ) getProvider().loadFieldFromDatabase( FO, this ); + LAZY_LOADED_OBJECTS.put( FO, Boolean.TRUE ); + } + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.fo; + } + + public void setFo( byte[] fo ) + { + try + { + setLockedForRefresh( true ); + preProcess( FO, fo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.fo = fo; + LAZY_LOADED_OBJECTS.put( FO, Boolean.TRUE ); + } + + public java.sql.Timestamp getImpresso_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMPRESSO_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.impresso_stamp; + } + + public void setImpresso_stamp( java.sql.Timestamp impresso_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( IMPRESSO_STAMP, impresso_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.impresso_stamp = impresso_stamp; + LAZY_LOADED_OBJECTS.put( IMPRESSO_STAMP, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + value = getId(); + break; + case Exames.DATA_INDEX: + value = getData(); + break; + case Exames.TIPO_INDEX: + value = getTipo(); + break; + case Exames.OCASIONAL_INDEX: + value = getOcasional(); + break; + case Exames.OUTRO_TIPO_INDEX: + value = getOutro_tipo(); + break; + case Exames.RESULTADO_INDEX: + value = getResultado(); + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + value = getOutra_funcao_1(); + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + value = getOutra_funcao_2(); + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + value = getOutra_funcao_3(); + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + value = getOutra_funcao_4(); + break; + case Exames.PROXIMO_EXAME_INDEX: + value = getProximo_exame(); + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + value = getOutras_recomendacoes(); + break; + case Exames.INACTIVO_INDEX: + value = getInactivo(); + break; + case Exames.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case Exames.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + case Exames.TO_MEDICO_ID_INDEX: + value = toMedico_id(); + break; + case Exames.PDF_INDEX: + value = getPdf(); + break; + case Exames.FO_INDEX: + value = getFo(); + break; + case Exames.IMPRESSO_STAMP_INDEX: + value = getImpresso_stamp(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + value = this.id; + break; + case Exames.DATA_INDEX: + value = this.data; + break; + case Exames.TIPO_INDEX: + value = this.tipo; + break; + case Exames.OCASIONAL_INDEX: + value = this.ocasional; + break; + case Exames.OUTRO_TIPO_INDEX: + value = this.outro_tipo; + break; + case Exames.RESULTADO_INDEX: + value = this.resultado; + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + value = this.outra_funcao_1; + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + value = this.outra_funcao_2; + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + value = this.outra_funcao_3; + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + value = this.outra_funcao_4; + break; + case Exames.PROXIMO_EXAME_INDEX: + value = this.proximo_exame; + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + value = this.outras_recomendacoes; + break; + case Exames.INACTIVO_INDEX: + value = this.inactivo; + break; + case Exames.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case Exames.MEDICO_ID_INDEX: + value = this.medico_id; + break; + case Exames.TO_MEDICO_ID_INDEX: + value = this.to_medico_id; + break; + case Exames.PDF_INDEX: + value = this.pdf; + break; + case Exames.FO_INDEX: + value = this.fo; + break; + case Exames.IMPRESSO_STAMP_INDEX: + value = this.impresso_stamp; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + setId( ( Integer ) value ); + break; + case Exames.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case Exames.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case Exames.OCASIONAL_INDEX: + setOcasional( ( Integer ) value ); + break; + case Exames.OUTRO_TIPO_INDEX: + setOutro_tipo( ( String ) value ); + break; + case Exames.RESULTADO_INDEX: + setResultado( ( Integer ) value ); + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + setOutra_funcao_1( ( String ) value ); + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + setOutra_funcao_2( ( String ) value ); + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + setOutra_funcao_3( ( String ) value ); + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + setOutra_funcao_4( ( String ) value ); + break; + case Exames.PROXIMO_EXAME_INDEX: + setProximo_exame( ( java.util.Date ) value ); + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + setOutras_recomendacoes( ( String ) value ); + break; + case Exames.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + case Exames.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case Exames.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + case Exames.TO_MEDICO_ID_INDEX: + setToMedico_id( ( db.data.siprp_local.outer.MedicosData ) value ); + break; + case Exames.PDF_INDEX: + setPdf( ( byte[] ) value ); + break; + case Exames.FO_INDEX: + setFo( ( byte[] ) value ); + break; + case Exames.IMPRESSO_STAMP_INDEX: + setImpresso_stamp( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Exames.ID_INDEX: + this.id = ( Integer ) value; + break; + case Exames.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case Exames.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case Exames.OCASIONAL_INDEX: + this.ocasional = ( Integer ) value; + break; + case Exames.OUTRO_TIPO_INDEX: + this.outro_tipo = ( String ) value; + break; + case Exames.RESULTADO_INDEX: + this.resultado = ( Integer ) value; + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + this.outra_funcao_1 = ( String ) value; + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + this.outra_funcao_2 = ( String ) value; + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + this.outra_funcao_3 = ( String ) value; + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + this.outra_funcao_4 = ( String ) value; + break; + case Exames.PROXIMO_EXAME_INDEX: + this.proximo_exame = ( java.util.Date ) value; + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + this.outras_recomendacoes = ( String ) value; + break; + case Exames.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + case Exames.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case Exames.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + case Exames.TO_MEDICO_ID_INDEX: + this.to_medico_id = ( db.data.siprp_local.outer.MedicosData ) value; + break; + case Exames.PDF_INDEX: + this.pdf = ( byte[] ) value; + break; + case Exames.FO_INDEX: + this.fo = ( byte[] ) value; + break; + case Exames.IMPRESSO_STAMP_INDEX: + this.impresso_stamp = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Exames.ID_INDEX: + theClass = Integer.class; + break; + case Exames.DATA_INDEX: + theClass = java.util.Date.class; + break; + case Exames.TIPO_INDEX: + theClass = Integer.class; + break; + case Exames.OCASIONAL_INDEX: + theClass = Integer.class; + break; + case Exames.OUTRO_TIPO_INDEX: + theClass = String.class; + break; + case Exames.RESULTADO_INDEX: + theClass = Integer.class; + break; + case Exames.OUTRA_FUNCAO_1_INDEX: + theClass = String.class; + break; + case Exames.OUTRA_FUNCAO_2_INDEX: + theClass = String.class; + break; + case Exames.OUTRA_FUNCAO_3_INDEX: + theClass = String.class; + break; + case Exames.OUTRA_FUNCAO_4_INDEX: + theClass = String.class; + break; + case Exames.PROXIMO_EXAME_INDEX: + theClass = java.util.Date.class; + break; + case Exames.OUTRAS_RECOMENDACOES_INDEX: + theClass = String.class; + break; + case Exames.INACTIVO_INDEX: + theClass = String.class; + break; + case Exames.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Exames.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case Exames.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + case Exames.TO_MEDICO_ID_INDEX: + theClass = db.data.siprp_local.outer.MedicosData.class; + break; + case Exames.PDF_INDEX: + theClass = byte[].class; + break; + case Exames.FO_INDEX: + theClass = byte[].class; + break; + case Exames.IMPRESSO_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Exames._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Exames.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + LAZY_LOADED_OBJECTS.put( PDF, Boolean.FALSE ); + LAZY_LOADED_OBJECTS.put( FO, Boolean.FALSE ); + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/ExamesPerfis.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/ExamesPerfis.java new file mode 100644 index 00000000..678703c9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/ExamesPerfis.java @@ -0,0 +1,431 @@ +/* +* ExamesPerfis.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class ExamesPerfis extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( ExamesPerfis.ID, ExamesPerfis.ID_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.ID_FULL, ExamesPerfis.ID_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.PERFIL, ExamesPerfis.PERFIL_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.PERFIL_FULL, ExamesPerfis.PERFIL_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( ExamesPerfis.CLASS_IDENTIFIER, ExamesPerfis.TIPO, ExamesPerfis.TO_TIPO ); + FIELD_INDEXES.put( ExamesPerfis.TIPO, ExamesPerfis.TIPO_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.TIPO_FULL, ExamesPerfis.TIPO_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.TO_TIPO, ExamesPerfis.TO_TIPO_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.MULTIPLICADOR, ExamesPerfis.MULTIPLICADOR_INDEX ); + FIELD_INDEXES.put( ExamesPerfis.MULTIPLICADOR_FULL, ExamesPerfis.MULTIPLICADOR_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytipoTotipos_exames_comp = + new com.evolute.entity.ForeignKey( ExamesPerfis.class, ExamesPerfis.TIPO, db.data.siprp_local.outer.TiposExamesCompData.class, db.data.siprp_local.outer.TiposExamesCompData.ID ); + + public static final String TABLENAME = "exames_perfis"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.exames_perfis"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "exames_perfis.id"; + public static final int ID_INDEX = 0; + public static final String PERFIL = "perfil"; + public static final String PERFIL_FULL = "exames_perfis.perfil"; + public static final int PERFIL_INDEX = 1; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "exames_perfis.tipo"; + public static final int TIPO_INDEX = 2; + public static final String TO_TIPO = "to_tipo"; + public static final String TO_TIPO_FULL = "exames_perfis.to_tipo"; + public static final int TO_TIPO_INDEX = 3; + public static final String MULTIPLICADOR = "multiplicador"; + public static final String MULTIPLICADOR_FULL = "exames_perfis.multiplicador"; + public static final int MULTIPLICADOR_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + PERFIL, TIPO, TO_TIPO, MULTIPLICADOR, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PERFIL, TABLENAME + "." + TIPO, TABLENAME + "." + TO_TIPO, TABLENAME + "." + MULTIPLICADOR, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PERFIL, TIPO, MULTIPLICADOR, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PERFIL, TIPO, MULTIPLICADOR, }; + + private Integer id; + private Integer perfil; + private Integer tipo; + private db.data.siprp_local.outer.TiposExamesCompData to_tipo; + private Integer multiplicador; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public ExamesPerfis() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getPerfil() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil; + } + + public void setPerfil( Integer perfil ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERFIL, perfil ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil = perfil; + LAZY_LOADED_OBJECTS.put( PERFIL, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TiposExamesCompData toTipo() + { + try + { + prepare( TO_TIPO ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tipo; + } + + public void setToTipo( db.data.siprp_local.outer.TiposExamesCompData to_tipo ) + { + try + { + preProcess( TO_TIPO, to_tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tipo = to_tipo; + } + + public Integer getMultiplicador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MULTIPLICADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.multiplicador; + } + + public void setMultiplicador( Integer multiplicador ) + { + try + { + setLockedForRefresh( true ); + preProcess( MULTIPLICADOR, multiplicador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.multiplicador = multiplicador; + LAZY_LOADED_OBJECTS.put( MULTIPLICADOR, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + value = getId(); + break; + case ExamesPerfis.PERFIL_INDEX: + value = getPerfil(); + break; + case ExamesPerfis.TIPO_INDEX: + value = getTipo(); + break; + case ExamesPerfis.TO_TIPO_INDEX: + value = toTipo(); + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + value = getMultiplicador(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + value = this.id; + break; + case ExamesPerfis.PERFIL_INDEX: + value = this.perfil; + break; + case ExamesPerfis.TIPO_INDEX: + value = this.tipo; + break; + case ExamesPerfis.TO_TIPO_INDEX: + value = this.to_tipo; + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + value = this.multiplicador; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + setId( ( Integer ) value ); + break; + case ExamesPerfis.PERFIL_INDEX: + setPerfil( ( Integer ) value ); + break; + case ExamesPerfis.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case ExamesPerfis.TO_TIPO_INDEX: + setToTipo( ( db.data.siprp_local.outer.TiposExamesCompData ) value ); + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + setMultiplicador( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPerfis.ID_INDEX: + this.id = ( Integer ) value; + break; + case ExamesPerfis.PERFIL_INDEX: + this.perfil = ( Integer ) value; + break; + case ExamesPerfis.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case ExamesPerfis.TO_TIPO_INDEX: + this.to_tipo = ( db.data.siprp_local.outer.TiposExamesCompData ) value; + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + this.multiplicador = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case ExamesPerfis.ID_INDEX: + theClass = Integer.class; + break; + case ExamesPerfis.PERFIL_INDEX: + theClass = Integer.class; + break; + case ExamesPerfis.TIPO_INDEX: + theClass = Integer.class; + break; + case ExamesPerfis.TO_TIPO_INDEX: + theClass = db.data.siprp_local.outer.TiposExamesCompData.class; + break; + case ExamesPerfis.MULTIPLICADOR_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : ExamesPerfis._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, ExamesPerfis.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/ExamesPortaria.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/ExamesPortaria.java new file mode 100644 index 00000000..9fdfb973 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/ExamesPortaria.java @@ -0,0 +1,330 @@ +/* +* ExamesPortaria.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class ExamesPortaria extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( ExamesPortaria.ID, ExamesPortaria.ID_INDEX ); + FIELD_INDEXES.put( ExamesPortaria.ID_FULL, ExamesPortaria.ID_INDEX ); + FIELD_INDEXES.put( ExamesPortaria.PORTARIA, ExamesPortaria.PORTARIA_INDEX ); + FIELD_INDEXES.put( ExamesPortaria.PORTARIA_FULL, ExamesPortaria.PORTARIA_INDEX ); + FIELD_INDEXES.put( ExamesPortaria.DATA_ENTRADA, ExamesPortaria.DATA_ENTRADA_INDEX ); + FIELD_INDEXES.put( ExamesPortaria.DATA_ENTRADA_FULL, ExamesPortaria.DATA_ENTRADA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "exames_portaria"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.exames_portaria"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "exames_portaria.id"; + public static final int ID_INDEX = 0; + public static final String PORTARIA = "portaria"; + public static final String PORTARIA_FULL = "exames_portaria.portaria"; + public static final int PORTARIA_INDEX = 1; + public static final String DATA_ENTRADA = "data_entrada"; + public static final String DATA_ENTRADA_FULL = "exames_portaria.data_entrada"; + public static final int DATA_ENTRADA_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + PORTARIA, DATA_ENTRADA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PORTARIA, TABLENAME + "." + DATA_ENTRADA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PORTARIA, DATA_ENTRADA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PORTARIA, DATA_ENTRADA, }; + + private Integer id; + private String portaria; + private java.sql.Timestamp data_entrada; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public ExamesPortaria() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getPortaria() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PORTARIA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.portaria; + } + + public void setPortaria( String portaria ) + { + try + { + setLockedForRefresh( true ); + preProcess( PORTARIA, portaria ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.portaria = portaria; + LAZY_LOADED_OBJECTS.put( PORTARIA, Boolean.TRUE ); + } + + public java.sql.Timestamp getData_entrada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ENTRADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_entrada; + } + + public void setData_entrada( java.sql.Timestamp data_entrada ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ENTRADA, data_entrada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_entrada = data_entrada; + LAZY_LOADED_OBJECTS.put( DATA_ENTRADA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPortaria.ID_INDEX: + value = getId(); + break; + case ExamesPortaria.PORTARIA_INDEX: + value = getPortaria(); + break; + case ExamesPortaria.DATA_ENTRADA_INDEX: + value = getData_entrada(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPortaria.ID_INDEX: + value = this.id; + break; + case ExamesPortaria.PORTARIA_INDEX: + value = this.portaria; + break; + case ExamesPortaria.DATA_ENTRADA_INDEX: + value = this.data_entrada; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPortaria.ID_INDEX: + setId( ( Integer ) value ); + break; + case ExamesPortaria.PORTARIA_INDEX: + setPortaria( ( String ) value ); + break; + case ExamesPortaria.DATA_ENTRADA_INDEX: + setData_entrada( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case ExamesPortaria.ID_INDEX: + this.id = ( Integer ) value; + break; + case ExamesPortaria.PORTARIA_INDEX: + this.portaria = ( String ) value; + break; + case ExamesPortaria.DATA_ENTRADA_INDEX: + this.data_entrada = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case ExamesPortaria.ID_INDEX: + theClass = Integer.class; + break; + case ExamesPortaria.PORTARIA_INDEX: + theClass = String.class; + break; + case ExamesPortaria.DATA_ENTRADA_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : ExamesPortaria._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, ExamesPortaria.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/FilFile.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/FilFile.java new file mode 100644 index 00000000..e2e3d7b3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/FilFile.java @@ -0,0 +1,654 @@ +/* +* FilFile.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class FilFile extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( FilFile.ID, FilFile.ID_INDEX ); + FIELD_INDEXES.put( FilFile.ID_FULL, FilFile.ID_INDEX ); + FIELD_INDEXES.put( FilFile.DELETED_STAMP, FilFile.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( FilFile.DELETED_STAMP_FULL, FilFile.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( FilFile.NAME, FilFile.NAME_INDEX ); + FIELD_INDEXES.put( FilFile.NAME_FULL, FilFile.NAME_INDEX ); + FIELD_INDEXES.put( FilFile.MIME_TYPE, FilFile.MIME_TYPE_INDEX ); + FIELD_INDEXES.put( FilFile.MIME_TYPE_FULL, FilFile.MIME_TYPE_INDEX ); + FIELD_INDEXES.put( FilFile.INSERTED_STAMP, FilFile.INSERTED_STAMP_INDEX ); + FIELD_INDEXES.put( FilFile.INSERTED_STAMP_FULL, FilFile.INSERTED_STAMP_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( FilFile.CLASS_IDENTIFIER, FilFile.USER_ID, FilFile.TO_USER_ID ); + FIELD_INDEXES.put( FilFile.USER_ID, FilFile.USER_ID_INDEX ); + FIELD_INDEXES.put( FilFile.USER_ID_FULL, FilFile.USER_ID_INDEX ); + FIELD_INDEXES.put( FilFile.TO_USER_ID, FilFile.TO_USER_ID_INDEX ); + FIELD_INDEXES.put( FilFile.FILE_DATA, FilFile.FILE_DATA_INDEX ); + FIELD_INDEXES.put( FilFile.FILE_DATA_FULL, FilFile.FILE_DATA_INDEX ); + FIELD_INDEXES.put( FilFile.DETAILS, FilFile.DETAILS_INDEX ); + FIELD_INDEXES.put( FilFile.DETAILS_FULL, FilFile.DETAILS_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyuser_idToevo_usr_user = + new com.evolute.entity.ForeignKey( FilFile.class, FilFile.USER_ID, db.data.siprp_local.outer.EvoUsrUserData.class, db.data.siprp_local.outer.EvoUsrUserData.ID ); + + public static final String TABLENAME = "fil_file"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.fil_file"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "fil_file.id"; + public static final int ID_INDEX = 0; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "fil_file.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 1; + public static final String NAME = "name"; + public static final String NAME_FULL = "fil_file.name"; + public static final int NAME_INDEX = 2; + public static final String MIME_TYPE = "mime_type"; + public static final String MIME_TYPE_FULL = "fil_file.mime_type"; + public static final int MIME_TYPE_INDEX = 3; + public static final String INSERTED_STAMP = "inserted_stamp"; + public static final String INSERTED_STAMP_FULL = "fil_file.inserted_stamp"; + public static final int INSERTED_STAMP_INDEX = 4; + public static final String USER_ID = "user_id"; + public static final String USER_ID_FULL = "fil_file.user_id"; + public static final int USER_ID_INDEX = 5; + public static final String TO_USER_ID = "to_user_id"; + public static final String TO_USER_ID_FULL = "fil_file.to_user_id"; + public static final int TO_USER_ID_INDEX = 6; + public static final String FILE_DATA = "file_data"; + public static final String FILE_DATA_FULL = "fil_file.file_data"; + public static final int FILE_DATA_INDEX = 7; + public static final String DETAILS = "details"; + public static final String DETAILS_FULL = "fil_file.details"; + public static final int DETAILS_INDEX = 8; + + public static final String FIELD_NAMES[] = new String[]{ + DELETED_STAMP, NAME, MIME_TYPE, INSERTED_STAMP, USER_ID, TO_USER_ID, FILE_DATA, + DETAILS, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DELETED_STAMP, TABLENAME + "." + NAME, TABLENAME + "." + MIME_TYPE, TABLENAME + "." + INSERTED_STAMP, TABLENAME + "." + USER_ID, TABLENAME + "." + TO_USER_ID, TABLENAME + "." + FILE_DATA, + TABLENAME + "." + DETAILS, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DELETED_STAMP, NAME, MIME_TYPE, INSERTED_STAMP, USER_ID, FILE_DATA, DETAILS, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DELETED_STAMP, NAME, MIME_TYPE, INSERTED_STAMP, USER_ID, DETAILS, }; + + private Integer id; + private java.sql.Timestamp deleted_stamp; + private String name; + private String mime_type; + private java.sql.Timestamp inserted_stamp; + private Integer user_id; + private db.data.siprp_local.outer.EvoUsrUserData to_user_id; + private byte[] file_data; + private String details; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public FilFile() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromFilFileAppointment_file_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.FilFileAppointmentData.class , getPrimaryKey().getMap().get("id"), "file_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public String getName() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.name; + } + + public void setName( String name ) + { + try + { + setLockedForRefresh( true ); + preProcess( NAME, name ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.name = name; + LAZY_LOADED_OBJECTS.put( NAME, Boolean.TRUE ); + } + + public String getMime_type() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MIME_TYPE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.mime_type; + } + + public void setMime_type( String mime_type ) + { + try + { + setLockedForRefresh( true ); + preProcess( MIME_TYPE, mime_type ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.mime_type = mime_type; + LAZY_LOADED_OBJECTS.put( MIME_TYPE, Boolean.TRUE ); + } + + public java.sql.Timestamp getInserted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INSERTED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inserted_stamp; + } + + public void setInserted_stamp( java.sql.Timestamp inserted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( INSERTED_STAMP, inserted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inserted_stamp = inserted_stamp; + LAZY_LOADED_OBJECTS.put( INSERTED_STAMP, Boolean.TRUE ); + } + + public Integer getUser_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( USER_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.user_id; + } + + public void setUser_id( Integer user_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( USER_ID, user_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.user_id = user_id; + LAZY_LOADED_OBJECTS.put( USER_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoUsrUserData toUser_id() + { + try + { + prepare( TO_USER_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_user_id; + } + + public void setToUser_id( db.data.siprp_local.outer.EvoUsrUserData to_user_id ) + { + try + { + preProcess( TO_USER_ID, to_user_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_user_id = to_user_id; + } + + public byte[] getFile_data() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FILE_DATA ); + Boolean isLazyLoaded = isPropertyLoaded( FILE_DATA ); + if ( ! isLazyLoaded ) + { + this.file_data = ( byte[] ) getProvider().loadFieldFromDatabase( FILE_DATA, this ); + LAZY_LOADED_OBJECTS.put( FILE_DATA, Boolean.TRUE ); + } + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.file_data; + } + + public void setFile_data( byte[] file_data ) + { + try + { + setLockedForRefresh( true ); + preProcess( FILE_DATA, file_data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.file_data = file_data; + LAZY_LOADED_OBJECTS.put( FILE_DATA, Boolean.TRUE ); + } + + public String getDetails() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DETAILS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.details; + } + + public void setDetails( String details ) + { + try + { + setLockedForRefresh( true ); + preProcess( DETAILS, details ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.details = details; + LAZY_LOADED_OBJECTS.put( DETAILS, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFile.ID_INDEX: + value = getId(); + break; + case FilFile.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + case FilFile.NAME_INDEX: + value = getName(); + break; + case FilFile.MIME_TYPE_INDEX: + value = getMime_type(); + break; + case FilFile.INSERTED_STAMP_INDEX: + value = getInserted_stamp(); + break; + case FilFile.USER_ID_INDEX: + value = getUser_id(); + break; + case FilFile.TO_USER_ID_INDEX: + value = toUser_id(); + break; + case FilFile.FILE_DATA_INDEX: + value = getFile_data(); + break; + case FilFile.DETAILS_INDEX: + value = getDetails(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFile.ID_INDEX: + value = this.id; + break; + case FilFile.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + case FilFile.NAME_INDEX: + value = this.name; + break; + case FilFile.MIME_TYPE_INDEX: + value = this.mime_type; + break; + case FilFile.INSERTED_STAMP_INDEX: + value = this.inserted_stamp; + break; + case FilFile.USER_ID_INDEX: + value = this.user_id; + break; + case FilFile.TO_USER_ID_INDEX: + value = this.to_user_id; + break; + case FilFile.FILE_DATA_INDEX: + value = this.file_data; + break; + case FilFile.DETAILS_INDEX: + value = this.details; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFile.ID_INDEX: + setId( ( Integer ) value ); + break; + case FilFile.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + case FilFile.NAME_INDEX: + setName( ( String ) value ); + break; + case FilFile.MIME_TYPE_INDEX: + setMime_type( ( String ) value ); + break; + case FilFile.INSERTED_STAMP_INDEX: + setInserted_stamp( ( java.sql.Timestamp ) value ); + break; + case FilFile.USER_ID_INDEX: + setUser_id( ( Integer ) value ); + break; + case FilFile.TO_USER_ID_INDEX: + setToUser_id( ( db.data.siprp_local.outer.EvoUsrUserData ) value ); + break; + case FilFile.FILE_DATA_INDEX: + setFile_data( ( byte[] ) value ); + break; + case FilFile.DETAILS_INDEX: + setDetails( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFile.ID_INDEX: + this.id = ( Integer ) value; + break; + case FilFile.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + case FilFile.NAME_INDEX: + this.name = ( String ) value; + break; + case FilFile.MIME_TYPE_INDEX: + this.mime_type = ( String ) value; + break; + case FilFile.INSERTED_STAMP_INDEX: + this.inserted_stamp = ( java.sql.Timestamp ) value; + break; + case FilFile.USER_ID_INDEX: + this.user_id = ( Integer ) value; + break; + case FilFile.TO_USER_ID_INDEX: + this.to_user_id = ( db.data.siprp_local.outer.EvoUsrUserData ) value; + break; + case FilFile.FILE_DATA_INDEX: + this.file_data = ( byte[] ) value; + break; + case FilFile.DETAILS_INDEX: + this.details = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case FilFile.ID_INDEX: + theClass = Integer.class; + break; + case FilFile.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case FilFile.NAME_INDEX: + theClass = String.class; + break; + case FilFile.MIME_TYPE_INDEX: + theClass = String.class; + break; + case FilFile.INSERTED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case FilFile.USER_ID_INDEX: + theClass = Integer.class; + break; + case FilFile.TO_USER_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoUsrUserData.class; + break; + case FilFile.FILE_DATA_INDEX: + theClass = byte[].class; + break; + case FilFile.DETAILS_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : FilFile._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, FilFile.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + LAZY_LOADED_OBJECTS.put( FILE_DATA, Boolean.FALSE ); + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/FilFileAppointment.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/FilFileAppointment.java new file mode 100644 index 00000000..de1b902d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/FilFileAppointment.java @@ -0,0 +1,431 @@ +/* +* FilFileAppointment.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class FilFileAppointment extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( FilFileAppointment.ID, FilFileAppointment.ID_INDEX ); + FIELD_INDEXES.put( FilFileAppointment.ID_FULL, FilFileAppointment.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( FilFileAppointment.CLASS_IDENTIFIER, FilFileAppointment.FILE_ID, FilFileAppointment.TO_FILE_ID ); + FIELD_INDEXES.put( FilFileAppointment.FILE_ID, FilFileAppointment.FILE_ID_INDEX ); + FIELD_INDEXES.put( FilFileAppointment.FILE_ID_FULL, FilFileAppointment.FILE_ID_INDEX ); + FIELD_INDEXES.put( FilFileAppointment.TO_FILE_ID, FilFileAppointment.TO_FILE_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( FilFileAppointment.CLASS_IDENTIFIER, FilFileAppointment.APPOINTMENT_ID, FilFileAppointment.TO_APPOINTMENT_ID ); + FIELD_INDEXES.put( FilFileAppointment.APPOINTMENT_ID, FilFileAppointment.APPOINTMENT_ID_INDEX ); + FIELD_INDEXES.put( FilFileAppointment.APPOINTMENT_ID_FULL, FilFileAppointment.APPOINTMENT_ID_INDEX ); + FIELD_INDEXES.put( FilFileAppointment.TO_APPOINTMENT_ID, FilFileAppointment.TO_APPOINTMENT_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyfile_idTofil_file = + new com.evolute.entity.ForeignKey( FilFileAppointment.class, FilFileAppointment.FILE_ID, db.data.siprp_local.outer.FilFileData.class, db.data.siprp_local.outer.FilFileData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyappointment_idToapt_appointment = + new com.evolute.entity.ForeignKey( FilFileAppointment.class, FilFileAppointment.APPOINTMENT_ID, db.data.siprp_local.outer.AptAppointmentData.class, db.data.siprp_local.outer.AptAppointmentData.ID ); + + public static final String TABLENAME = "fil_file_appointment"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.fil_file_appointment"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "fil_file_appointment.id"; + public static final int ID_INDEX = 0; + public static final String FILE_ID = "file_id"; + public static final String FILE_ID_FULL = "fil_file_appointment.file_id"; + public static final int FILE_ID_INDEX = 1; + public static final String TO_FILE_ID = "to_file_id"; + public static final String TO_FILE_ID_FULL = "fil_file_appointment.to_file_id"; + public static final int TO_FILE_ID_INDEX = 2; + public static final String APPOINTMENT_ID = "appointment_id"; + public static final String APPOINTMENT_ID_FULL = "fil_file_appointment.appointment_id"; + public static final int APPOINTMENT_ID_INDEX = 3; + public static final String TO_APPOINTMENT_ID = "to_appointment_id"; + public static final String TO_APPOINTMENT_ID_FULL = "fil_file_appointment.to_appointment_id"; + public static final int TO_APPOINTMENT_ID_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + FILE_ID, TO_FILE_ID, APPOINTMENT_ID, TO_APPOINTMENT_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + FILE_ID, TABLENAME + "." + TO_FILE_ID, TABLENAME + "." + APPOINTMENT_ID, TABLENAME + "." + TO_APPOINTMENT_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, FILE_ID, APPOINTMENT_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, FILE_ID, APPOINTMENT_ID, }; + + private Integer id; + private Integer file_id; + private db.data.siprp_local.outer.FilFileData to_file_id; + private Integer appointment_id; + private db.data.siprp_local.outer.AptAppointmentData to_appointment_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public FilFileAppointment() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getFile_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FILE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.file_id; + } + + public void setFile_id( Integer file_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( FILE_ID, file_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.file_id = file_id; + LAZY_LOADED_OBJECTS.put( FILE_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.FilFileData toFile_id() + { + try + { + prepare( TO_FILE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_file_id; + } + + public void setToFile_id( db.data.siprp_local.outer.FilFileData to_file_id ) + { + try + { + preProcess( TO_FILE_ID, to_file_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_file_id = to_file_id; + } + + public Integer getAppointment_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( APPOINTMENT_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.appointment_id; + } + + public void setAppointment_id( Integer appointment_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( APPOINTMENT_ID, appointment_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.appointment_id = appointment_id; + LAZY_LOADED_OBJECTS.put( APPOINTMENT_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.AptAppointmentData toAppointment_id() + { + try + { + prepare( TO_APPOINTMENT_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_appointment_id; + } + + public void setToAppointment_id( db.data.siprp_local.outer.AptAppointmentData to_appointment_id ) + { + try + { + preProcess( TO_APPOINTMENT_ID, to_appointment_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_appointment_id = to_appointment_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFileAppointment.ID_INDEX: + value = getId(); + break; + case FilFileAppointment.FILE_ID_INDEX: + value = getFile_id(); + break; + case FilFileAppointment.TO_FILE_ID_INDEX: + value = toFile_id(); + break; + case FilFileAppointment.APPOINTMENT_ID_INDEX: + value = getAppointment_id(); + break; + case FilFileAppointment.TO_APPOINTMENT_ID_INDEX: + value = toAppointment_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFileAppointment.ID_INDEX: + value = this.id; + break; + case FilFileAppointment.FILE_ID_INDEX: + value = this.file_id; + break; + case FilFileAppointment.TO_FILE_ID_INDEX: + value = this.to_file_id; + break; + case FilFileAppointment.APPOINTMENT_ID_INDEX: + value = this.appointment_id; + break; + case FilFileAppointment.TO_APPOINTMENT_ID_INDEX: + value = this.to_appointment_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFileAppointment.ID_INDEX: + setId( ( Integer ) value ); + break; + case FilFileAppointment.FILE_ID_INDEX: + setFile_id( ( Integer ) value ); + break; + case FilFileAppointment.TO_FILE_ID_INDEX: + setToFile_id( ( db.data.siprp_local.outer.FilFileData ) value ); + break; + case FilFileAppointment.APPOINTMENT_ID_INDEX: + setAppointment_id( ( Integer ) value ); + break; + case FilFileAppointment.TO_APPOINTMENT_ID_INDEX: + setToAppointment_id( ( db.data.siprp_local.outer.AptAppointmentData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case FilFileAppointment.ID_INDEX: + this.id = ( Integer ) value; + break; + case FilFileAppointment.FILE_ID_INDEX: + this.file_id = ( Integer ) value; + break; + case FilFileAppointment.TO_FILE_ID_INDEX: + this.to_file_id = ( db.data.siprp_local.outer.FilFileData ) value; + break; + case FilFileAppointment.APPOINTMENT_ID_INDEX: + this.appointment_id = ( Integer ) value; + break; + case FilFileAppointment.TO_APPOINTMENT_ID_INDEX: + this.to_appointment_id = ( db.data.siprp_local.outer.AptAppointmentData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case FilFileAppointment.ID_INDEX: + theClass = Integer.class; + break; + case FilFileAppointment.FILE_ID_INDEX: + theClass = Integer.class; + break; + case FilFileAppointment.TO_FILE_ID_INDEX: + theClass = db.data.siprp_local.outer.FilFileData.class; + break; + case FilFileAppointment.APPOINTMENT_ID_INDEX: + theClass = Integer.class; + break; + case FilFileAppointment.TO_APPOINTMENT_ID_INDEX: + theClass = db.data.siprp_local.outer.AptAppointmentData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : FilFileAppointment._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, FilFileAppointment.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HistoricoEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HistoricoEstabelecimento.java new file mode 100644 index 00000000..f4e8a424 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HistoricoEstabelecimento.java @@ -0,0 +1,431 @@ +/* +* HistoricoEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HistoricoEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HistoricoEstabelecimento.ID, HistoricoEstabelecimento.ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.ID_FULL, HistoricoEstabelecimento.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HistoricoEstabelecimento.CLASS_IDENTIFIER, HistoricoEstabelecimento.ESTABELECIMENTO_ID, HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( HistoricoEstabelecimento.ESTABELECIMENTO_ID, HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.ESTABELECIMENTO_ID_FULL, HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID, HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.DATA, HistoricoEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.DATA_FULL, HistoricoEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.TEXTO, HistoricoEstabelecimento.TEXTO_INDEX ); + FIELD_INDEXES.put( HistoricoEstabelecimento.TEXTO_FULL, HistoricoEstabelecimento.TEXTO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( HistoricoEstabelecimento.class, HistoricoEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "historico_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.historico_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "historico_estabelecimento.id"; + public static final int ID_INDEX = 0; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "historico_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 1; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "historico_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 2; + public static final String DATA = "data"; + public static final String DATA_FULL = "historico_estabelecimento.data"; + public static final int DATA_INDEX = 3; + public static final String TEXTO = "texto"; + public static final String TEXTO_FULL = "historico_estabelecimento.texto"; + public static final int TEXTO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, DATA, TEXTO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, TABLENAME + "." + DATA, TABLENAME + "." + TEXTO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ESTABELECIMENTO_ID, DATA, TEXTO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ESTABELECIMENTO_ID, DATA, TEXTO, }; + + private Integer id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + private java.util.Date data; + private String texto; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HistoricoEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getTexto() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TEXTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.texto; + } + + public void setTexto( String texto ) + { + try + { + setLockedForRefresh( true ); + preProcess( TEXTO, texto ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.texto = texto; + LAZY_LOADED_OBJECTS.put( TEXTO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + value = getId(); + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case HistoricoEstabelecimento.DATA_INDEX: + value = getData(); + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + value = getTexto(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + value = this.id; + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case HistoricoEstabelecimento.DATA_INDEX: + value = this.data; + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + value = this.texto; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + setId( ( Integer ) value ); + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + case HistoricoEstabelecimento.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + setTexto( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + this.id = ( Integer ) value; + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + case HistoricoEstabelecimento.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + this.texto = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HistoricoEstabelecimento.ID_INDEX: + theClass = Integer.class; + break; + case HistoricoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case HistoricoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + case HistoricoEstabelecimento.DATA_INDEX: + theClass = java.util.Date.class; + break; + case HistoricoEstabelecimento.TEXTO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HistoricoEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HistoricoEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsArea.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsArea.java new file mode 100644 index 00000000..e0ee2fd9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsArea.java @@ -0,0 +1,495 @@ +/* +* HsArea.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsArea extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsArea.ID, HsArea.ID_INDEX ); + FIELD_INDEXES.put( HsArea.ID_FULL, HsArea.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsArea.CLASS_IDENTIFIER, HsArea.EMPRESA_ID, HsArea.TO_EMPRESA_ID ); + FIELD_INDEXES.put( HsArea.EMPRESA_ID, HsArea.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsArea.EMPRESA_ID_FULL, HsArea.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsArea.TO_EMPRESA_ID, HsArea.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsArea.DESCRIPTION, HsArea.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsArea.DESCRIPTION_FULL, HsArea.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsArea.DELETED_DATE, HsArea.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsArea.DELETED_DATE_FULL, HsArea.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsArea.ORDEM, HsArea.ORDEM_INDEX ); + FIELD_INDEXES.put( HsArea.ORDEM_FULL, HsArea.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( HsArea.class, HsArea.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "hs_area"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_area"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_area.id"; + public static final int ID_INDEX = 0; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "hs_area.empresa_id"; + public static final int EMPRESA_ID_INDEX = 1; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "hs_area.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 2; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_area.description"; + public static final int DESCRIPTION_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_area.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "hs_area.ordem"; + public static final int ORDEM_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + EMPRESA_ID, TO_EMPRESA_ID, DESCRIPTION, DELETED_DATE, ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, EMPRESA_ID, DESCRIPTION, DELETED_DATE, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, EMPRESA_ID, DESCRIPTION, DELETED_DATE, ORDEM, }; + + private Integer id; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private String description; + private java.sql.Timestamp deleted_date; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsArea() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsPosto_area_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoData.class , getPrimaryKey().getMap().get("id"), "area_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsArea.ID_INDEX: + value = getId(); + break; + case HsArea.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case HsArea.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case HsArea.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsArea.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsArea.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsArea.ID_INDEX: + value = this.id; + break; + case HsArea.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case HsArea.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case HsArea.DESCRIPTION_INDEX: + value = this.description; + break; + case HsArea.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsArea.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsArea.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsArea.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case HsArea.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case HsArea.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsArea.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsArea.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsArea.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsArea.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case HsArea.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case HsArea.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsArea.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsArea.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsArea.ID_INDEX: + theClass = Integer.class; + break; + case HsArea.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case HsArea.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case HsArea.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsArea.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsArea.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsArea._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsArea.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmail.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmail.java new file mode 100644 index 00000000..2671fc45 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmail.java @@ -0,0 +1,308 @@ +/* +* HsEmail.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsEmail extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsEmail.ID, HsEmail.ID_INDEX ); + FIELD_INDEXES.put( HsEmail.ID_FULL, HsEmail.ID_INDEX ); + FIELD_INDEXES.put( HsEmail.EMAIL, HsEmail.EMAIL_INDEX ); + FIELD_INDEXES.put( HsEmail.EMAIL_FULL, HsEmail.EMAIL_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_email"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_email"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_email.id"; + public static final int ID_INDEX = 0; + public static final String EMAIL = "email"; + public static final String EMAIL_FULL = "hs_email.email"; + public static final int EMAIL_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + EMAIL, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + EMAIL, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, EMAIL, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, EMAIL, }; + + private Integer id; + private String email; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsEmail() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsEmailEmpresa_email_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsEmailEmpresaData.class , getPrimaryKey().getMap().get("id"), "email_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsEmailEstabelecimento_email_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsEmailEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "email_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getEmail() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email; + } + + public void setEmail( String email ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMAIL, email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email = email; + LAZY_LOADED_OBJECTS.put( EMAIL, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmail.ID_INDEX: + value = getId(); + break; + case HsEmail.EMAIL_INDEX: + value = getEmail(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmail.ID_INDEX: + value = this.id; + break; + case HsEmail.EMAIL_INDEX: + value = this.email; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmail.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsEmail.EMAIL_INDEX: + setEmail( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmail.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsEmail.EMAIL_INDEX: + this.email = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsEmail.ID_INDEX: + theClass = Integer.class; + break; + case HsEmail.EMAIL_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsEmail._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsEmail.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmailEmpresa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmailEmpresa.java new file mode 100644 index 00000000..b3a462e0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmailEmpresa.java @@ -0,0 +1,381 @@ +/* +* HsEmailEmpresa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsEmailEmpresa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsEmailEmpresa.CLASS_IDENTIFIER, HsEmailEmpresa.EMAIL_ID, HsEmailEmpresa.TO_EMAIL_ID ); + FIELD_INDEXES.put( HsEmailEmpresa.EMAIL_ID, HsEmailEmpresa.EMAIL_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEmpresa.EMAIL_ID_FULL, HsEmailEmpresa.EMAIL_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEmpresa.TO_EMAIL_ID, HsEmailEmpresa.TO_EMAIL_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsEmailEmpresa.CLASS_IDENTIFIER, HsEmailEmpresa.EMPRESA_ID, HsEmailEmpresa.TO_EMPRESA_ID ); + FIELD_INDEXES.put( HsEmailEmpresa.EMPRESA_ID, HsEmailEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEmpresa.EMPRESA_ID_FULL, HsEmailEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEmpresa.TO_EMPRESA_ID, HsEmailEmpresa.TO_EMPRESA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyemail_idTohs_email = + new com.evolute.entity.ForeignKey( HsEmailEmpresa.class, HsEmailEmpresa.EMAIL_ID, db.data.siprp_local.outer.HsEmailData.class, db.data.siprp_local.outer.HsEmailData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( HsEmailEmpresa.class, HsEmailEmpresa.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "hs_email_empresa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_email_empresa"; + + public static final int _INVALID__INDEX = -1; + public static final String EMAIL_ID = "email_id"; + public static final String EMAIL_ID_FULL = "hs_email_empresa.email_id"; + public static final int EMAIL_ID_INDEX = 0; + public static final String TO_EMAIL_ID = "to_email_id"; + public static final String TO_EMAIL_ID_FULL = "hs_email_empresa.to_email_id"; + public static final int TO_EMAIL_ID_INDEX = 1; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "hs_email_empresa.empresa_id"; + public static final int EMPRESA_ID_INDEX = 2; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "hs_email_empresa.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + EMAIL_ID, EMPRESA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + EMAIL_ID, EMPRESA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + EMAIL_ID, EMPRESA_ID, }; + + private Integer email_id; + private db.data.siprp_local.outer.HsEmailData to_email_id; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsEmailEmpresa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getEmail_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email_id; + } + + public void setEmail_id( Integer email_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMAIL_ID, email_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email_id = email_id; + LAZY_LOADED_OBJECTS.put( EMAIL_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsEmailData toEmail_id() + { + try + { + prepare( TO_EMAIL_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_email_id; + } + + public void setToEmail_id( db.data.siprp_local.outer.HsEmailData to_email_id ) + { + try + { + preProcess( TO_EMAIL_ID, to_email_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_email_id = to_email_id; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEmpresa.EMAIL_ID_INDEX: + value = getEmail_id(); + break; + case HsEmailEmpresa.TO_EMAIL_ID_INDEX: + value = toEmail_id(); + break; + case HsEmailEmpresa.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case HsEmailEmpresa.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEmpresa.EMAIL_ID_INDEX: + value = this.email_id; + break; + case HsEmailEmpresa.TO_EMAIL_ID_INDEX: + value = this.to_email_id; + break; + case HsEmailEmpresa.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case HsEmailEmpresa.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEmpresa.EMAIL_ID_INDEX: + setEmail_id( ( Integer ) value ); + break; + case HsEmailEmpresa.TO_EMAIL_ID_INDEX: + setToEmail_id( ( db.data.siprp_local.outer.HsEmailData ) value ); + break; + case HsEmailEmpresa.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case HsEmailEmpresa.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEmpresa.EMAIL_ID_INDEX: + this.email_id = ( Integer ) value; + break; + case HsEmailEmpresa.TO_EMAIL_ID_INDEX: + this.to_email_id = ( db.data.siprp_local.outer.HsEmailData ) value; + break; + case HsEmailEmpresa.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case HsEmailEmpresa.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsEmailEmpresa is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsEmailEmpresa.EMAIL_ID_INDEX: + theClass = Integer.class; + break; + case HsEmailEmpresa.TO_EMAIL_ID_INDEX: + theClass = db.data.siprp_local.outer.HsEmailData.class; + break; + case HsEmailEmpresa.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case HsEmailEmpresa.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsEmailEmpresa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsEmailEmpresa.PK_FIELD_NAMES ); + primaryKey.set( 0, getEmail_id() ); + primaryKey.set( 1, getEmpresa_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmailEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmailEstabelecimento.java new file mode 100644 index 00000000..379b3617 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEmailEstabelecimento.java @@ -0,0 +1,381 @@ +/* +* HsEmailEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsEmailEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsEmailEstabelecimento.CLASS_IDENTIFIER, HsEmailEstabelecimento.EMAIL_ID, HsEmailEstabelecimento.TO_EMAIL_ID ); + FIELD_INDEXES.put( HsEmailEstabelecimento.EMAIL_ID, HsEmailEstabelecimento.EMAIL_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEstabelecimento.EMAIL_ID_FULL, HsEmailEstabelecimento.EMAIL_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEstabelecimento.TO_EMAIL_ID, HsEmailEstabelecimento.TO_EMAIL_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsEmailEstabelecimento.CLASS_IDENTIFIER, HsEmailEstabelecimento.ESTABELECIMENTO_ID, HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( HsEmailEstabelecimento.ESTABELECIMENTO_ID, HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEstabelecimento.ESTABELECIMENTO_ID_FULL, HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID, HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyemail_idTohs_email = + new com.evolute.entity.ForeignKey( HsEmailEstabelecimento.class, HsEmailEstabelecimento.EMAIL_ID, db.data.siprp_local.outer.HsEmailData.class, db.data.siprp_local.outer.HsEmailData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( HsEmailEstabelecimento.class, HsEmailEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "hs_email_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_email_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String EMAIL_ID = "email_id"; + public static final String EMAIL_ID_FULL = "hs_email_estabelecimento.email_id"; + public static final int EMAIL_ID_INDEX = 0; + public static final String TO_EMAIL_ID = "to_email_id"; + public static final String TO_EMAIL_ID_FULL = "hs_email_estabelecimento.to_email_id"; + public static final int TO_EMAIL_ID_INDEX = 1; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "hs_email_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 2; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "hs_email_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + EMAIL_ID, ESTABELECIMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + EMAIL_ID, ESTABELECIMENTO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + EMAIL_ID, ESTABELECIMENTO_ID, }; + + private Integer email_id; + private db.data.siprp_local.outer.HsEmailData to_email_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsEmailEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getEmail_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMAIL_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.email_id; + } + + public void setEmail_id( Integer email_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMAIL_ID, email_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.email_id = email_id; + LAZY_LOADED_OBJECTS.put( EMAIL_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsEmailData toEmail_id() + { + try + { + prepare( TO_EMAIL_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_email_id; + } + + public void setToEmail_id( db.data.siprp_local.outer.HsEmailData to_email_id ) + { + try + { + preProcess( TO_EMAIL_ID, to_email_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_email_id = to_email_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEstabelecimento.EMAIL_ID_INDEX: + value = getEmail_id(); + break; + case HsEmailEstabelecimento.TO_EMAIL_ID_INDEX: + value = toEmail_id(); + break; + case HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEstabelecimento.EMAIL_ID_INDEX: + value = this.email_id; + break; + case HsEmailEstabelecimento.TO_EMAIL_ID_INDEX: + value = this.to_email_id; + break; + case HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEstabelecimento.EMAIL_ID_INDEX: + setEmail_id( ( Integer ) value ); + break; + case HsEmailEstabelecimento.TO_EMAIL_ID_INDEX: + setToEmail_id( ( db.data.siprp_local.outer.HsEmailData ) value ); + break; + case HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEmailEstabelecimento.EMAIL_ID_INDEX: + this.email_id = ( Integer ) value; + break; + case HsEmailEstabelecimento.TO_EMAIL_ID_INDEX: + this.to_email_id = ( db.data.siprp_local.outer.HsEmailData ) value; + break; + case HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsEmailEstabelecimento is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsEmailEstabelecimento.EMAIL_ID_INDEX: + theClass = Integer.class; + break; + case HsEmailEstabelecimento.TO_EMAIL_ID_INDEX: + theClass = db.data.siprp_local.outer.HsEmailData.class; + break; + case HsEmailEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case HsEmailEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsEmailEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsEmailEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, getEmail_id() ); + primaryKey.set( 1, getEstabelecimento_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEquipamento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEquipamento.java new file mode 100644 index 00000000..0fb4aa02 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsEquipamento.java @@ -0,0 +1,431 @@ +/* +* HsEquipamento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsEquipamento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsEquipamento.ID, HsEquipamento.ID_INDEX ); + FIELD_INDEXES.put( HsEquipamento.ID_FULL, HsEquipamento.ID_INDEX ); + FIELD_INDEXES.put( HsEquipamento.TIPO, HsEquipamento.TIPO_INDEX ); + FIELD_INDEXES.put( HsEquipamento.TIPO_FULL, HsEquipamento.TIPO_INDEX ); + FIELD_INDEXES.put( HsEquipamento.MARCA, HsEquipamento.MARCA_INDEX ); + FIELD_INDEXES.put( HsEquipamento.MARCA_FULL, HsEquipamento.MARCA_INDEX ); + FIELD_INDEXES.put( HsEquipamento.MODELO, HsEquipamento.MODELO_INDEX ); + FIELD_INDEXES.put( HsEquipamento.MODELO_FULL, HsEquipamento.MODELO_INDEX ); + FIELD_INDEXES.put( HsEquipamento.DELETED_DATE, HsEquipamento.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsEquipamento.DELETED_DATE_FULL, HsEquipamento.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_equipamento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_equipamento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_equipamento.id"; + public static final int ID_INDEX = 0; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "hs_equipamento.tipo"; + public static final int TIPO_INDEX = 1; + public static final String MARCA = "marca"; + public static final String MARCA_FULL = "hs_equipamento.marca"; + public static final int MARCA_INDEX = 2; + public static final String MODELO = "modelo"; + public static final String MODELO_FULL = "hs_equipamento.modelo"; + public static final int MODELO_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_equipamento.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO, MARCA, MODELO, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO, TABLENAME + "." + MARCA, TABLENAME + "." + MODELO, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO, MARCA, MODELO, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO, MARCA, MODELO, DELETED_DATE, }; + + private Integer id; + private String tipo; + private String marca; + private String modelo; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsEquipamento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( String tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public String getMarca() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marca; + } + + public void setMarca( String marca ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCA, marca ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marca = marca; + LAZY_LOADED_OBJECTS.put( MARCA, Boolean.TRUE ); + } + + public String getModelo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MODELO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.modelo; + } + + public void setModelo( String modelo ) + { + try + { + setLockedForRefresh( true ); + preProcess( MODELO, modelo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.modelo = modelo; + LAZY_LOADED_OBJECTS.put( MODELO, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEquipamento.ID_INDEX: + value = getId(); + break; + case HsEquipamento.TIPO_INDEX: + value = getTipo(); + break; + case HsEquipamento.MARCA_INDEX: + value = getMarca(); + break; + case HsEquipamento.MODELO_INDEX: + value = getModelo(); + break; + case HsEquipamento.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEquipamento.ID_INDEX: + value = this.id; + break; + case HsEquipamento.TIPO_INDEX: + value = this.tipo; + break; + case HsEquipamento.MARCA_INDEX: + value = this.marca; + break; + case HsEquipamento.MODELO_INDEX: + value = this.modelo; + break; + case HsEquipamento.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEquipamento.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsEquipamento.TIPO_INDEX: + setTipo( ( String ) value ); + break; + case HsEquipamento.MARCA_INDEX: + setMarca( ( String ) value ); + break; + case HsEquipamento.MODELO_INDEX: + setModelo( ( String ) value ); + break; + case HsEquipamento.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsEquipamento.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsEquipamento.TIPO_INDEX: + this.tipo = ( String ) value; + break; + case HsEquipamento.MARCA_INDEX: + this.marca = ( String ) value; + break; + case HsEquipamento.MODELO_INDEX: + this.modelo = ( String ) value; + break; + case HsEquipamento.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsEquipamento.ID_INDEX: + theClass = Integer.class; + break; + case HsEquipamento.TIPO_INDEX: + theClass = String.class; + break; + case HsEquipamento.MARCA_INDEX: + theClass = String.class; + break; + case HsEquipamento.MODELO_INDEX: + theClass = String.class; + break; + case HsEquipamento.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsEquipamento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsEquipamento.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacao.java new file mode 100644 index 00000000..c3c7aa95 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacao.java @@ -0,0 +1,459 @@ +/* +* HsLegislacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsLegislacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsLegislacao.ID, HsLegislacao.ID_INDEX ); + FIELD_INDEXES.put( HsLegislacao.ID_FULL, HsLegislacao.ID_INDEX ); + FIELD_INDEXES.put( HsLegislacao.DESCRIPTION, HsLegislacao.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsLegislacao.DESCRIPTION_FULL, HsLegislacao.DESCRIPTION_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsLegislacao.CLASS_IDENTIFIER, HsLegislacao.CATEGORIA_ID, HsLegislacao.TO_CATEGORIA_ID ); + FIELD_INDEXES.put( HsLegislacao.CATEGORIA_ID, HsLegislacao.CATEGORIA_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacao.CATEGORIA_ID_FULL, HsLegislacao.CATEGORIA_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacao.TO_CATEGORIA_ID, HsLegislacao.TO_CATEGORIA_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacao.DELETED_DATE, HsLegislacao.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsLegislacao.DELETED_DATE_FULL, HsLegislacao.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeycategoria_idTohs_legislacao_categoria = + new com.evolute.entity.ForeignKey( HsLegislacao.class, HsLegislacao.CATEGORIA_ID, db.data.siprp_local.outer.HsLegislacaoCategoriaData.class, db.data.siprp_local.outer.HsLegislacaoCategoriaData.ID ); + + public static final String TABLENAME = "hs_legislacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_legislacao"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_legislacao.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_legislacao.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String CATEGORIA_ID = "categoria_id"; + public static final String CATEGORIA_ID_FULL = "hs_legislacao.categoria_id"; + public static final int CATEGORIA_ID_INDEX = 2; + public static final String TO_CATEGORIA_ID = "to_categoria_id"; + public static final String TO_CATEGORIA_ID_FULL = "hs_legislacao.to_categoria_id"; + public static final int TO_CATEGORIA_ID_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_legislacao.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, CATEGORIA_ID, TO_CATEGORIA_ID, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + CATEGORIA_ID, TABLENAME + "." + TO_CATEGORIA_ID, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, CATEGORIA_ID, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, CATEGORIA_ID, DELETED_DATE, }; + + private Integer id; + private String description; + private Integer categoria_id; + private db.data.siprp_local.outer.HsLegislacaoCategoriaData to_categoria_id; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsLegislacao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsLegislacaoEmpresa_legislacao_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsLegislacaoEmpresaData.class , getPrimaryKey().getMap().get("id"), "legislacao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsLegislacaoEstabelecimento_legislacao_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsLegislacaoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "legislacao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Integer getCategoria_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CATEGORIA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.categoria_id; + } + + public void setCategoria_id( Integer categoria_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CATEGORIA_ID, categoria_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.categoria_id = categoria_id; + LAZY_LOADED_OBJECTS.put( CATEGORIA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsLegislacaoCategoriaData toCategoria_id() + { + try + { + prepare( TO_CATEGORIA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_categoria_id; + } + + public void setToCategoria_id( db.data.siprp_local.outer.HsLegislacaoCategoriaData to_categoria_id ) + { + try + { + preProcess( TO_CATEGORIA_ID, to_categoria_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_categoria_id = to_categoria_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacao.ID_INDEX: + value = getId(); + break; + case HsLegislacao.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsLegislacao.CATEGORIA_ID_INDEX: + value = getCategoria_id(); + break; + case HsLegislacao.TO_CATEGORIA_ID_INDEX: + value = toCategoria_id(); + break; + case HsLegislacao.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacao.ID_INDEX: + value = this.id; + break; + case HsLegislacao.DESCRIPTION_INDEX: + value = this.description; + break; + case HsLegislacao.CATEGORIA_ID_INDEX: + value = this.categoria_id; + break; + case HsLegislacao.TO_CATEGORIA_ID_INDEX: + value = this.to_categoria_id; + break; + case HsLegislacao.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacao.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsLegislacao.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsLegislacao.CATEGORIA_ID_INDEX: + setCategoria_id( ( Integer ) value ); + break; + case HsLegislacao.TO_CATEGORIA_ID_INDEX: + setToCategoria_id( ( db.data.siprp_local.outer.HsLegislacaoCategoriaData ) value ); + break; + case HsLegislacao.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacao.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsLegislacao.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsLegislacao.CATEGORIA_ID_INDEX: + this.categoria_id = ( Integer ) value; + break; + case HsLegislacao.TO_CATEGORIA_ID_INDEX: + this.to_categoria_id = ( db.data.siprp_local.outer.HsLegislacaoCategoriaData ) value; + break; + case HsLegislacao.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsLegislacao.ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacao.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsLegislacao.CATEGORIA_ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacao.TO_CATEGORIA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsLegislacaoCategoriaData.class; + break; + case HsLegislacao.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsLegislacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsLegislacao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoCategoria.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoCategoria.java new file mode 100644 index 00000000..690b1e8c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoCategoria.java @@ -0,0 +1,344 @@ +/* +* HsLegislacaoCategoria.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsLegislacaoCategoria extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsLegislacaoCategoria.ID, HsLegislacaoCategoria.ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoCategoria.ID_FULL, HsLegislacaoCategoria.ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoCategoria.DESCRIPTION, HsLegislacaoCategoria.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsLegislacaoCategoria.DESCRIPTION_FULL, HsLegislacaoCategoria.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsLegislacaoCategoria.DELETED_DATE, HsLegislacaoCategoria.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsLegislacaoCategoria.DELETED_DATE_FULL, HsLegislacaoCategoria.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_legislacao_categoria"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_legislacao_categoria"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_legislacao_categoria.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_legislacao_categoria.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_legislacao_categoria.deleted_date"; + public static final int DELETED_DATE_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, DELETED_DATE, }; + + private Integer id; + private String description; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsLegislacaoCategoria() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsLegislacao_categoria_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsLegislacaoData.class , getPrimaryKey().getMap().get("id"), "categoria_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoCategoria.ID_INDEX: + value = getId(); + break; + case HsLegislacaoCategoria.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsLegislacaoCategoria.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoCategoria.ID_INDEX: + value = this.id; + break; + case HsLegislacaoCategoria.DESCRIPTION_INDEX: + value = this.description; + break; + case HsLegislacaoCategoria.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoCategoria.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsLegislacaoCategoria.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsLegislacaoCategoria.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoCategoria.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsLegislacaoCategoria.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsLegislacaoCategoria.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsLegislacaoCategoria.ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacaoCategoria.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsLegislacaoCategoria.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsLegislacaoCategoria._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsLegislacaoCategoria.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoEmpresa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoEmpresa.java new file mode 100644 index 00000000..69c5d8d8 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoEmpresa.java @@ -0,0 +1,381 @@ +/* +* HsLegislacaoEmpresa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsLegislacaoEmpresa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsLegislacaoEmpresa.CLASS_IDENTIFIER, HsLegislacaoEmpresa.LEGISLACAO_ID, HsLegislacaoEmpresa.TO_LEGISLACAO_ID ); + FIELD_INDEXES.put( HsLegislacaoEmpresa.LEGISLACAO_ID, HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEmpresa.LEGISLACAO_ID_FULL, HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEmpresa.TO_LEGISLACAO_ID, HsLegislacaoEmpresa.TO_LEGISLACAO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsLegislacaoEmpresa.CLASS_IDENTIFIER, HsLegislacaoEmpresa.EMPRESA_ID, HsLegislacaoEmpresa.TO_EMPRESA_ID ); + FIELD_INDEXES.put( HsLegislacaoEmpresa.EMPRESA_ID, HsLegislacaoEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEmpresa.EMPRESA_ID_FULL, HsLegislacaoEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEmpresa.TO_EMPRESA_ID, HsLegislacaoEmpresa.TO_EMPRESA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeylegislacao_idTohs_legislacao = + new com.evolute.entity.ForeignKey( HsLegislacaoEmpresa.class, HsLegislacaoEmpresa.LEGISLACAO_ID, db.data.siprp_local.outer.HsLegislacaoData.class, db.data.siprp_local.outer.HsLegislacaoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( HsLegislacaoEmpresa.class, HsLegislacaoEmpresa.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "hs_legislacao_empresa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_legislacao_empresa"; + + public static final int _INVALID__INDEX = -1; + public static final String LEGISLACAO_ID = "legislacao_id"; + public static final String LEGISLACAO_ID_FULL = "hs_legislacao_empresa.legislacao_id"; + public static final int LEGISLACAO_ID_INDEX = 0; + public static final String TO_LEGISLACAO_ID = "to_legislacao_id"; + public static final String TO_LEGISLACAO_ID_FULL = "hs_legislacao_empresa.to_legislacao_id"; + public static final int TO_LEGISLACAO_ID_INDEX = 1; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "hs_legislacao_empresa.empresa_id"; + public static final int EMPRESA_ID_INDEX = 2; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "hs_legislacao_empresa.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + LEGISLACAO_ID, EMPRESA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + LEGISLACAO_ID, EMPRESA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + LEGISLACAO_ID, EMPRESA_ID, }; + + private Integer legislacao_id; + private db.data.siprp_local.outer.HsLegislacaoData to_legislacao_id; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsLegislacaoEmpresa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getLegislacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LEGISLACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.legislacao_id; + } + + public void setLegislacao_id( Integer legislacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( LEGISLACAO_ID, legislacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.legislacao_id = legislacao_id; + LAZY_LOADED_OBJECTS.put( LEGISLACAO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsLegislacaoData toLegislacao_id() + { + try + { + prepare( TO_LEGISLACAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_legislacao_id; + } + + public void setToLegislacao_id( db.data.siprp_local.outer.HsLegislacaoData to_legislacao_id ) + { + try + { + preProcess( TO_LEGISLACAO_ID, to_legislacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_legislacao_id = to_legislacao_id; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX: + value = getLegislacao_id(); + break; + case HsLegislacaoEmpresa.TO_LEGISLACAO_ID_INDEX: + value = toLegislacao_id(); + break; + case HsLegislacaoEmpresa.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case HsLegislacaoEmpresa.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX: + value = this.legislacao_id; + break; + case HsLegislacaoEmpresa.TO_LEGISLACAO_ID_INDEX: + value = this.to_legislacao_id; + break; + case HsLegislacaoEmpresa.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case HsLegislacaoEmpresa.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX: + setLegislacao_id( ( Integer ) value ); + break; + case HsLegislacaoEmpresa.TO_LEGISLACAO_ID_INDEX: + setToLegislacao_id( ( db.data.siprp_local.outer.HsLegislacaoData ) value ); + break; + case HsLegislacaoEmpresa.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case HsLegislacaoEmpresa.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX: + this.legislacao_id = ( Integer ) value; + break; + case HsLegislacaoEmpresa.TO_LEGISLACAO_ID_INDEX: + this.to_legislacao_id = ( db.data.siprp_local.outer.HsLegislacaoData ) value; + break; + case HsLegislacaoEmpresa.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case HsLegislacaoEmpresa.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsLegislacaoEmpresa is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsLegislacaoEmpresa.LEGISLACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacaoEmpresa.TO_LEGISLACAO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsLegislacaoData.class; + break; + case HsLegislacaoEmpresa.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacaoEmpresa.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsLegislacaoEmpresa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsLegislacaoEmpresa.PK_FIELD_NAMES ); + primaryKey.set( 0, getLegislacao_id() ); + primaryKey.set( 1, getEmpresa_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoEstabelecimento.java new file mode 100644 index 00000000..6fa4757e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsLegislacaoEstabelecimento.java @@ -0,0 +1,431 @@ +/* +* HsLegislacaoEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsLegislacaoEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsLegislacaoEstabelecimento.CLASS_IDENTIFIER, HsLegislacaoEstabelecimento.LEGISLACAO_ID, HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.LEGISLACAO_ID, HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.LEGISLACAO_ID_FULL, HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID, HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsLegislacaoEstabelecimento.CLASS_IDENTIFIER, HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID, HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID, HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_FULL, HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID, HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.ORDEM, HsLegislacaoEstabelecimento.ORDEM_INDEX ); + FIELD_INDEXES.put( HsLegislacaoEstabelecimento.ORDEM_FULL, HsLegislacaoEstabelecimento.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeylegislacao_idTohs_legislacao = + new com.evolute.entity.ForeignKey( HsLegislacaoEstabelecimento.class, HsLegislacaoEstabelecimento.LEGISLACAO_ID, db.data.siprp_local.outer.HsLegislacaoData.class, db.data.siprp_local.outer.HsLegislacaoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( HsLegislacaoEstabelecimento.class, HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "hs_legislacao_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_legislacao_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String LEGISLACAO_ID = "legislacao_id"; + public static final String LEGISLACAO_ID_FULL = "hs_legislacao_estabelecimento.legislacao_id"; + public static final int LEGISLACAO_ID_INDEX = 0; + public static final String TO_LEGISLACAO_ID = "to_legislacao_id"; + public static final String TO_LEGISLACAO_ID_FULL = "hs_legislacao_estabelecimento.to_legislacao_id"; + public static final int TO_LEGISLACAO_ID_INDEX = 1; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "hs_legislacao_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 2; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "hs_legislacao_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 3; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "hs_legislacao_estabelecimento.ordem"; + public static final int ORDEM_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + LEGISLACAO_ID, ESTABELECIMENTO_ID, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + LEGISLACAO_ID, ESTABELECIMENTO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + LEGISLACAO_ID, ESTABELECIMENTO_ID, ORDEM, }; + + private Integer legislacao_id; + private db.data.siprp_local.outer.HsLegislacaoData to_legislacao_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsLegislacaoEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getLegislacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LEGISLACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.legislacao_id; + } + + public void setLegislacao_id( Integer legislacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( LEGISLACAO_ID, legislacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.legislacao_id = legislacao_id; + LAZY_LOADED_OBJECTS.put( LEGISLACAO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsLegislacaoData toLegislacao_id() + { + try + { + prepare( TO_LEGISLACAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_legislacao_id; + } + + public void setToLegislacao_id( db.data.siprp_local.outer.HsLegislacaoData to_legislacao_id ) + { + try + { + preProcess( TO_LEGISLACAO_ID, to_legislacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_legislacao_id = to_legislacao_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX: + value = getLegislacao_id(); + break; + case HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID_INDEX: + value = toLegislacao_id(); + break; + case HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case HsLegislacaoEstabelecimento.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX: + value = this.legislacao_id; + break; + case HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID_INDEX: + value = this.to_legislacao_id; + break; + case HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case HsLegislacaoEstabelecimento.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX: + setLegislacao_id( ( Integer ) value ); + break; + case HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID_INDEX: + setToLegislacao_id( ( db.data.siprp_local.outer.HsLegislacaoData ) value ); + break; + case HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + case HsLegislacaoEstabelecimento.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX: + this.legislacao_id = ( Integer ) value; + break; + case HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID_INDEX: + this.to_legislacao_id = ( db.data.siprp_local.outer.HsLegislacaoData ) value; + break; + case HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + case HsLegislacaoEstabelecimento.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsLegislacaoEstabelecimento is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsLegislacaoEstabelecimento.LEGISLACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacaoEstabelecimento.TO_LEGISLACAO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsLegislacaoData.class; + break; + case HsLegislacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case HsLegislacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + case HsLegislacaoEstabelecimento.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsLegislacaoEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsLegislacaoEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, getLegislacao_id() ); + primaryKey.set( 1, getEstabelecimento_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsMedida.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsMedida.java new file mode 100644 index 00000000..7a7465e3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsMedida.java @@ -0,0 +1,409 @@ +/* +* HsMedida.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsMedida extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsMedida.ID, HsMedida.ID_INDEX ); + FIELD_INDEXES.put( HsMedida.ID_FULL, HsMedida.ID_INDEX ); + FIELD_INDEXES.put( HsMedida.DESCRIPTION, HsMedida.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsMedida.DESCRIPTION_FULL, HsMedida.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsMedida.REQUESITOS_LEGAIS, HsMedida.REQUESITOS_LEGAIS_INDEX ); + FIELD_INDEXES.put( HsMedida.REQUESITOS_LEGAIS_FULL, HsMedida.REQUESITOS_LEGAIS_INDEX ); + FIELD_INDEXES.put( HsMedida.DELETED_DATE, HsMedida.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsMedida.DELETED_DATE_FULL, HsMedida.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_medida"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_medida"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_medida.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_medida.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String REQUESITOS_LEGAIS = "requesitos_legais"; + public static final String REQUESITOS_LEGAIS_FULL = "hs_medida.requesitos_legais"; + public static final int REQUESITOS_LEGAIS_INDEX = 2; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_medida.deleted_date"; + public static final int DELETED_DATE_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, REQUESITOS_LEGAIS, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + REQUESITOS_LEGAIS, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, REQUESITOS_LEGAIS, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, REQUESITOS_LEGAIS, DELETED_DATE, }; + + private Integer id; + private String description; + private String requesitos_legais; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsMedida() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsPostoMedida_medida_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoMedidaData.class , getPrimaryKey().getMap().get("id"), "medida_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRiscoMedida_medida_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRiscoMedidaData.class , getPrimaryKey().getMap().get("id"), "medida_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public String getRequesitos_legais() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REQUESITOS_LEGAIS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.requesitos_legais; + } + + public void setRequesitos_legais( String requesitos_legais ) + { + try + { + setLockedForRefresh( true ); + preProcess( REQUESITOS_LEGAIS, requesitos_legais ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.requesitos_legais = requesitos_legais; + LAZY_LOADED_OBJECTS.put( REQUESITOS_LEGAIS, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsMedida.ID_INDEX: + value = getId(); + break; + case HsMedida.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsMedida.REQUESITOS_LEGAIS_INDEX: + value = getRequesitos_legais(); + break; + case HsMedida.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsMedida.ID_INDEX: + value = this.id; + break; + case HsMedida.DESCRIPTION_INDEX: + value = this.description; + break; + case HsMedida.REQUESITOS_LEGAIS_INDEX: + value = this.requesitos_legais; + break; + case HsMedida.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsMedida.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsMedida.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsMedida.REQUESITOS_LEGAIS_INDEX: + setRequesitos_legais( ( String ) value ); + break; + case HsMedida.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsMedida.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsMedida.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsMedida.REQUESITOS_LEGAIS_INDEX: + this.requesitos_legais = ( String ) value; + break; + case HsMedida.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsMedida.ID_INDEX: + theClass = Integer.class; + break; + case HsMedida.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsMedida.REQUESITOS_LEGAIS_INDEX: + theClass = String.class; + break; + case HsMedida.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsMedida._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsMedida.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacao.java new file mode 100644 index 00000000..c031851d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacao.java @@ -0,0 +1,459 @@ +/* +* HsNormalizacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsNormalizacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsNormalizacao.ID, HsNormalizacao.ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.ID_FULL, HsNormalizacao.ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.CODIGO, HsNormalizacao.CODIGO_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.CODIGO_FULL, HsNormalizacao.CODIGO_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.DESCRICAO, HsNormalizacao.DESCRICAO_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.DESCRICAO_FULL, HsNormalizacao.DESCRICAO_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.PORTUGUESA, HsNormalizacao.PORTUGUESA_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.PORTUGUESA_FULL, HsNormalizacao.PORTUGUESA_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.DELETED_DATE, HsNormalizacao.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsNormalizacao.DELETED_DATE_FULL, HsNormalizacao.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_normalizacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_normalizacao"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_normalizacao.id"; + public static final int ID_INDEX = 0; + public static final String CODIGO = "codigo"; + public static final String CODIGO_FULL = "hs_normalizacao.codigo"; + public static final int CODIGO_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "hs_normalizacao.descricao"; + public static final int DESCRICAO_INDEX = 2; + public static final String PORTUGUESA = "portuguesa"; + public static final String PORTUGUESA_FULL = "hs_normalizacao.portuguesa"; + public static final int PORTUGUESA_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_normalizacao.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + CODIGO, DESCRICAO, PORTUGUESA, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CODIGO, TABLENAME + "." + DESCRICAO, TABLENAME + "." + PORTUGUESA, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, CODIGO, DESCRICAO, PORTUGUESA, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, CODIGO, DESCRICAO, PORTUGUESA, DELETED_DATE, }; + + private Integer id; + private String codigo; + private String descricao; + private Boolean portuguesa; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsNormalizacao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsNormalizacaoEmpresa_normalizacao_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsNormalizacaoEmpresaData.class , getPrimaryKey().getMap().get("id"), "normalizacao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsNormalizacaoEstabelecimento_normalizacao_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsNormalizacaoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "normalizacao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getCodigo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo; + } + + public void setCodigo( String codigo ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO, codigo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo = codigo; + LAZY_LOADED_OBJECTS.put( CODIGO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Boolean getPortuguesa() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PORTUGUESA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.portuguesa; + } + + public void setPortuguesa( Boolean portuguesa ) + { + try + { + setLockedForRefresh( true ); + preProcess( PORTUGUESA, portuguesa ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.portuguesa = portuguesa; + LAZY_LOADED_OBJECTS.put( PORTUGUESA, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacao.ID_INDEX: + value = getId(); + break; + case HsNormalizacao.CODIGO_INDEX: + value = getCodigo(); + break; + case HsNormalizacao.DESCRICAO_INDEX: + value = getDescricao(); + break; + case HsNormalizacao.PORTUGUESA_INDEX: + value = getPortuguesa(); + break; + case HsNormalizacao.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacao.ID_INDEX: + value = this.id; + break; + case HsNormalizacao.CODIGO_INDEX: + value = this.codigo; + break; + case HsNormalizacao.DESCRICAO_INDEX: + value = this.descricao; + break; + case HsNormalizacao.PORTUGUESA_INDEX: + value = this.portuguesa; + break; + case HsNormalizacao.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacao.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsNormalizacao.CODIGO_INDEX: + setCodigo( ( String ) value ); + break; + case HsNormalizacao.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case HsNormalizacao.PORTUGUESA_INDEX: + setPortuguesa( ( Boolean ) value ); + break; + case HsNormalizacao.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacao.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsNormalizacao.CODIGO_INDEX: + this.codigo = ( String ) value; + break; + case HsNormalizacao.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case HsNormalizacao.PORTUGUESA_INDEX: + this.portuguesa = ( Boolean ) value; + break; + case HsNormalizacao.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsNormalizacao.ID_INDEX: + theClass = Integer.class; + break; + case HsNormalizacao.CODIGO_INDEX: + theClass = String.class; + break; + case HsNormalizacao.DESCRICAO_INDEX: + theClass = String.class; + break; + case HsNormalizacao.PORTUGUESA_INDEX: + theClass = Boolean.class; + break; + case HsNormalizacao.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsNormalizacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsNormalizacao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacaoEmpresa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacaoEmpresa.java new file mode 100644 index 00000000..02f17fb3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacaoEmpresa.java @@ -0,0 +1,381 @@ +/* +* HsNormalizacaoEmpresa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsNormalizacaoEmpresa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsNormalizacaoEmpresa.CLASS_IDENTIFIER, HsNormalizacaoEmpresa.NORMALIZACAO_ID, HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID ); + FIELD_INDEXES.put( HsNormalizacaoEmpresa.NORMALIZACAO_ID, HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEmpresa.NORMALIZACAO_ID_FULL, HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID, HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsNormalizacaoEmpresa.CLASS_IDENTIFIER, HsNormalizacaoEmpresa.EMPRESA_ID, HsNormalizacaoEmpresa.TO_EMPRESA_ID ); + FIELD_INDEXES.put( HsNormalizacaoEmpresa.EMPRESA_ID, HsNormalizacaoEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEmpresa.EMPRESA_ID_FULL, HsNormalizacaoEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEmpresa.TO_EMPRESA_ID, HsNormalizacaoEmpresa.TO_EMPRESA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeynormalizacao_idTohs_normalizacao = + new com.evolute.entity.ForeignKey( HsNormalizacaoEmpresa.class, HsNormalizacaoEmpresa.NORMALIZACAO_ID, db.data.siprp_local.outer.HsNormalizacaoData.class, db.data.siprp_local.outer.HsNormalizacaoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( HsNormalizacaoEmpresa.class, HsNormalizacaoEmpresa.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "hs_normalizacao_empresa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_normalizacao_empresa"; + + public static final int _INVALID__INDEX = -1; + public static final String NORMALIZACAO_ID = "normalizacao_id"; + public static final String NORMALIZACAO_ID_FULL = "hs_normalizacao_empresa.normalizacao_id"; + public static final int NORMALIZACAO_ID_INDEX = 0; + public static final String TO_NORMALIZACAO_ID = "to_normalizacao_id"; + public static final String TO_NORMALIZACAO_ID_FULL = "hs_normalizacao_empresa.to_normalizacao_id"; + public static final int TO_NORMALIZACAO_ID_INDEX = 1; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "hs_normalizacao_empresa.empresa_id"; + public static final int EMPRESA_ID_INDEX = 2; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "hs_normalizacao_empresa.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + NORMALIZACAO_ID, EMPRESA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + NORMALIZACAO_ID, EMPRESA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + NORMALIZACAO_ID, EMPRESA_ID, }; + + private Integer normalizacao_id; + private db.data.siprp_local.outer.HsNormalizacaoData to_normalizacao_id; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsNormalizacaoEmpresa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getNormalizacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NORMALIZACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.normalizacao_id; + } + + public void setNormalizacao_id( Integer normalizacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( NORMALIZACAO_ID, normalizacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.normalizacao_id = normalizacao_id; + LAZY_LOADED_OBJECTS.put( NORMALIZACAO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsNormalizacaoData toNormalizacao_id() + { + try + { + prepare( TO_NORMALIZACAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_normalizacao_id; + } + + public void setToNormalizacao_id( db.data.siprp_local.outer.HsNormalizacaoData to_normalizacao_id ) + { + try + { + preProcess( TO_NORMALIZACAO_ID, to_normalizacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_normalizacao_id = to_normalizacao_id; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX: + value = getNormalizacao_id(); + break; + case HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID_INDEX: + value = toNormalizacao_id(); + break; + case HsNormalizacaoEmpresa.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case HsNormalizacaoEmpresa.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX: + value = this.normalizacao_id; + break; + case HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID_INDEX: + value = this.to_normalizacao_id; + break; + case HsNormalizacaoEmpresa.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case HsNormalizacaoEmpresa.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX: + setNormalizacao_id( ( Integer ) value ); + break; + case HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID_INDEX: + setToNormalizacao_id( ( db.data.siprp_local.outer.HsNormalizacaoData ) value ); + break; + case HsNormalizacaoEmpresa.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case HsNormalizacaoEmpresa.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX: + this.normalizacao_id = ( Integer ) value; + break; + case HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID_INDEX: + this.to_normalizacao_id = ( db.data.siprp_local.outer.HsNormalizacaoData ) value; + break; + case HsNormalizacaoEmpresa.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case HsNormalizacaoEmpresa.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsNormalizacaoEmpresa is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsNormalizacaoEmpresa.NORMALIZACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsNormalizacaoEmpresa.TO_NORMALIZACAO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsNormalizacaoData.class; + break; + case HsNormalizacaoEmpresa.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case HsNormalizacaoEmpresa.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsNormalizacaoEmpresa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsNormalizacaoEmpresa.PK_FIELD_NAMES ); + primaryKey.set( 0, getNormalizacao_id() ); + primaryKey.set( 1, getEmpresa_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacaoEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacaoEstabelecimento.java new file mode 100644 index 00000000..3335fd46 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsNormalizacaoEstabelecimento.java @@ -0,0 +1,381 @@ +/* +* HsNormalizacaoEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsNormalizacaoEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsNormalizacaoEstabelecimento.CLASS_IDENTIFIER, HsNormalizacaoEstabelecimento.NORMALIZACAO_ID, HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID ); + FIELD_INDEXES.put( HsNormalizacaoEstabelecimento.NORMALIZACAO_ID, HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_FULL, HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID, HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsNormalizacaoEstabelecimento.CLASS_IDENTIFIER, HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID, HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID, HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_FULL, HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID, HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeynormalizacao_idTohs_normalizacao = + new com.evolute.entity.ForeignKey( HsNormalizacaoEstabelecimento.class, HsNormalizacaoEstabelecimento.NORMALIZACAO_ID, db.data.siprp_local.outer.HsNormalizacaoData.class, db.data.siprp_local.outer.HsNormalizacaoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( HsNormalizacaoEstabelecimento.class, HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "hs_normalizacao_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_normalizacao_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String NORMALIZACAO_ID = "normalizacao_id"; + public static final String NORMALIZACAO_ID_FULL = "hs_normalizacao_estabelecimento.normalizacao_id"; + public static final int NORMALIZACAO_ID_INDEX = 0; + public static final String TO_NORMALIZACAO_ID = "to_normalizacao_id"; + public static final String TO_NORMALIZACAO_ID_FULL = "hs_normalizacao_estabelecimento.to_normalizacao_id"; + public static final int TO_NORMALIZACAO_ID_INDEX = 1; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "hs_normalizacao_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 2; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "hs_normalizacao_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + NORMALIZACAO_ID, ESTABELECIMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + NORMALIZACAO_ID, ESTABELECIMENTO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + NORMALIZACAO_ID, ESTABELECIMENTO_ID, }; + + private Integer normalizacao_id; + private db.data.siprp_local.outer.HsNormalizacaoData to_normalizacao_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsNormalizacaoEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getNormalizacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NORMALIZACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.normalizacao_id; + } + + public void setNormalizacao_id( Integer normalizacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( NORMALIZACAO_ID, normalizacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.normalizacao_id = normalizacao_id; + LAZY_LOADED_OBJECTS.put( NORMALIZACAO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsNormalizacaoData toNormalizacao_id() + { + try + { + prepare( TO_NORMALIZACAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_normalizacao_id; + } + + public void setToNormalizacao_id( db.data.siprp_local.outer.HsNormalizacaoData to_normalizacao_id ) + { + try + { + preProcess( TO_NORMALIZACAO_ID, to_normalizacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_normalizacao_id = to_normalizacao_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX: + value = getNormalizacao_id(); + break; + case HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID_INDEX: + value = toNormalizacao_id(); + break; + case HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX: + value = this.normalizacao_id; + break; + case HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID_INDEX: + value = this.to_normalizacao_id; + break; + case HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX: + setNormalizacao_id( ( Integer ) value ); + break; + case HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID_INDEX: + setToNormalizacao_id( ( db.data.siprp_local.outer.HsNormalizacaoData ) value ); + break; + case HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX: + this.normalizacao_id = ( Integer ) value; + break; + case HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID_INDEX: + this.to_normalizacao_id = ( db.data.siprp_local.outer.HsNormalizacaoData ) value; + break; + case HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsNormalizacaoEstabelecimento is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsNormalizacaoEstabelecimento.NORMALIZACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsNormalizacaoEstabelecimento.TO_NORMALIZACAO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsNormalizacaoData.class; + break; + case HsNormalizacaoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case HsNormalizacaoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsNormalizacaoEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsNormalizacaoEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, getNormalizacao_id() ); + primaryKey.set( 1, getEstabelecimento_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPosto.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPosto.java new file mode 100644 index 00000000..532075e0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPosto.java @@ -0,0 +1,523 @@ +/* +* HsPosto.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsPosto extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsPosto.ID, HsPosto.ID_INDEX ); + FIELD_INDEXES.put( HsPosto.ID_FULL, HsPosto.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsPosto.CLASS_IDENTIFIER, HsPosto.AREA_ID, HsPosto.TO_AREA_ID ); + FIELD_INDEXES.put( HsPosto.AREA_ID, HsPosto.AREA_ID_INDEX ); + FIELD_INDEXES.put( HsPosto.AREA_ID_FULL, HsPosto.AREA_ID_INDEX ); + FIELD_INDEXES.put( HsPosto.TO_AREA_ID, HsPosto.TO_AREA_ID_INDEX ); + FIELD_INDEXES.put( HsPosto.DESCRIPTION, HsPosto.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsPosto.DESCRIPTION_FULL, HsPosto.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsPosto.DELETED_DATE, HsPosto.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsPosto.DELETED_DATE_FULL, HsPosto.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsPosto.IS_PRINCIPAL, HsPosto.IS_PRINCIPAL_INDEX ); + FIELD_INDEXES.put( HsPosto.IS_PRINCIPAL_FULL, HsPosto.IS_PRINCIPAL_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyarea_idTohs_area = + new com.evolute.entity.ForeignKey( HsPosto.class, HsPosto.AREA_ID, db.data.siprp_local.outer.HsAreaData.class, db.data.siprp_local.outer.HsAreaData.ID ); + + public static final String TABLENAME = "hs_posto"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_posto"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_posto.id"; + public static final int ID_INDEX = 0; + public static final String AREA_ID = "area_id"; + public static final String AREA_ID_FULL = "hs_posto.area_id"; + public static final int AREA_ID_INDEX = 1; + public static final String TO_AREA_ID = "to_area_id"; + public static final String TO_AREA_ID_FULL = "hs_posto.to_area_id"; + public static final int TO_AREA_ID_INDEX = 2; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_posto.description"; + public static final int DESCRIPTION_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_posto.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + public static final String IS_PRINCIPAL = "is_principal"; + public static final String IS_PRINCIPAL_FULL = "hs_posto.is_principal"; + public static final int IS_PRINCIPAL_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + AREA_ID, TO_AREA_ID, DESCRIPTION, DELETED_DATE, IS_PRINCIPAL, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + AREA_ID, TABLENAME + "." + TO_AREA_ID, TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + IS_PRINCIPAL, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, AREA_ID, DESCRIPTION, DELETED_DATE, IS_PRINCIPAL, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, AREA_ID, DESCRIPTION, DELETED_DATE, IS_PRINCIPAL, }; + + private Integer id; + private Integer area_id; + private db.data.siprp_local.outer.HsAreaData to_area_id; + private String description; + private java.sql.Timestamp deleted_date; + private Boolean is_principal; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsPosto() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsPostoEstabelecimento_posto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "posto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsPostoMedida_posto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoMedidaData.class , getPrimaryKey().getMap().get("id"), "posto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsPostoRisco_posto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "posto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getArea_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AREA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.area_id; + } + + public void setArea_id( Integer area_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( AREA_ID, area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.area_id = area_id; + LAZY_LOADED_OBJECTS.put( AREA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsAreaData toArea_id() + { + try + { + prepare( TO_AREA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_area_id; + } + + public void setToArea_id( db.data.siprp_local.outer.HsAreaData to_area_id ) + { + try + { + preProcess( TO_AREA_ID, to_area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_area_id = to_area_id; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Boolean getIs_principal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PRINCIPAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_principal; + } + + public void setIs_principal( Boolean is_principal ) + { + try + { + setLockedForRefresh( true ); + preProcess( IS_PRINCIPAL, is_principal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_principal = is_principal; + LAZY_LOADED_OBJECTS.put( IS_PRINCIPAL, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPosto.ID_INDEX: + value = getId(); + break; + case HsPosto.AREA_ID_INDEX: + value = getArea_id(); + break; + case HsPosto.TO_AREA_ID_INDEX: + value = toArea_id(); + break; + case HsPosto.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsPosto.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsPosto.IS_PRINCIPAL_INDEX: + value = getIs_principal(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPosto.ID_INDEX: + value = this.id; + break; + case HsPosto.AREA_ID_INDEX: + value = this.area_id; + break; + case HsPosto.TO_AREA_ID_INDEX: + value = this.to_area_id; + break; + case HsPosto.DESCRIPTION_INDEX: + value = this.description; + break; + case HsPosto.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsPosto.IS_PRINCIPAL_INDEX: + value = this.is_principal; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPosto.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsPosto.AREA_ID_INDEX: + setArea_id( ( Integer ) value ); + break; + case HsPosto.TO_AREA_ID_INDEX: + setToArea_id( ( db.data.siprp_local.outer.HsAreaData ) value ); + break; + case HsPosto.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsPosto.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsPosto.IS_PRINCIPAL_INDEX: + setIs_principal( ( Boolean ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPosto.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsPosto.AREA_ID_INDEX: + this.area_id = ( Integer ) value; + break; + case HsPosto.TO_AREA_ID_INDEX: + this.to_area_id = ( db.data.siprp_local.outer.HsAreaData ) value; + break; + case HsPosto.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsPosto.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsPosto.IS_PRINCIPAL_INDEX: + this.is_principal = ( Boolean ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsPosto.ID_INDEX: + theClass = Integer.class; + break; + case HsPosto.AREA_ID_INDEX: + theClass = Integer.class; + break; + case HsPosto.TO_AREA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsAreaData.class; + break; + case HsPosto.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsPosto.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsPosto.IS_PRINCIPAL_INDEX: + theClass = Boolean.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsPosto._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsPosto.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoEstabelecimento.java new file mode 100644 index 00000000..93b4854e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoEstabelecimento.java @@ -0,0 +1,381 @@ +/* +* HsPostoEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsPostoEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsPostoEstabelecimento.CLASS_IDENTIFIER, HsPostoEstabelecimento.POSTO_ID, HsPostoEstabelecimento.TO_POSTO_ID ); + FIELD_INDEXES.put( HsPostoEstabelecimento.POSTO_ID, HsPostoEstabelecimento.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoEstabelecimento.POSTO_ID_FULL, HsPostoEstabelecimento.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoEstabelecimento.TO_POSTO_ID, HsPostoEstabelecimento.TO_POSTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsPostoEstabelecimento.CLASS_IDENTIFIER, HsPostoEstabelecimento.ESTABELECIMENTO_ID, HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( HsPostoEstabelecimento.ESTABELECIMENTO_ID, HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoEstabelecimento.ESTABELECIMENTO_ID_FULL, HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID, HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyposto_idTohs_posto = + new com.evolute.entity.ForeignKey( HsPostoEstabelecimento.class, HsPostoEstabelecimento.POSTO_ID, db.data.siprp_local.outer.HsPostoData.class, db.data.siprp_local.outer.HsPostoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( HsPostoEstabelecimento.class, HsPostoEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final String TABLENAME = "hs_posto_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_posto_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String POSTO_ID = "posto_id"; + public static final String POSTO_ID_FULL = "hs_posto_estabelecimento.posto_id"; + public static final int POSTO_ID_INDEX = 0; + public static final String TO_POSTO_ID = "to_posto_id"; + public static final String TO_POSTO_ID_FULL = "hs_posto_estabelecimento.to_posto_id"; + public static final int TO_POSTO_ID_INDEX = 1; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "hs_posto_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 2; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "hs_posto_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + POSTO_ID, ESTABELECIMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + POSTO_ID, ESTABELECIMENTO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + POSTO_ID, ESTABELECIMENTO_ID, }; + + private Integer posto_id; + private db.data.siprp_local.outer.HsPostoData to_posto_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsPostoEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getPosto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.posto_id; + } + + public void setPosto_id( Integer posto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( POSTO_ID, posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.posto_id = posto_id; + LAZY_LOADED_OBJECTS.put( POSTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsPostoData toPosto_id() + { + try + { + prepare( TO_POSTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_posto_id; + } + + public void setToPosto_id( db.data.siprp_local.outer.HsPostoData to_posto_id ) + { + try + { + preProcess( TO_POSTO_ID, to_posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_posto_id = to_posto_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoEstabelecimento.POSTO_ID_INDEX: + value = getPosto_id(); + break; + case HsPostoEstabelecimento.TO_POSTO_ID_INDEX: + value = toPosto_id(); + break; + case HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoEstabelecimento.POSTO_ID_INDEX: + value = this.posto_id; + break; + case HsPostoEstabelecimento.TO_POSTO_ID_INDEX: + value = this.to_posto_id; + break; + case HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoEstabelecimento.POSTO_ID_INDEX: + setPosto_id( ( Integer ) value ); + break; + case HsPostoEstabelecimento.TO_POSTO_ID_INDEX: + setToPosto_id( ( db.data.siprp_local.outer.HsPostoData ) value ); + break; + case HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoEstabelecimento.POSTO_ID_INDEX: + this.posto_id = ( Integer ) value; + break; + case HsPostoEstabelecimento.TO_POSTO_ID_INDEX: + this.to_posto_id = ( db.data.siprp_local.outer.HsPostoData ) value; + break; + case HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsPostoEstabelecimento is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsPostoEstabelecimento.POSTO_ID_INDEX: + theClass = Integer.class; + break; + case HsPostoEstabelecimento.TO_POSTO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsPostoData.class; + break; + case HsPostoEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case HsPostoEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsPostoEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsPostoEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, getPosto_id() ); + primaryKey.set( 1, getEstabelecimento_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoMedida.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoMedida.java new file mode 100644 index 00000000..1a602619 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoMedida.java @@ -0,0 +1,381 @@ +/* +* HsPostoMedida.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsPostoMedida extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsPostoMedida.CLASS_IDENTIFIER, HsPostoMedida.POSTO_ID, HsPostoMedida.TO_POSTO_ID ); + FIELD_INDEXES.put( HsPostoMedida.POSTO_ID, HsPostoMedida.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoMedida.POSTO_ID_FULL, HsPostoMedida.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoMedida.TO_POSTO_ID, HsPostoMedida.TO_POSTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsPostoMedida.CLASS_IDENTIFIER, HsPostoMedida.MEDIDA_ID, HsPostoMedida.TO_MEDIDA_ID ); + FIELD_INDEXES.put( HsPostoMedida.MEDIDA_ID, HsPostoMedida.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsPostoMedida.MEDIDA_ID_FULL, HsPostoMedida.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsPostoMedida.TO_MEDIDA_ID, HsPostoMedida.TO_MEDIDA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyposto_idTohs_posto = + new com.evolute.entity.ForeignKey( HsPostoMedida.class, HsPostoMedida.POSTO_ID, db.data.siprp_local.outer.HsPostoData.class, db.data.siprp_local.outer.HsPostoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymedida_idTohs_medida = + new com.evolute.entity.ForeignKey( HsPostoMedida.class, HsPostoMedida.MEDIDA_ID, db.data.siprp_local.outer.HsMedidaData.class, db.data.siprp_local.outer.HsMedidaData.ID ); + + public static final String TABLENAME = "hs_posto_medida"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_posto_medida"; + + public static final int _INVALID__INDEX = -1; + public static final String POSTO_ID = "posto_id"; + public static final String POSTO_ID_FULL = "hs_posto_medida.posto_id"; + public static final int POSTO_ID_INDEX = 0; + public static final String TO_POSTO_ID = "to_posto_id"; + public static final String TO_POSTO_ID_FULL = "hs_posto_medida.to_posto_id"; + public static final int TO_POSTO_ID_INDEX = 1; + public static final String MEDIDA_ID = "medida_id"; + public static final String MEDIDA_ID_FULL = "hs_posto_medida.medida_id"; + public static final int MEDIDA_ID_INDEX = 2; + public static final String TO_MEDIDA_ID = "to_medida_id"; + public static final String TO_MEDIDA_ID_FULL = "hs_posto_medida.to_medida_id"; + public static final int TO_MEDIDA_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + POSTO_ID, MEDIDA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + POSTO_ID, MEDIDA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + POSTO_ID, MEDIDA_ID, }; + + private Integer posto_id; + private db.data.siprp_local.outer.HsPostoData to_posto_id; + private Integer medida_id; + private db.data.siprp_local.outer.HsMedidaData to_medida_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsPostoMedida() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getPosto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.posto_id; + } + + public void setPosto_id( Integer posto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( POSTO_ID, posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.posto_id = posto_id; + LAZY_LOADED_OBJECTS.put( POSTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsPostoData toPosto_id() + { + try + { + prepare( TO_POSTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_posto_id; + } + + public void setToPosto_id( db.data.siprp_local.outer.HsPostoData to_posto_id ) + { + try + { + preProcess( TO_POSTO_ID, to_posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_posto_id = to_posto_id; + } + + public Integer getMedida_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDIDA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medida_id; + } + + public void setMedida_id( Integer medida_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MEDIDA_ID, medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medida_id = medida_id; + LAZY_LOADED_OBJECTS.put( MEDIDA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsMedidaData toMedida_id() + { + try + { + prepare( TO_MEDIDA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medida_id; + } + + public void setToMedida_id( db.data.siprp_local.outer.HsMedidaData to_medida_id ) + { + try + { + preProcess( TO_MEDIDA_ID, to_medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medida_id = to_medida_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoMedida.POSTO_ID_INDEX: + value = getPosto_id(); + break; + case HsPostoMedida.TO_POSTO_ID_INDEX: + value = toPosto_id(); + break; + case HsPostoMedida.MEDIDA_ID_INDEX: + value = getMedida_id(); + break; + case HsPostoMedida.TO_MEDIDA_ID_INDEX: + value = toMedida_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoMedida.POSTO_ID_INDEX: + value = this.posto_id; + break; + case HsPostoMedida.TO_POSTO_ID_INDEX: + value = this.to_posto_id; + break; + case HsPostoMedida.MEDIDA_ID_INDEX: + value = this.medida_id; + break; + case HsPostoMedida.TO_MEDIDA_ID_INDEX: + value = this.to_medida_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoMedida.POSTO_ID_INDEX: + setPosto_id( ( Integer ) value ); + break; + case HsPostoMedida.TO_POSTO_ID_INDEX: + setToPosto_id( ( db.data.siprp_local.outer.HsPostoData ) value ); + break; + case HsPostoMedida.MEDIDA_ID_INDEX: + setMedida_id( ( Integer ) value ); + break; + case HsPostoMedida.TO_MEDIDA_ID_INDEX: + setToMedida_id( ( db.data.siprp_local.outer.HsMedidaData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoMedida.POSTO_ID_INDEX: + this.posto_id = ( Integer ) value; + break; + case HsPostoMedida.TO_POSTO_ID_INDEX: + this.to_posto_id = ( db.data.siprp_local.outer.HsPostoData ) value; + break; + case HsPostoMedida.MEDIDA_ID_INDEX: + this.medida_id = ( Integer ) value; + break; + case HsPostoMedida.TO_MEDIDA_ID_INDEX: + this.to_medida_id = ( db.data.siprp_local.outer.HsMedidaData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsPostoMedida is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsPostoMedida.POSTO_ID_INDEX: + theClass = Integer.class; + break; + case HsPostoMedida.TO_POSTO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsPostoData.class; + break; + case HsPostoMedida.MEDIDA_ID_INDEX: + theClass = Integer.class; + break; + case HsPostoMedida.TO_MEDIDA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsMedidaData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsPostoMedida._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsPostoMedida.PK_FIELD_NAMES ); + primaryKey.set( 0, getPosto_id() ); + primaryKey.set( 1, getMedida_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoRisco.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoRisco.java new file mode 100644 index 00000000..6463e6f0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsPostoRisco.java @@ -0,0 +1,685 @@ +/* +* HsPostoRisco.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsPostoRisco extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsPostoRisco.CLASS_IDENTIFIER, HsPostoRisco.POSTO_ID, HsPostoRisco.TO_POSTO_ID ); + FIELD_INDEXES.put( HsPostoRisco.POSTO_ID, HsPostoRisco.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.POSTO_ID_FULL, HsPostoRisco.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.TO_POSTO_ID, HsPostoRisco.TO_POSTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsPostoRisco.CLASS_IDENTIFIER, HsPostoRisco.RISCO_ID, HsPostoRisco.TO_RISCO_ID ); + FIELD_INDEXES.put( HsPostoRisco.RISCO_ID, HsPostoRisco.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.RISCO_ID_FULL, HsPostoRisco.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.TO_RISCO_ID, HsPostoRisco.TO_RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.PROBABILIDADE, HsPostoRisco.PROBABILIDADE_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.PROBABILIDADE_FULL, HsPostoRisco.PROBABILIDADE_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.SEVERIDADE, HsPostoRisco.SEVERIDADE_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.SEVERIDADE_FULL, HsPostoRisco.SEVERIDADE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsPostoRisco.CLASS_IDENTIFIER, HsPostoRisco.VALOR_QUALITATIVO, HsPostoRisco.TO_VALOR_QUALITATIVO ); + FIELD_INDEXES.put( HsPostoRisco.VALOR_QUALITATIVO, HsPostoRisco.VALOR_QUALITATIVO_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.VALOR_QUALITATIVO_FULL, HsPostoRisco.VALOR_QUALITATIVO_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.TO_VALOR_QUALITATIVO, HsPostoRisco.TO_VALOR_QUALITATIVO_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.IS_PLANO_ACTUACAO, HsPostoRisco.IS_PLANO_ACTUACAO_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.IS_PLANO_ACTUACAO_FULL, HsPostoRisco.IS_PLANO_ACTUACAO_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.ORDEM, HsPostoRisco.ORDEM_INDEX ); + FIELD_INDEXES.put( HsPostoRisco.ORDEM_FULL, HsPostoRisco.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyposto_idTohs_posto = + new com.evolute.entity.ForeignKey( HsPostoRisco.class, HsPostoRisco.POSTO_ID, db.data.siprp_local.outer.HsPostoData.class, db.data.siprp_local.outer.HsPostoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyrisco_idTohs_risco = + new com.evolute.entity.ForeignKey( HsPostoRisco.class, HsPostoRisco.RISCO_ID, db.data.siprp_local.outer.HsRiscoData.class, db.data.siprp_local.outer.HsRiscoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyvalor_qualitativoTohs_relatorio_risco_valor_qualitativo = + new com.evolute.entity.ForeignKey( HsPostoRisco.class, HsPostoRisco.VALOR_QUALITATIVO, db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData.class, db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData.ID ); + + public static final String TABLENAME = "hs_posto_risco"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_posto_risco"; + + public static final int _INVALID__INDEX = -1; + public static final String POSTO_ID = "posto_id"; + public static final String POSTO_ID_FULL = "hs_posto_risco.posto_id"; + public static final int POSTO_ID_INDEX = 0; + public static final String TO_POSTO_ID = "to_posto_id"; + public static final String TO_POSTO_ID_FULL = "hs_posto_risco.to_posto_id"; + public static final int TO_POSTO_ID_INDEX = 1; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "hs_posto_risco.risco_id"; + public static final int RISCO_ID_INDEX = 2; + public static final String TO_RISCO_ID = "to_risco_id"; + public static final String TO_RISCO_ID_FULL = "hs_posto_risco.to_risco_id"; + public static final int TO_RISCO_ID_INDEX = 3; + public static final String PROBABILIDADE = "probabilidade"; + public static final String PROBABILIDADE_FULL = "hs_posto_risco.probabilidade"; + public static final int PROBABILIDADE_INDEX = 4; + public static final String SEVERIDADE = "severidade"; + public static final String SEVERIDADE_FULL = "hs_posto_risco.severidade"; + public static final int SEVERIDADE_INDEX = 5; + public static final String VALOR_QUALITATIVO = "valor_qualitativo"; + public static final String VALOR_QUALITATIVO_FULL = "hs_posto_risco.valor_qualitativo"; + public static final int VALOR_QUALITATIVO_INDEX = 6; + public static final String TO_VALOR_QUALITATIVO = "to_valor_qualitativo"; + public static final String TO_VALOR_QUALITATIVO_FULL = "hs_posto_risco.to_valor_qualitativo"; + public static final int TO_VALOR_QUALITATIVO_INDEX = 7; + public static final String IS_PLANO_ACTUACAO = "is_plano_actuacao"; + public static final String IS_PLANO_ACTUACAO_FULL = "hs_posto_risco.is_plano_actuacao"; + public static final int IS_PLANO_ACTUACAO_INDEX = 8; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "hs_posto_risco.ordem"; + public static final int ORDEM_INDEX = 9; + + public static final String FIELD_NAMES[] = new String[]{ + PROBABILIDADE, SEVERIDADE, VALOR_QUALITATIVO, TO_VALOR_QUALITATIVO, + IS_PLANO_ACTUACAO, ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PROBABILIDADE, TABLENAME + "." + SEVERIDADE, TABLENAME + "." + VALOR_QUALITATIVO, TABLENAME + "." + TO_VALOR_QUALITATIVO, + TABLENAME + "." + IS_PLANO_ACTUACAO, TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + POSTO_ID, RISCO_ID, PROBABILIDADE, SEVERIDADE, VALOR_QUALITATIVO, + IS_PLANO_ACTUACAO, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + POSTO_ID, RISCO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + POSTO_ID, RISCO_ID, PROBABILIDADE, SEVERIDADE, VALOR_QUALITATIVO, + IS_PLANO_ACTUACAO, ORDEM, }; + + private Integer posto_id; + private db.data.siprp_local.outer.HsPostoData to_posto_id; + private Integer risco_id; + private db.data.siprp_local.outer.HsRiscoData to_risco_id; + private Integer probabilidade; + private Integer severidade; + private Integer valor_qualitativo; + private db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData to_valor_qualitativo; + private String is_plano_actuacao; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsPostoRisco() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false, false, false }; + } + + public Integer getPosto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.posto_id; + } + + public void setPosto_id( Integer posto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( POSTO_ID, posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.posto_id = posto_id; + LAZY_LOADED_OBJECTS.put( POSTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsPostoData toPosto_id() + { + try + { + prepare( TO_POSTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_posto_id; + } + + public void setToPosto_id( db.data.siprp_local.outer.HsPostoData to_posto_id ) + { + try + { + preProcess( TO_POSTO_ID, to_posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_posto_id = to_posto_id; + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRiscoData toRisco_id() + { + try + { + prepare( TO_RISCO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_risco_id; + } + + public void setToRisco_id( db.data.siprp_local.outer.HsRiscoData to_risco_id ) + { + try + { + preProcess( TO_RISCO_ID, to_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_risco_id = to_risco_id; + } + + public Integer getProbabilidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROBABILIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.probabilidade; + } + + public void setProbabilidade( Integer probabilidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROBABILIDADE, probabilidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.probabilidade = probabilidade; + LAZY_LOADED_OBJECTS.put( PROBABILIDADE, Boolean.TRUE ); + } + + public Integer getSeveridade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEVERIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.severidade; + } + + public void setSeveridade( Integer severidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( SEVERIDADE, severidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.severidade = severidade; + LAZY_LOADED_OBJECTS.put( SEVERIDADE, Boolean.TRUE ); + } + + public Integer getValor_qualitativo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR_QUALITATIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor_qualitativo; + } + + public void setValor_qualitativo( Integer valor_qualitativo ) + { + try + { + setLockedForRefresh( true ); + preProcess( VALOR_QUALITATIVO, valor_qualitativo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor_qualitativo = valor_qualitativo; + LAZY_LOADED_OBJECTS.put( VALOR_QUALITATIVO, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData toValor_qualitativo() + { + try + { + prepare( TO_VALOR_QUALITATIVO ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_valor_qualitativo; + } + + public void setToValor_qualitativo( db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData to_valor_qualitativo ) + { + try + { + preProcess( TO_VALOR_QUALITATIVO, to_valor_qualitativo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_valor_qualitativo = to_valor_qualitativo; + } + + public String getIs_plano_actuacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PLANO_ACTUACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_plano_actuacao; + } + + public void setIs_plano_actuacao( String is_plano_actuacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( IS_PLANO_ACTUACAO, is_plano_actuacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_plano_actuacao = is_plano_actuacao; + LAZY_LOADED_OBJECTS.put( IS_PLANO_ACTUACAO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoRisco.POSTO_ID_INDEX: + value = getPosto_id(); + break; + case HsPostoRisco.TO_POSTO_ID_INDEX: + value = toPosto_id(); + break; + case HsPostoRisco.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case HsPostoRisco.TO_RISCO_ID_INDEX: + value = toRisco_id(); + break; + case HsPostoRisco.PROBABILIDADE_INDEX: + value = getProbabilidade(); + break; + case HsPostoRisco.SEVERIDADE_INDEX: + value = getSeveridade(); + break; + case HsPostoRisco.VALOR_QUALITATIVO_INDEX: + value = getValor_qualitativo(); + break; + case HsPostoRisco.TO_VALOR_QUALITATIVO_INDEX: + value = toValor_qualitativo(); + break; + case HsPostoRisco.IS_PLANO_ACTUACAO_INDEX: + value = getIs_plano_actuacao(); + break; + case HsPostoRisco.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoRisco.POSTO_ID_INDEX: + value = this.posto_id; + break; + case HsPostoRisco.TO_POSTO_ID_INDEX: + value = this.to_posto_id; + break; + case HsPostoRisco.RISCO_ID_INDEX: + value = this.risco_id; + break; + case HsPostoRisco.TO_RISCO_ID_INDEX: + value = this.to_risco_id; + break; + case HsPostoRisco.PROBABILIDADE_INDEX: + value = this.probabilidade; + break; + case HsPostoRisco.SEVERIDADE_INDEX: + value = this.severidade; + break; + case HsPostoRisco.VALOR_QUALITATIVO_INDEX: + value = this.valor_qualitativo; + break; + case HsPostoRisco.TO_VALOR_QUALITATIVO_INDEX: + value = this.to_valor_qualitativo; + break; + case HsPostoRisco.IS_PLANO_ACTUACAO_INDEX: + value = this.is_plano_actuacao; + break; + case HsPostoRisco.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoRisco.POSTO_ID_INDEX: + setPosto_id( ( Integer ) value ); + break; + case HsPostoRisco.TO_POSTO_ID_INDEX: + setToPosto_id( ( db.data.siprp_local.outer.HsPostoData ) value ); + break; + case HsPostoRisco.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case HsPostoRisco.TO_RISCO_ID_INDEX: + setToRisco_id( ( db.data.siprp_local.outer.HsRiscoData ) value ); + break; + case HsPostoRisco.PROBABILIDADE_INDEX: + setProbabilidade( ( Integer ) value ); + break; + case HsPostoRisco.SEVERIDADE_INDEX: + setSeveridade( ( Integer ) value ); + break; + case HsPostoRisco.VALOR_QUALITATIVO_INDEX: + setValor_qualitativo( ( Integer ) value ); + break; + case HsPostoRisco.TO_VALOR_QUALITATIVO_INDEX: + setToValor_qualitativo( ( db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData ) value ); + break; + case HsPostoRisco.IS_PLANO_ACTUACAO_INDEX: + setIs_plano_actuacao( ( String ) value ); + break; + case HsPostoRisco.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsPostoRisco.POSTO_ID_INDEX: + this.posto_id = ( Integer ) value; + break; + case HsPostoRisco.TO_POSTO_ID_INDEX: + this.to_posto_id = ( db.data.siprp_local.outer.HsPostoData ) value; + break; + case HsPostoRisco.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case HsPostoRisco.TO_RISCO_ID_INDEX: + this.to_risco_id = ( db.data.siprp_local.outer.HsRiscoData ) value; + break; + case HsPostoRisco.PROBABILIDADE_INDEX: + this.probabilidade = ( Integer ) value; + break; + case HsPostoRisco.SEVERIDADE_INDEX: + this.severidade = ( Integer ) value; + break; + case HsPostoRisco.VALOR_QUALITATIVO_INDEX: + this.valor_qualitativo = ( Integer ) value; + break; + case HsPostoRisco.TO_VALOR_QUALITATIVO_INDEX: + this.to_valor_qualitativo = ( db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData ) value; + break; + case HsPostoRisco.IS_PLANO_ACTUACAO_INDEX: + this.is_plano_actuacao = ( String ) value; + break; + case HsPostoRisco.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsPostoRisco is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsPostoRisco.POSTO_ID_INDEX: + theClass = Integer.class; + break; + case HsPostoRisco.TO_POSTO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsPostoData.class; + break; + case HsPostoRisco.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case HsPostoRisco.TO_RISCO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRiscoData.class; + break; + case HsPostoRisco.PROBABILIDADE_INDEX: + theClass = Integer.class; + break; + case HsPostoRisco.SEVERIDADE_INDEX: + theClass = Integer.class; + break; + case HsPostoRisco.VALOR_QUALITATIVO_INDEX: + theClass = Integer.class; + break; + case HsPostoRisco.TO_VALOR_QUALITATIVO_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData.class; + break; + case HsPostoRisco.IS_PLANO_ACTUACAO_INDEX: + theClass = String.class; + break; + case HsPostoRisco.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsPostoRisco._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsPostoRisco.PK_FIELD_NAMES ); + primaryKey.set( 0, getPosto_id() ); + primaryKey.set( 1, getRisco_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorio.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorio.java new file mode 100644 index 00000000..d76381b9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorio.java @@ -0,0 +1,960 @@ +/* +* HsRelatorio.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorio extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRelatorio.ID, HsRelatorio.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ID_FULL, HsRelatorio.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorio.DATA, HsRelatorio.DATA_INDEX ); + FIELD_INDEXES.put( HsRelatorio.DATA_FULL, HsRelatorio.DATA_INDEX ); + FIELD_INDEXES.put( HsRelatorio.DELETED_DATE, HsRelatorio.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorio.DELETED_DATE_FULL, HsRelatorio.DELETED_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorio.CLASS_IDENTIFIER, HsRelatorio.MARCACAO_ID, HsRelatorio.TO_MARCACAO_ID ); + FIELD_INDEXES.put( HsRelatorio.MARCACAO_ID, HsRelatorio.MARCACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorio.MARCACAO_ID_FULL, HsRelatorio.MARCACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorio.TO_MARCACAO_ID, HsRelatorio.TO_MARCACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorio.IS_SUBMETIDO, HsRelatorio.IS_SUBMETIDO_INDEX ); + FIELD_INDEXES.put( HsRelatorio.IS_SUBMETIDO_FULL, HsRelatorio.IS_SUBMETIDO_INDEX ); + FIELD_INDEXES.put( HsRelatorio.AVALIACAO_INICIAL, HsRelatorio.AVALIACAO_INICIAL_INDEX ); + FIELD_INDEXES.put( HsRelatorio.AVALIACAO_INICIAL_FULL, HsRelatorio.AVALIACAO_INICIAL_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ACOMPANHANTE1, HsRelatorio.ACOMPANHANTE1_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ACOMPANHANTE1_FULL, HsRelatorio.ACOMPANHANTE1_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCAO_ACOMPANHANTE1, HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCAO_ACOMPANHANTE1_FULL, HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ACOMPANHANTE2, HsRelatorio.ACOMPANHANTE2_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ACOMPANHANTE2_FULL, HsRelatorio.ACOMPANHANTE2_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCAO_ACOMPANHANTE2, HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCAO_ACOMPANHANTE2_FULL, HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ACOMPANHANTE3, HsRelatorio.ACOMPANHANTE3_INDEX ); + FIELD_INDEXES.put( HsRelatorio.ACOMPANHANTE3_FULL, HsRelatorio.ACOMPANHANTE3_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCAO_ACOMPANHANTE3, HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCAO_ACOMPANHANTE3_FULL, HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCIONARIOS, HsRelatorio.FUNCIONARIOS_INDEX ); + FIELD_INDEXES.put( HsRelatorio.FUNCIONARIOS_FULL, HsRelatorio.FUNCIONARIOS_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeymarcacao_idTomarcacoes_estabelecimento = + new com.evolute.entity.ForeignKey( HsRelatorio.class, HsRelatorio.MARCACAO_ID, db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class, db.data.siprp_local.outer.MarcacoesEstabelecimentoData.ID ); + + public static final String TABLENAME = "hs_relatorio"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "hs_relatorio.data"; + public static final int DATA_INDEX = 1; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_relatorio.deleted_date"; + public static final int DELETED_DATE_INDEX = 2; + public static final String MARCACAO_ID = "marcacao_id"; + public static final String MARCACAO_ID_FULL = "hs_relatorio.marcacao_id"; + public static final int MARCACAO_ID_INDEX = 3; + public static final String TO_MARCACAO_ID = "to_marcacao_id"; + public static final String TO_MARCACAO_ID_FULL = "hs_relatorio.to_marcacao_id"; + public static final int TO_MARCACAO_ID_INDEX = 4; + public static final String IS_SUBMETIDO = "is_submetido"; + public static final String IS_SUBMETIDO_FULL = "hs_relatorio.is_submetido"; + public static final int IS_SUBMETIDO_INDEX = 5; + public static final String AVALIACAO_INICIAL = "avaliacao_inicial"; + public static final String AVALIACAO_INICIAL_FULL = "hs_relatorio.avaliacao_inicial"; + public static final int AVALIACAO_INICIAL_INDEX = 6; + public static final String ACOMPANHANTE1 = "acompanhante1"; + public static final String ACOMPANHANTE1_FULL = "hs_relatorio.acompanhante1"; + public static final int ACOMPANHANTE1_INDEX = 7; + public static final String FUNCAO_ACOMPANHANTE1 = "funcao_acompanhante1"; + public static final String FUNCAO_ACOMPANHANTE1_FULL = "hs_relatorio.funcao_acompanhante1"; + public static final int FUNCAO_ACOMPANHANTE1_INDEX = 8; + public static final String ACOMPANHANTE2 = "acompanhante2"; + public static final String ACOMPANHANTE2_FULL = "hs_relatorio.acompanhante2"; + public static final int ACOMPANHANTE2_INDEX = 9; + public static final String FUNCAO_ACOMPANHANTE2 = "funcao_acompanhante2"; + public static final String FUNCAO_ACOMPANHANTE2_FULL = "hs_relatorio.funcao_acompanhante2"; + public static final int FUNCAO_ACOMPANHANTE2_INDEX = 10; + public static final String ACOMPANHANTE3 = "acompanhante3"; + public static final String ACOMPANHANTE3_FULL = "hs_relatorio.acompanhante3"; + public static final int ACOMPANHANTE3_INDEX = 11; + public static final String FUNCAO_ACOMPANHANTE3 = "funcao_acompanhante3"; + public static final String FUNCAO_ACOMPANHANTE3_FULL = "hs_relatorio.funcao_acompanhante3"; + public static final int FUNCAO_ACOMPANHANTE3_INDEX = 12; + public static final String FUNCIONARIOS = "funcionarios"; + public static final String FUNCIONARIOS_FULL = "hs_relatorio.funcionarios"; + public static final int FUNCIONARIOS_INDEX = 13; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, DELETED_DATE, MARCACAO_ID, TO_MARCACAO_ID, IS_SUBMETIDO, AVALIACAO_INICIAL, + ACOMPANHANTE1, FUNCAO_ACOMPANHANTE1, ACOMPANHANTE2, FUNCAO_ACOMPANHANTE2, + ACOMPANHANTE3, FUNCAO_ACOMPANHANTE3, FUNCIONARIOS, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + MARCACAO_ID, TABLENAME + "." + TO_MARCACAO_ID, TABLENAME + "." + IS_SUBMETIDO, TABLENAME + "." + AVALIACAO_INICIAL, + TABLENAME + "." + ACOMPANHANTE1, TABLENAME + "." + FUNCAO_ACOMPANHANTE1, TABLENAME + "." + ACOMPANHANTE2, TABLENAME + "." + FUNCAO_ACOMPANHANTE2, + TABLENAME + "." + ACOMPANHANTE3, TABLENAME + "." + FUNCAO_ACOMPANHANTE3, TABLENAME + "." + FUNCIONARIOS, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, DELETED_DATE, MARCACAO_ID, IS_SUBMETIDO, AVALIACAO_INICIAL, + ACOMPANHANTE1, FUNCAO_ACOMPANHANTE1, ACOMPANHANTE2, FUNCAO_ACOMPANHANTE2, + ACOMPANHANTE3, FUNCAO_ACOMPANHANTE3, FUNCIONARIOS, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, DELETED_DATE, MARCACAO_ID, IS_SUBMETIDO, AVALIACAO_INICIAL, + ACOMPANHANTE1, FUNCAO_ACOMPANHANTE1, ACOMPANHANTE2, FUNCAO_ACOMPANHANTE2, + ACOMPANHANTE3, FUNCAO_ACOMPANHANTE3, FUNCIONARIOS, }; + + private Integer id; + private java.util.Date data; + private java.sql.Timestamp deleted_date; + private Integer marcacao_id; + private db.data.siprp_local.outer.MarcacoesEstabelecimentoData to_marcacao_id; + private java.sql.Timestamp is_submetido; + private Boolean avaliacao_inicial; + private String acompanhante1; + private String funcao_acompanhante1; + private String acompanhante2; + private String funcao_acompanhante2; + private String acompanhante3; + private String funcao_acompanhante3; + private String funcionarios; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorio() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRelatorioArea_relatorio_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioAreaData.class , getPrimaryKey().getMap().get("id"), "relatorio_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioEquipamento_hs_relatorio_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioEquipamentoData.class , getPrimaryKey().getMap().get("id"), "hs_relatorio_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioLegislacao_hs_relatorio_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioLegislacaoData.class , getPrimaryKey().getMap().get("id"), "hs_relatorio_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioNormalizacao_hs_relatorio_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioNormalizacaoData.class , getPrimaryKey().getMap().get("id"), "hs_relatorio_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioRisco_relatorio_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioRiscoData.class , getPrimaryKey().getMap().get("id"), "relatorio_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getMarcacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marcacao_id; + } + + public void setMarcacao_id( Integer marcacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCACAO_ID, marcacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marcacao_id = marcacao_id; + LAZY_LOADED_OBJECTS.put( MARCACAO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesEstabelecimentoData toMarcacao_id() + { + try + { + prepare( TO_MARCACAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_marcacao_id; + } + + public void setToMarcacao_id( db.data.siprp_local.outer.MarcacoesEstabelecimentoData to_marcacao_id ) + { + try + { + preProcess( TO_MARCACAO_ID, to_marcacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_marcacao_id = to_marcacao_id; + } + + public java.sql.Timestamp getIs_submetido() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_SUBMETIDO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_submetido; + } + + public void setIs_submetido( java.sql.Timestamp is_submetido ) + { + try + { + setLockedForRefresh( true ); + preProcess( IS_SUBMETIDO, is_submetido ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_submetido = is_submetido; + LAZY_LOADED_OBJECTS.put( IS_SUBMETIDO, Boolean.TRUE ); + } + + public Boolean getAvaliacao_inicial() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AVALIACAO_INICIAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.avaliacao_inicial; + } + + public void setAvaliacao_inicial( Boolean avaliacao_inicial ) + { + try + { + setLockedForRefresh( true ); + preProcess( AVALIACAO_INICIAL, avaliacao_inicial ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.avaliacao_inicial = avaliacao_inicial; + LAZY_LOADED_OBJECTS.put( AVALIACAO_INICIAL, Boolean.TRUE ); + } + + public String getAcompanhante1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACOMPANHANTE1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.acompanhante1; + } + + public void setAcompanhante1( String acompanhante1 ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACOMPANHANTE1, acompanhante1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.acompanhante1 = acompanhante1; + LAZY_LOADED_OBJECTS.put( ACOMPANHANTE1, Boolean.TRUE ); + } + + public String getFuncao_acompanhante1() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCAO_ACOMPANHANTE1 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcao_acompanhante1; + } + + public void setFuncao_acompanhante1( String funcao_acompanhante1 ) + { + try + { + setLockedForRefresh( true ); + preProcess( FUNCAO_ACOMPANHANTE1, funcao_acompanhante1 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcao_acompanhante1 = funcao_acompanhante1; + LAZY_LOADED_OBJECTS.put( FUNCAO_ACOMPANHANTE1, Boolean.TRUE ); + } + + public String getAcompanhante2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACOMPANHANTE2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.acompanhante2; + } + + public void setAcompanhante2( String acompanhante2 ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACOMPANHANTE2, acompanhante2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.acompanhante2 = acompanhante2; + LAZY_LOADED_OBJECTS.put( ACOMPANHANTE2, Boolean.TRUE ); + } + + public String getFuncao_acompanhante2() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCAO_ACOMPANHANTE2 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcao_acompanhante2; + } + + public void setFuncao_acompanhante2( String funcao_acompanhante2 ) + { + try + { + setLockedForRefresh( true ); + preProcess( FUNCAO_ACOMPANHANTE2, funcao_acompanhante2 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcao_acompanhante2 = funcao_acompanhante2; + LAZY_LOADED_OBJECTS.put( FUNCAO_ACOMPANHANTE2, Boolean.TRUE ); + } + + public String getAcompanhante3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACOMPANHANTE3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.acompanhante3; + } + + public void setAcompanhante3( String acompanhante3 ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACOMPANHANTE3, acompanhante3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.acompanhante3 = acompanhante3; + LAZY_LOADED_OBJECTS.put( ACOMPANHANTE3, Boolean.TRUE ); + } + + public String getFuncao_acompanhante3() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCAO_ACOMPANHANTE3 ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcao_acompanhante3; + } + + public void setFuncao_acompanhante3( String funcao_acompanhante3 ) + { + try + { + setLockedForRefresh( true ); + preProcess( FUNCAO_ACOMPANHANTE3, funcao_acompanhante3 ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcao_acompanhante3 = funcao_acompanhante3; + LAZY_LOADED_OBJECTS.put( FUNCAO_ACOMPANHANTE3, Boolean.TRUE ); + } + + public String getFuncionarios() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCIONARIOS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcionarios; + } + + public void setFuncionarios( String funcionarios ) + { + try + { + setLockedForRefresh( true ); + preProcess( FUNCIONARIOS, funcionarios ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcionarios = funcionarios; + LAZY_LOADED_OBJECTS.put( FUNCIONARIOS, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorio.ID_INDEX: + value = getId(); + break; + case HsRelatorio.DATA_INDEX: + value = getData(); + break; + case HsRelatorio.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsRelatorio.MARCACAO_ID_INDEX: + value = getMarcacao_id(); + break; + case HsRelatorio.TO_MARCACAO_ID_INDEX: + value = toMarcacao_id(); + break; + case HsRelatorio.IS_SUBMETIDO_INDEX: + value = getIs_submetido(); + break; + case HsRelatorio.AVALIACAO_INICIAL_INDEX: + value = getAvaliacao_inicial(); + break; + case HsRelatorio.ACOMPANHANTE1_INDEX: + value = getAcompanhante1(); + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX: + value = getFuncao_acompanhante1(); + break; + case HsRelatorio.ACOMPANHANTE2_INDEX: + value = getAcompanhante2(); + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX: + value = getFuncao_acompanhante2(); + break; + case HsRelatorio.ACOMPANHANTE3_INDEX: + value = getAcompanhante3(); + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX: + value = getFuncao_acompanhante3(); + break; + case HsRelatorio.FUNCIONARIOS_INDEX: + value = getFuncionarios(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorio.ID_INDEX: + value = this.id; + break; + case HsRelatorio.DATA_INDEX: + value = this.data; + break; + case HsRelatorio.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsRelatorio.MARCACAO_ID_INDEX: + value = this.marcacao_id; + break; + case HsRelatorio.TO_MARCACAO_ID_INDEX: + value = this.to_marcacao_id; + break; + case HsRelatorio.IS_SUBMETIDO_INDEX: + value = this.is_submetido; + break; + case HsRelatorio.AVALIACAO_INICIAL_INDEX: + value = this.avaliacao_inicial; + break; + case HsRelatorio.ACOMPANHANTE1_INDEX: + value = this.acompanhante1; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX: + value = this.funcao_acompanhante1; + break; + case HsRelatorio.ACOMPANHANTE2_INDEX: + value = this.acompanhante2; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX: + value = this.funcao_acompanhante2; + break; + case HsRelatorio.ACOMPANHANTE3_INDEX: + value = this.acompanhante3; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX: + value = this.funcao_acompanhante3; + break; + case HsRelatorio.FUNCIONARIOS_INDEX: + value = this.funcionarios; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorio.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorio.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case HsRelatorio.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsRelatorio.MARCACAO_ID_INDEX: + setMarcacao_id( ( Integer ) value ); + break; + case HsRelatorio.TO_MARCACAO_ID_INDEX: + setToMarcacao_id( ( db.data.siprp_local.outer.MarcacoesEstabelecimentoData ) value ); + break; + case HsRelatorio.IS_SUBMETIDO_INDEX: + setIs_submetido( ( java.sql.Timestamp ) value ); + break; + case HsRelatorio.AVALIACAO_INICIAL_INDEX: + setAvaliacao_inicial( ( Boolean ) value ); + break; + case HsRelatorio.ACOMPANHANTE1_INDEX: + setAcompanhante1( ( String ) value ); + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX: + setFuncao_acompanhante1( ( String ) value ); + break; + case HsRelatorio.ACOMPANHANTE2_INDEX: + setAcompanhante2( ( String ) value ); + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX: + setFuncao_acompanhante2( ( String ) value ); + break; + case HsRelatorio.ACOMPANHANTE3_INDEX: + setAcompanhante3( ( String ) value ); + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX: + setFuncao_acompanhante3( ( String ) value ); + break; + case HsRelatorio.FUNCIONARIOS_INDEX: + setFuncionarios( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorio.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorio.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case HsRelatorio.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsRelatorio.MARCACAO_ID_INDEX: + this.marcacao_id = ( Integer ) value; + break; + case HsRelatorio.TO_MARCACAO_ID_INDEX: + this.to_marcacao_id = ( db.data.siprp_local.outer.MarcacoesEstabelecimentoData ) value; + break; + case HsRelatorio.IS_SUBMETIDO_INDEX: + this.is_submetido = ( java.sql.Timestamp ) value; + break; + case HsRelatorio.AVALIACAO_INICIAL_INDEX: + this.avaliacao_inicial = ( Boolean ) value; + break; + case HsRelatorio.ACOMPANHANTE1_INDEX: + this.acompanhante1 = ( String ) value; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX: + this.funcao_acompanhante1 = ( String ) value; + break; + case HsRelatorio.ACOMPANHANTE2_INDEX: + this.acompanhante2 = ( String ) value; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX: + this.funcao_acompanhante2 = ( String ) value; + break; + case HsRelatorio.ACOMPANHANTE3_INDEX: + this.acompanhante3 = ( String ) value; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX: + this.funcao_acompanhante3 = ( String ) value; + break; + case HsRelatorio.FUNCIONARIOS_INDEX: + this.funcionarios = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorio.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorio.DATA_INDEX: + theClass = java.util.Date.class; + break; + case HsRelatorio.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsRelatorio.MARCACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorio.TO_MARCACAO_ID_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class; + break; + case HsRelatorio.IS_SUBMETIDO_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsRelatorio.AVALIACAO_INICIAL_INDEX: + theClass = Boolean.class; + break; + case HsRelatorio.ACOMPANHANTE1_INDEX: + theClass = String.class; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE1_INDEX: + theClass = String.class; + break; + case HsRelatorio.ACOMPANHANTE2_INDEX: + theClass = String.class; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE2_INDEX: + theClass = String.class; + break; + case HsRelatorio.ACOMPANHANTE3_INDEX: + theClass = String.class; + break; + case HsRelatorio.FUNCAO_ACOMPANHANTE3_INDEX: + theClass = String.class; + break; + case HsRelatorio.FUNCIONARIOS_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorio._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorio.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioArea.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioArea.java new file mode 100644 index 00000000..709196c9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioArea.java @@ -0,0 +1,545 @@ +/* +* HsRelatorioArea.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioArea extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRelatorioArea.ID, HsRelatorioArea.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.ID_FULL, HsRelatorioArea.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.DESCRIPTION, HsRelatorioArea.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.DESCRIPTION_FULL, HsRelatorioArea.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.DELETED_DATE, HsRelatorioArea.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.DELETED_DATE_FULL, HsRelatorioArea.DELETED_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioArea.CLASS_IDENTIFIER, HsRelatorioArea.RELATORIO_ID, HsRelatorioArea.TO_RELATORIO_ID ); + FIELD_INDEXES.put( HsRelatorioArea.RELATORIO_ID, HsRelatorioArea.RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.RELATORIO_ID_FULL, HsRelatorioArea.RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.TO_RELATORIO_ID, HsRelatorioArea.TO_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.ORDEM, HsRelatorioArea.ORDEM_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.ORDEM_FULL, HsRelatorioArea.ORDEM_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.HS_AREA_ID, HsRelatorioArea.HS_AREA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioArea.HS_AREA_ID_FULL, HsRelatorioArea.HS_AREA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrelatorio_idTohs_relatorio = + new com.evolute.entity.ForeignKey( HsRelatorioArea.class, HsRelatorioArea.RELATORIO_ID, db.data.siprp_local.outer.HsRelatorioData.class, db.data.siprp_local.outer.HsRelatorioData.ID ); + + public static final String TABLENAME = "hs_relatorio_area"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_area"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_area.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_relatorio_area.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_relatorio_area.deleted_date"; + public static final int DELETED_DATE_INDEX = 2; + public static final String RELATORIO_ID = "relatorio_id"; + public static final String RELATORIO_ID_FULL = "hs_relatorio_area.relatorio_id"; + public static final int RELATORIO_ID_INDEX = 3; + public static final String TO_RELATORIO_ID = "to_relatorio_id"; + public static final String TO_RELATORIO_ID_FULL = "hs_relatorio_area.to_relatorio_id"; + public static final int TO_RELATORIO_ID_INDEX = 4; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "hs_relatorio_area.ordem"; + public static final int ORDEM_INDEX = 5; + public static final String HS_AREA_ID = "hs_area_id"; + public static final String HS_AREA_ID_FULL = "hs_relatorio_area.hs_area_id"; + public static final int HS_AREA_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, DELETED_DATE, RELATORIO_ID, TO_RELATORIO_ID, ORDEM, HS_AREA_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + RELATORIO_ID, TABLENAME + "." + TO_RELATORIO_ID, TABLENAME + "." + ORDEM, TABLENAME + "." + HS_AREA_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, DELETED_DATE, RELATORIO_ID, ORDEM, HS_AREA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, DELETED_DATE, RELATORIO_ID, ORDEM, HS_AREA_ID, }; + + private Integer id; + private String description; + private java.sql.Timestamp deleted_date; + private Integer relatorio_id; + private db.data.siprp_local.outer.HsRelatorioData to_relatorio_id; + private Integer ordem; + private Integer hs_area_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioArea() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRelatorioPosto_area_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioPostoData.class , getPrimaryKey().getMap().get("id"), "area_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getRelatorio_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RELATORIO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.relatorio_id; + } + + public void setRelatorio_id( Integer relatorio_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RELATORIO_ID, relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.relatorio_id = relatorio_id; + LAZY_LOADED_OBJECTS.put( RELATORIO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioData toRelatorio_id() + { + try + { + prepare( TO_RELATORIO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_relatorio_id; + } + + public void setToRelatorio_id( db.data.siprp_local.outer.HsRelatorioData to_relatorio_id ) + { + try + { + preProcess( TO_RELATORIO_ID, to_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_relatorio_id = to_relatorio_id; + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Integer getHs_area_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_AREA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_area_id; + } + + public void setHs_area_id( Integer hs_area_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_AREA_ID, hs_area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_area_id = hs_area_id; + LAZY_LOADED_OBJECTS.put( HS_AREA_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioArea.ID_INDEX: + value = getId(); + break; + case HsRelatorioArea.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsRelatorioArea.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsRelatorioArea.RELATORIO_ID_INDEX: + value = getRelatorio_id(); + break; + case HsRelatorioArea.TO_RELATORIO_ID_INDEX: + value = toRelatorio_id(); + break; + case HsRelatorioArea.ORDEM_INDEX: + value = getOrdem(); + break; + case HsRelatorioArea.HS_AREA_ID_INDEX: + value = getHs_area_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioArea.ID_INDEX: + value = this.id; + break; + case HsRelatorioArea.DESCRIPTION_INDEX: + value = this.description; + break; + case HsRelatorioArea.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsRelatorioArea.RELATORIO_ID_INDEX: + value = this.relatorio_id; + break; + case HsRelatorioArea.TO_RELATORIO_ID_INDEX: + value = this.to_relatorio_id; + break; + case HsRelatorioArea.ORDEM_INDEX: + value = this.ordem; + break; + case HsRelatorioArea.HS_AREA_ID_INDEX: + value = this.hs_area_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioArea.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioArea.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsRelatorioArea.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsRelatorioArea.RELATORIO_ID_INDEX: + setRelatorio_id( ( Integer ) value ); + break; + case HsRelatorioArea.TO_RELATORIO_ID_INDEX: + setToRelatorio_id( ( db.data.siprp_local.outer.HsRelatorioData ) value ); + break; + case HsRelatorioArea.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case HsRelatorioArea.HS_AREA_ID_INDEX: + setHs_area_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioArea.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioArea.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsRelatorioArea.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsRelatorioArea.RELATORIO_ID_INDEX: + this.relatorio_id = ( Integer ) value; + break; + case HsRelatorioArea.TO_RELATORIO_ID_INDEX: + this.to_relatorio_id = ( db.data.siprp_local.outer.HsRelatorioData ) value; + break; + case HsRelatorioArea.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case HsRelatorioArea.HS_AREA_ID_INDEX: + this.hs_area_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioArea.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioArea.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsRelatorioArea.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsRelatorioArea.RELATORIO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioArea.TO_RELATORIO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioData.class; + break; + case HsRelatorioArea.ORDEM_INDEX: + theClass = Integer.class; + break; + case HsRelatorioArea.HS_AREA_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioArea._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioArea.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioEquipamento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioEquipamento.java new file mode 100644 index 00000000..82cee441 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioEquipamento.java @@ -0,0 +1,583 @@ +/* +* HsRelatorioEquipamento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioEquipamento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioEquipamento.CLASS_IDENTIFIER, HsRelatorioEquipamento.HS_RELATORIO_ID, HsRelatorioEquipamento.TO_HS_RELATORIO_ID ); + FIELD_INDEXES.put( HsRelatorioEquipamento.HS_RELATORIO_ID, HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.HS_RELATORIO_ID_FULL, HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.TO_HS_RELATORIO_ID, HsRelatorioEquipamento.TO_HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.HS_EQUIPAMENTO, HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.HS_EQUIPAMENTO_FULL, HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.ID, HsRelatorioEquipamento.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.ID_FULL, HsRelatorioEquipamento.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.TIPO, HsRelatorioEquipamento.TIPO_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.TIPO_FULL, HsRelatorioEquipamento.TIPO_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.MARCA, HsRelatorioEquipamento.MARCA_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.MARCA_FULL, HsRelatorioEquipamento.MARCA_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.MODELO, HsRelatorioEquipamento.MODELO_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.MODELO_FULL, HsRelatorioEquipamento.MODELO_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.HS_EQUIPAMENTO_ID, HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_FULL, HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyhs_relatorio_idTohs_relatorio = + new com.evolute.entity.ForeignKey( HsRelatorioEquipamento.class, HsRelatorioEquipamento.HS_RELATORIO_ID, db.data.siprp_local.outer.HsRelatorioData.class, db.data.siprp_local.outer.HsRelatorioData.ID ); + + public static final String TABLENAME = "hs_relatorio_equipamento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_equipamento"; + + public static final int _INVALID__INDEX = -1; + public static final String HS_RELATORIO_ID = "hs_relatorio_id"; + public static final String HS_RELATORIO_ID_FULL = "hs_relatorio_equipamento.hs_relatorio_id"; + public static final int HS_RELATORIO_ID_INDEX = 0; + public static final String TO_HS_RELATORIO_ID = "to_hs_relatorio_id"; + public static final String TO_HS_RELATORIO_ID_FULL = "hs_relatorio_equipamento.to_hs_relatorio_id"; + public static final int TO_HS_RELATORIO_ID_INDEX = 1; + public static final String HS_EQUIPAMENTO = "hs_equipamento"; + public static final String HS_EQUIPAMENTO_FULL = "hs_relatorio_equipamento.hs_equipamento"; + public static final int HS_EQUIPAMENTO_INDEX = 2; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_equipamento.id"; + public static final int ID_INDEX = 3; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "hs_relatorio_equipamento.tipo"; + public static final int TIPO_INDEX = 4; + public static final String MARCA = "marca"; + public static final String MARCA_FULL = "hs_relatorio_equipamento.marca"; + public static final int MARCA_INDEX = 5; + public static final String MODELO = "modelo"; + public static final String MODELO_FULL = "hs_relatorio_equipamento.modelo"; + public static final int MODELO_INDEX = 6; + public static final String HS_EQUIPAMENTO_ID = "hs_equipamento_id"; + public static final String HS_EQUIPAMENTO_ID_FULL = "hs_relatorio_equipamento.hs_equipamento_id"; + public static final int HS_EQUIPAMENTO_ID_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + HS_RELATORIO_ID, TO_HS_RELATORIO_ID, HS_EQUIPAMENTO, TIPO, MARCA, MODELO, + HS_EQUIPAMENTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + HS_RELATORIO_ID, TABLENAME + "." + TO_HS_RELATORIO_ID, TABLENAME + "." + HS_EQUIPAMENTO, TABLENAME + "." + TIPO, TABLENAME + "." + MARCA, TABLENAME + "." + MODELO, + TABLENAME + "." + HS_EQUIPAMENTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + HS_RELATORIO_ID, HS_EQUIPAMENTO, ID, TIPO, MARCA, MODELO, HS_EQUIPAMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + HS_RELATORIO_ID, HS_EQUIPAMENTO, ID, TIPO, MARCA, MODELO, HS_EQUIPAMENTO_ID, }; + + private Integer hs_relatorio_id; + private db.data.siprp_local.outer.HsRelatorioData to_hs_relatorio_id; + private Integer hs_equipamento; + private Integer id; + private String tipo; + private String marca; + private String modelo; + private Integer hs_equipamento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioEquipamento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false }; + } + + public Integer getHs_relatorio_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_RELATORIO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_relatorio_id; + } + + public void setHs_relatorio_id( Integer hs_relatorio_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_RELATORIO_ID, hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_relatorio_id = hs_relatorio_id; + LAZY_LOADED_OBJECTS.put( HS_RELATORIO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioData toHs_relatorio_id() + { + try + { + prepare( TO_HS_RELATORIO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_hs_relatorio_id; + } + + public void setToHs_relatorio_id( db.data.siprp_local.outer.HsRelatorioData to_hs_relatorio_id ) + { + try + { + preProcess( TO_HS_RELATORIO_ID, to_hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_hs_relatorio_id = to_hs_relatorio_id; + } + + public Integer getHs_equipamento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_EQUIPAMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_equipamento; + } + + public void setHs_equipamento( Integer hs_equipamento ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_EQUIPAMENTO, hs_equipamento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_equipamento = hs_equipamento; + LAZY_LOADED_OBJECTS.put( HS_EQUIPAMENTO, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( String tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public String getMarca() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marca; + } + + public void setMarca( String marca ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCA, marca ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marca = marca; + LAZY_LOADED_OBJECTS.put( MARCA, Boolean.TRUE ); + } + + public String getModelo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MODELO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.modelo; + } + + public void setModelo( String modelo ) + { + try + { + setLockedForRefresh( true ); + preProcess( MODELO, modelo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.modelo = modelo; + LAZY_LOADED_OBJECTS.put( MODELO, Boolean.TRUE ); + } + + public Integer getHs_equipamento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_EQUIPAMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_equipamento_id; + } + + public void setHs_equipamento_id( Integer hs_equipamento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_EQUIPAMENTO_ID, hs_equipamento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_equipamento_id = hs_equipamento_id; + LAZY_LOADED_OBJECTS.put( HS_EQUIPAMENTO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX: + value = getHs_relatorio_id(); + break; + case HsRelatorioEquipamento.TO_HS_RELATORIO_ID_INDEX: + value = toHs_relatorio_id(); + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX: + value = getHs_equipamento(); + break; + case HsRelatorioEquipamento.ID_INDEX: + value = getId(); + break; + case HsRelatorioEquipamento.TIPO_INDEX: + value = getTipo(); + break; + case HsRelatorioEquipamento.MARCA_INDEX: + value = getMarca(); + break; + case HsRelatorioEquipamento.MODELO_INDEX: + value = getModelo(); + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX: + value = getHs_equipamento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX: + value = this.hs_relatorio_id; + break; + case HsRelatorioEquipamento.TO_HS_RELATORIO_ID_INDEX: + value = this.to_hs_relatorio_id; + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX: + value = this.hs_equipamento; + break; + case HsRelatorioEquipamento.ID_INDEX: + value = this.id; + break; + case HsRelatorioEquipamento.TIPO_INDEX: + value = this.tipo; + break; + case HsRelatorioEquipamento.MARCA_INDEX: + value = this.marca; + break; + case HsRelatorioEquipamento.MODELO_INDEX: + value = this.modelo; + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX: + value = this.hs_equipamento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX: + setHs_relatorio_id( ( Integer ) value ); + break; + case HsRelatorioEquipamento.TO_HS_RELATORIO_ID_INDEX: + setToHs_relatorio_id( ( db.data.siprp_local.outer.HsRelatorioData ) value ); + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX: + setHs_equipamento( ( Integer ) value ); + break; + case HsRelatorioEquipamento.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioEquipamento.TIPO_INDEX: + setTipo( ( String ) value ); + break; + case HsRelatorioEquipamento.MARCA_INDEX: + setMarca( ( String ) value ); + break; + case HsRelatorioEquipamento.MODELO_INDEX: + setModelo( ( String ) value ); + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX: + setHs_equipamento_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX: + this.hs_relatorio_id = ( Integer ) value; + break; + case HsRelatorioEquipamento.TO_HS_RELATORIO_ID_INDEX: + this.to_hs_relatorio_id = ( db.data.siprp_local.outer.HsRelatorioData ) value; + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX: + this.hs_equipamento = ( Integer ) value; + break; + case HsRelatorioEquipamento.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioEquipamento.TIPO_INDEX: + this.tipo = ( String ) value; + break; + case HsRelatorioEquipamento.MARCA_INDEX: + this.marca = ( String ) value; + break; + case HsRelatorioEquipamento.MODELO_INDEX: + this.modelo = ( String ) value; + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX: + this.hs_equipamento_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioEquipamento.HS_RELATORIO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioEquipamento.TO_HS_RELATORIO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioData.class; + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_INDEX: + theClass = Integer.class; + break; + case HsRelatorioEquipamento.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioEquipamento.TIPO_INDEX: + theClass = String.class; + break; + case HsRelatorioEquipamento.MARCA_INDEX: + theClass = String.class; + break; + case HsRelatorioEquipamento.MODELO_INDEX: + theClass = String.class; + break; + case HsRelatorioEquipamento.HS_EQUIPAMENTO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioEquipamento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioEquipamento.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioLegislacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioLegislacao.java new file mode 100644 index 00000000..8df82bc7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioLegislacao.java @@ -0,0 +1,533 @@ +/* +* HsRelatorioLegislacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioLegislacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioLegislacao.CLASS_IDENTIFIER, HsRelatorioLegislacao.HS_RELATORIO_ID, HsRelatorioLegislacao.TO_HS_RELATORIO_ID ); + FIELD_INDEXES.put( HsRelatorioLegislacao.HS_RELATORIO_ID, HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.HS_RELATORIO_ID_FULL, HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.TO_HS_RELATORIO_ID, HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.HS_LEGISLACAO_ID, HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.HS_LEGISLACAO_ID_FULL, HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.ID, HsRelatorioLegislacao.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.ID_FULL, HsRelatorioLegislacao.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.CATEGORIA, HsRelatorioLegislacao.CATEGORIA_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.CATEGORIA_FULL, HsRelatorioLegislacao.CATEGORIA_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.DESCRICAO, HsRelatorioLegislacao.DESCRICAO_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.DESCRICAO_FULL, HsRelatorioLegislacao.DESCRICAO_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.ORDEM, HsRelatorioLegislacao.ORDEM_INDEX ); + FIELD_INDEXES.put( HsRelatorioLegislacao.ORDEM_FULL, HsRelatorioLegislacao.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyhs_relatorio_idTohs_relatorio = + new com.evolute.entity.ForeignKey( HsRelatorioLegislacao.class, HsRelatorioLegislacao.HS_RELATORIO_ID, db.data.siprp_local.outer.HsRelatorioData.class, db.data.siprp_local.outer.HsRelatorioData.ID ); + + public static final String TABLENAME = "hs_relatorio_legislacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_legislacao"; + + public static final int _INVALID__INDEX = -1; + public static final String HS_RELATORIO_ID = "hs_relatorio_id"; + public static final String HS_RELATORIO_ID_FULL = "hs_relatorio_legislacao.hs_relatorio_id"; + public static final int HS_RELATORIO_ID_INDEX = 0; + public static final String TO_HS_RELATORIO_ID = "to_hs_relatorio_id"; + public static final String TO_HS_RELATORIO_ID_FULL = "hs_relatorio_legislacao.to_hs_relatorio_id"; + public static final int TO_HS_RELATORIO_ID_INDEX = 1; + public static final String HS_LEGISLACAO_ID = "hs_legislacao_id"; + public static final String HS_LEGISLACAO_ID_FULL = "hs_relatorio_legislacao.hs_legislacao_id"; + public static final int HS_LEGISLACAO_ID_INDEX = 2; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_legislacao.id"; + public static final int ID_INDEX = 3; + public static final String CATEGORIA = "categoria"; + public static final String CATEGORIA_FULL = "hs_relatorio_legislacao.categoria"; + public static final int CATEGORIA_INDEX = 4; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "hs_relatorio_legislacao.descricao"; + public static final int DESCRICAO_INDEX = 5; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "hs_relatorio_legislacao.ordem"; + public static final int ORDEM_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + HS_RELATORIO_ID, TO_HS_RELATORIO_ID, HS_LEGISLACAO_ID, CATEGORIA, DESCRICAO, + ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + HS_RELATORIO_ID, TABLENAME + "." + TO_HS_RELATORIO_ID, TABLENAME + "." + HS_LEGISLACAO_ID, TABLENAME + "." + CATEGORIA, TABLENAME + "." + DESCRICAO, + TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + HS_RELATORIO_ID, HS_LEGISLACAO_ID, ID, CATEGORIA, DESCRICAO, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + HS_RELATORIO_ID, HS_LEGISLACAO_ID, ID, CATEGORIA, DESCRICAO, ORDEM, }; + + private Integer hs_relatorio_id; + private db.data.siprp_local.outer.HsRelatorioData to_hs_relatorio_id; + private Integer hs_legislacao_id; + private Integer id; + private String categoria; + private String descricao; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioLegislacao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getHs_relatorio_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_RELATORIO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_relatorio_id; + } + + public void setHs_relatorio_id( Integer hs_relatorio_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_RELATORIO_ID, hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_relatorio_id = hs_relatorio_id; + LAZY_LOADED_OBJECTS.put( HS_RELATORIO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioData toHs_relatorio_id() + { + try + { + prepare( TO_HS_RELATORIO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_hs_relatorio_id; + } + + public void setToHs_relatorio_id( db.data.siprp_local.outer.HsRelatorioData to_hs_relatorio_id ) + { + try + { + preProcess( TO_HS_RELATORIO_ID, to_hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_hs_relatorio_id = to_hs_relatorio_id; + } + + public Integer getHs_legislacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_LEGISLACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_legislacao_id; + } + + public void setHs_legislacao_id( Integer hs_legislacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_LEGISLACAO_ID, hs_legislacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_legislacao_id = hs_legislacao_id; + LAZY_LOADED_OBJECTS.put( HS_LEGISLACAO_ID, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getCategoria() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CATEGORIA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.categoria; + } + + public void setCategoria( String categoria ) + { + try + { + setLockedForRefresh( true ); + preProcess( CATEGORIA, categoria ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.categoria = categoria; + LAZY_LOADED_OBJECTS.put( CATEGORIA, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX: + value = getHs_relatorio_id(); + break; + case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX: + value = toHs_relatorio_id(); + break; + case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX: + value = getHs_legislacao_id(); + break; + case HsRelatorioLegislacao.ID_INDEX: + value = getId(); + break; + case HsRelatorioLegislacao.CATEGORIA_INDEX: + value = getCategoria(); + break; + case HsRelatorioLegislacao.DESCRICAO_INDEX: + value = getDescricao(); + break; + case HsRelatorioLegislacao.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX: + value = this.hs_relatorio_id; + break; + case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX: + value = this.to_hs_relatorio_id; + break; + case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX: + value = this.hs_legislacao_id; + break; + case HsRelatorioLegislacao.ID_INDEX: + value = this.id; + break; + case HsRelatorioLegislacao.CATEGORIA_INDEX: + value = this.categoria; + break; + case HsRelatorioLegislacao.DESCRICAO_INDEX: + value = this.descricao; + break; + case HsRelatorioLegislacao.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX: + setHs_relatorio_id( ( Integer ) value ); + break; + case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX: + setToHs_relatorio_id( ( db.data.siprp_local.outer.HsRelatorioData ) value ); + break; + case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX: + setHs_legislacao_id( ( Integer ) value ); + break; + case HsRelatorioLegislacao.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioLegislacao.CATEGORIA_INDEX: + setCategoria( ( String ) value ); + break; + case HsRelatorioLegislacao.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case HsRelatorioLegislacao.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX: + this.hs_relatorio_id = ( Integer ) value; + break; + case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX: + this.to_hs_relatorio_id = ( db.data.siprp_local.outer.HsRelatorioData ) value; + break; + case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX: + this.hs_legislacao_id = ( Integer ) value; + break; + case HsRelatorioLegislacao.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioLegislacao.CATEGORIA_INDEX: + this.categoria = ( String ) value; + break; + case HsRelatorioLegislacao.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case HsRelatorioLegislacao.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioLegislacao.HS_RELATORIO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioLegislacao.TO_HS_RELATORIO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioData.class; + break; + case HsRelatorioLegislacao.HS_LEGISLACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioLegislacao.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioLegislacao.CATEGORIA_INDEX: + theClass = String.class; + break; + case HsRelatorioLegislacao.DESCRICAO_INDEX: + theClass = String.class; + break; + case HsRelatorioLegislacao.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioLegislacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioLegislacao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioMedida.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioMedida.java new file mode 100644 index 00000000..c4292e92 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioMedida.java @@ -0,0 +1,547 @@ +/* +* HsRelatorioMedida.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioMedida extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRelatorioMedida.ID, HsRelatorioMedida.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.ID_FULL, HsRelatorioMedida.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioMedida.CLASS_IDENTIFIER, HsRelatorioMedida.RISCO_ID, HsRelatorioMedida.TO_RISCO_ID ); + FIELD_INDEXES.put( HsRelatorioMedida.RISCO_ID, HsRelatorioMedida.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.RISCO_ID_FULL, HsRelatorioMedida.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.TO_RISCO_ID, HsRelatorioMedida.TO_RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.DESCRIPTION, HsRelatorioMedida.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.DESCRIPTION_FULL, HsRelatorioMedida.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.REQUESITOS_LEGAIS, HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.REQUESITOS_LEGAIS_FULL, HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.DELETED_DATE, HsRelatorioMedida.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.DELETED_DATE_FULL, HsRelatorioMedida.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.HS_MEDIDA_ID, HsRelatorioMedida.HS_MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioMedida.HS_MEDIDA_ID_FULL, HsRelatorioMedida.HS_MEDIDA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrisco_idTohs_relatorio_risco = + new com.evolute.entity.ForeignKey( HsRelatorioMedida.class, HsRelatorioMedida.RISCO_ID, db.data.siprp_local.outer.HsRelatorioRiscoData.class, db.data.siprp_local.outer.HsRelatorioRiscoData.ID ); + + public static final String TABLENAME = "hs_relatorio_medida"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_medida"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_medida.id"; + public static final int ID_INDEX = 0; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "hs_relatorio_medida.risco_id"; + public static final int RISCO_ID_INDEX = 1; + public static final String TO_RISCO_ID = "to_risco_id"; + public static final String TO_RISCO_ID_FULL = "hs_relatorio_medida.to_risco_id"; + public static final int TO_RISCO_ID_INDEX = 2; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_relatorio_medida.description"; + public static final int DESCRIPTION_INDEX = 3; + public static final String REQUESITOS_LEGAIS = "requesitos_legais"; + public static final String REQUESITOS_LEGAIS_FULL = "hs_relatorio_medida.requesitos_legais"; + public static final int REQUESITOS_LEGAIS_INDEX = 4; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_relatorio_medida.deleted_date"; + public static final int DELETED_DATE_INDEX = 5; + public static final String HS_MEDIDA_ID = "hs_medida_id"; + public static final String HS_MEDIDA_ID_FULL = "hs_relatorio_medida.hs_medida_id"; + public static final int HS_MEDIDA_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + RISCO_ID, TO_RISCO_ID, DESCRIPTION, REQUESITOS_LEGAIS, DELETED_DATE, + HS_MEDIDA_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + RISCO_ID, TABLENAME + "." + TO_RISCO_ID, TABLENAME + "." + DESCRIPTION, TABLENAME + "." + REQUESITOS_LEGAIS, TABLENAME + "." + DELETED_DATE, + TABLENAME + "." + HS_MEDIDA_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, RISCO_ID, DESCRIPTION, REQUESITOS_LEGAIS, DELETED_DATE, HS_MEDIDA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, RISCO_ID, DESCRIPTION, REQUESITOS_LEGAIS, DELETED_DATE, HS_MEDIDA_ID, }; + + private Integer id; + private Integer risco_id; + private db.data.siprp_local.outer.HsRelatorioRiscoData to_risco_id; + private String description; + private String requesitos_legais; + private java.sql.Timestamp deleted_date; + private Integer hs_medida_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioMedida() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRelatorioPostoMedida_medida_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioPostoMedidaData.class , getPrimaryKey().getMap().get("id"), "medida_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioRiscoData toRisco_id() + { + try + { + prepare( TO_RISCO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_risco_id; + } + + public void setToRisco_id( db.data.siprp_local.outer.HsRelatorioRiscoData to_risco_id ) + { + try + { + preProcess( TO_RISCO_ID, to_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_risco_id = to_risco_id; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public String getRequesitos_legais() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REQUESITOS_LEGAIS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.requesitos_legais; + } + + public void setRequesitos_legais( String requesitos_legais ) + { + try + { + setLockedForRefresh( true ); + preProcess( REQUESITOS_LEGAIS, requesitos_legais ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.requesitos_legais = requesitos_legais; + LAZY_LOADED_OBJECTS.put( REQUESITOS_LEGAIS, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getHs_medida_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_MEDIDA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_medida_id; + } + + public void setHs_medida_id( Integer hs_medida_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_MEDIDA_ID, hs_medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_medida_id = hs_medida_id; + LAZY_LOADED_OBJECTS.put( HS_MEDIDA_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioMedida.ID_INDEX: + value = getId(); + break; + case HsRelatorioMedida.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case HsRelatorioMedida.TO_RISCO_ID_INDEX: + value = toRisco_id(); + break; + case HsRelatorioMedida.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX: + value = getRequesitos_legais(); + break; + case HsRelatorioMedida.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsRelatorioMedida.HS_MEDIDA_ID_INDEX: + value = getHs_medida_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioMedida.ID_INDEX: + value = this.id; + break; + case HsRelatorioMedida.RISCO_ID_INDEX: + value = this.risco_id; + break; + case HsRelatorioMedida.TO_RISCO_ID_INDEX: + value = this.to_risco_id; + break; + case HsRelatorioMedida.DESCRIPTION_INDEX: + value = this.description; + break; + case HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX: + value = this.requesitos_legais; + break; + case HsRelatorioMedida.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsRelatorioMedida.HS_MEDIDA_ID_INDEX: + value = this.hs_medida_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioMedida.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioMedida.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case HsRelatorioMedida.TO_RISCO_ID_INDEX: + setToRisco_id( ( db.data.siprp_local.outer.HsRelatorioRiscoData ) value ); + break; + case HsRelatorioMedida.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX: + setRequesitos_legais( ( String ) value ); + break; + case HsRelatorioMedida.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsRelatorioMedida.HS_MEDIDA_ID_INDEX: + setHs_medida_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioMedida.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioMedida.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case HsRelatorioMedida.TO_RISCO_ID_INDEX: + this.to_risco_id = ( db.data.siprp_local.outer.HsRelatorioRiscoData ) value; + break; + case HsRelatorioMedida.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX: + this.requesitos_legais = ( String ) value; + break; + case HsRelatorioMedida.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsRelatorioMedida.HS_MEDIDA_ID_INDEX: + this.hs_medida_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioMedida.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioMedida.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioMedida.TO_RISCO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioRiscoData.class; + break; + case HsRelatorioMedida.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsRelatorioMedida.REQUESITOS_LEGAIS_INDEX: + theClass = String.class; + break; + case HsRelatorioMedida.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsRelatorioMedida.HS_MEDIDA_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioMedida._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioMedida.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioNormalizacao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioNormalizacao.java new file mode 100644 index 00000000..f586b86c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioNormalizacao.java @@ -0,0 +1,533 @@ +/* +* HsRelatorioNormalizacao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioNormalizacao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioNormalizacao.CLASS_IDENTIFIER, HsRelatorioNormalizacao.HS_RELATORIO_ID, HsRelatorioNormalizacao.TO_HS_RELATORIO_ID ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.HS_RELATORIO_ID, HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.HS_RELATORIO_ID_FULL, HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.TO_HS_RELATORIO_ID, HsRelatorioNormalizacao.TO_HS_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.HS_NORMALIZACAO_ID, HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_FULL, HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.ID, HsRelatorioNormalizacao.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.ID_FULL, HsRelatorioNormalizacao.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.CODIGO, HsRelatorioNormalizacao.CODIGO_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.CODIGO_FULL, HsRelatorioNormalizacao.CODIGO_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.DESCRICAO, HsRelatorioNormalizacao.DESCRICAO_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.DESCRICAO_FULL, HsRelatorioNormalizacao.DESCRICAO_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.PORTUGUESA, HsRelatorioNormalizacao.PORTUGUESA_INDEX ); + FIELD_INDEXES.put( HsRelatorioNormalizacao.PORTUGUESA_FULL, HsRelatorioNormalizacao.PORTUGUESA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyhs_relatorio_idTohs_relatorio = + new com.evolute.entity.ForeignKey( HsRelatorioNormalizacao.class, HsRelatorioNormalizacao.HS_RELATORIO_ID, db.data.siprp_local.outer.HsRelatorioData.class, db.data.siprp_local.outer.HsRelatorioData.ID ); + + public static final String TABLENAME = "hs_relatorio_normalizacao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_normalizacao"; + + public static final int _INVALID__INDEX = -1; + public static final String HS_RELATORIO_ID = "hs_relatorio_id"; + public static final String HS_RELATORIO_ID_FULL = "hs_relatorio_normalizacao.hs_relatorio_id"; + public static final int HS_RELATORIO_ID_INDEX = 0; + public static final String TO_HS_RELATORIO_ID = "to_hs_relatorio_id"; + public static final String TO_HS_RELATORIO_ID_FULL = "hs_relatorio_normalizacao.to_hs_relatorio_id"; + public static final int TO_HS_RELATORIO_ID_INDEX = 1; + public static final String HS_NORMALIZACAO_ID = "hs_normalizacao_id"; + public static final String HS_NORMALIZACAO_ID_FULL = "hs_relatorio_normalizacao.hs_normalizacao_id"; + public static final int HS_NORMALIZACAO_ID_INDEX = 2; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_normalizacao.id"; + public static final int ID_INDEX = 3; + public static final String CODIGO = "codigo"; + public static final String CODIGO_FULL = "hs_relatorio_normalizacao.codigo"; + public static final int CODIGO_INDEX = 4; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "hs_relatorio_normalizacao.descricao"; + public static final int DESCRICAO_INDEX = 5; + public static final String PORTUGUESA = "portuguesa"; + public static final String PORTUGUESA_FULL = "hs_relatorio_normalizacao.portuguesa"; + public static final int PORTUGUESA_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + HS_RELATORIO_ID, TO_HS_RELATORIO_ID, HS_NORMALIZACAO_ID, CODIGO, DESCRICAO, + PORTUGUESA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + HS_RELATORIO_ID, TABLENAME + "." + TO_HS_RELATORIO_ID, TABLENAME + "." + HS_NORMALIZACAO_ID, TABLENAME + "." + CODIGO, TABLENAME + "." + DESCRICAO, + TABLENAME + "." + PORTUGUESA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + HS_RELATORIO_ID, HS_NORMALIZACAO_ID, ID, CODIGO, DESCRICAO, PORTUGUESA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + HS_RELATORIO_ID, HS_NORMALIZACAO_ID, ID, CODIGO, DESCRICAO, PORTUGUESA, }; + + private Integer hs_relatorio_id; + private db.data.siprp_local.outer.HsRelatorioData to_hs_relatorio_id; + private Integer hs_normalizacao_id; + private Integer id; + private String codigo; + private String descricao; + private Boolean portuguesa; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioNormalizacao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getHs_relatorio_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_RELATORIO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_relatorio_id; + } + + public void setHs_relatorio_id( Integer hs_relatorio_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_RELATORIO_ID, hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_relatorio_id = hs_relatorio_id; + LAZY_LOADED_OBJECTS.put( HS_RELATORIO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioData toHs_relatorio_id() + { + try + { + prepare( TO_HS_RELATORIO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_hs_relatorio_id; + } + + public void setToHs_relatorio_id( db.data.siprp_local.outer.HsRelatorioData to_hs_relatorio_id ) + { + try + { + preProcess( TO_HS_RELATORIO_ID, to_hs_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_hs_relatorio_id = to_hs_relatorio_id; + } + + public Integer getHs_normalizacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_NORMALIZACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_normalizacao_id; + } + + public void setHs_normalizacao_id( Integer hs_normalizacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_NORMALIZACAO_ID, hs_normalizacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_normalizacao_id = hs_normalizacao_id; + LAZY_LOADED_OBJECTS.put( HS_NORMALIZACAO_ID, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getCodigo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo; + } + + public void setCodigo( String codigo ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO, codigo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo = codigo; + LAZY_LOADED_OBJECTS.put( CODIGO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Boolean getPortuguesa() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PORTUGUESA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.portuguesa; + } + + public void setPortuguesa( Boolean portuguesa ) + { + try + { + setLockedForRefresh( true ); + preProcess( PORTUGUESA, portuguesa ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.portuguesa = portuguesa; + LAZY_LOADED_OBJECTS.put( PORTUGUESA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX: + value = getHs_relatorio_id(); + break; + case HsRelatorioNormalizacao.TO_HS_RELATORIO_ID_INDEX: + value = toHs_relatorio_id(); + break; + case HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX: + value = getHs_normalizacao_id(); + break; + case HsRelatorioNormalizacao.ID_INDEX: + value = getId(); + break; + case HsRelatorioNormalizacao.CODIGO_INDEX: + value = getCodigo(); + break; + case HsRelatorioNormalizacao.DESCRICAO_INDEX: + value = getDescricao(); + break; + case HsRelatorioNormalizacao.PORTUGUESA_INDEX: + value = getPortuguesa(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX: + value = this.hs_relatorio_id; + break; + case HsRelatorioNormalizacao.TO_HS_RELATORIO_ID_INDEX: + value = this.to_hs_relatorio_id; + break; + case HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX: + value = this.hs_normalizacao_id; + break; + case HsRelatorioNormalizacao.ID_INDEX: + value = this.id; + break; + case HsRelatorioNormalizacao.CODIGO_INDEX: + value = this.codigo; + break; + case HsRelatorioNormalizacao.DESCRICAO_INDEX: + value = this.descricao; + break; + case HsRelatorioNormalizacao.PORTUGUESA_INDEX: + value = this.portuguesa; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX: + setHs_relatorio_id( ( Integer ) value ); + break; + case HsRelatorioNormalizacao.TO_HS_RELATORIO_ID_INDEX: + setToHs_relatorio_id( ( db.data.siprp_local.outer.HsRelatorioData ) value ); + break; + case HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX: + setHs_normalizacao_id( ( Integer ) value ); + break; + case HsRelatorioNormalizacao.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioNormalizacao.CODIGO_INDEX: + setCodigo( ( String ) value ); + break; + case HsRelatorioNormalizacao.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case HsRelatorioNormalizacao.PORTUGUESA_INDEX: + setPortuguesa( ( Boolean ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX: + this.hs_relatorio_id = ( Integer ) value; + break; + case HsRelatorioNormalizacao.TO_HS_RELATORIO_ID_INDEX: + this.to_hs_relatorio_id = ( db.data.siprp_local.outer.HsRelatorioData ) value; + break; + case HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX: + this.hs_normalizacao_id = ( Integer ) value; + break; + case HsRelatorioNormalizacao.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioNormalizacao.CODIGO_INDEX: + this.codigo = ( String ) value; + break; + case HsRelatorioNormalizacao.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case HsRelatorioNormalizacao.PORTUGUESA_INDEX: + this.portuguesa = ( Boolean ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioNormalizacao.HS_RELATORIO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioNormalizacao.TO_HS_RELATORIO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioData.class; + break; + case HsRelatorioNormalizacao.HS_NORMALIZACAO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioNormalizacao.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioNormalizacao.CODIGO_INDEX: + theClass = String.class; + break; + case HsRelatorioNormalizacao.DESCRICAO_INDEX: + theClass = String.class; + break; + case HsRelatorioNormalizacao.PORTUGUESA_INDEX: + theClass = Boolean.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioNormalizacao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioNormalizacao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPosto.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPosto.java new file mode 100644 index 00000000..41667265 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPosto.java @@ -0,0 +1,559 @@ +/* +* HsRelatorioPosto.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioPosto extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRelatorioPosto.ID, HsRelatorioPosto.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.ID_FULL, HsRelatorioPosto.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.DESCRIPTION, HsRelatorioPosto.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.DESCRIPTION_FULL, HsRelatorioPosto.DESCRIPTION_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPosto.CLASS_IDENTIFIER, HsRelatorioPosto.AREA_ID, HsRelatorioPosto.TO_AREA_ID ); + FIELD_INDEXES.put( HsRelatorioPosto.AREA_ID, HsRelatorioPosto.AREA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.AREA_ID_FULL, HsRelatorioPosto.AREA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.TO_AREA_ID, HsRelatorioPosto.TO_AREA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.DELETED_DATE, HsRelatorioPosto.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.DELETED_DATE_FULL, HsRelatorioPosto.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.IS_PRINCIPAL, HsRelatorioPosto.IS_PRINCIPAL_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.IS_PRINCIPAL_FULL, HsRelatorioPosto.IS_PRINCIPAL_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.HS_POSTO_ID, HsRelatorioPosto.HS_POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPosto.HS_POSTO_ID_FULL, HsRelatorioPosto.HS_POSTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyarea_idTohs_relatorio_area = + new com.evolute.entity.ForeignKey( HsRelatorioPosto.class, HsRelatorioPosto.AREA_ID, db.data.siprp_local.outer.HsRelatorioAreaData.class, db.data.siprp_local.outer.HsRelatorioAreaData.ID ); + + public static final String TABLENAME = "hs_relatorio_posto"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_posto"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_posto.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_relatorio_posto.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String AREA_ID = "area_id"; + public static final String AREA_ID_FULL = "hs_relatorio_posto.area_id"; + public static final int AREA_ID_INDEX = 2; + public static final String TO_AREA_ID = "to_area_id"; + public static final String TO_AREA_ID_FULL = "hs_relatorio_posto.to_area_id"; + public static final int TO_AREA_ID_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_relatorio_posto.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + public static final String IS_PRINCIPAL = "is_principal"; + public static final String IS_PRINCIPAL_FULL = "hs_relatorio_posto.is_principal"; + public static final int IS_PRINCIPAL_INDEX = 5; + public static final String HS_POSTO_ID = "hs_posto_id"; + public static final String HS_POSTO_ID_FULL = "hs_relatorio_posto.hs_posto_id"; + public static final int HS_POSTO_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, AREA_ID, TO_AREA_ID, DELETED_DATE, IS_PRINCIPAL, HS_POSTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + AREA_ID, TABLENAME + "." + TO_AREA_ID, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + IS_PRINCIPAL, TABLENAME + "." + HS_POSTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, AREA_ID, DELETED_DATE, IS_PRINCIPAL, HS_POSTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, AREA_ID, DELETED_DATE, IS_PRINCIPAL, HS_POSTO_ID, }; + + private Integer id; + private String description; + private Integer area_id; + private db.data.siprp_local.outer.HsRelatorioAreaData to_area_id; + private java.sql.Timestamp deleted_date; + private Boolean is_principal; + private Integer hs_posto_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioPosto() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRelatorioPostoMedida_posto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioPostoMedidaData.class , getPrimaryKey().getMap().get("id"), "posto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioPostoRisco_posto_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "posto_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Integer getArea_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( AREA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.area_id; + } + + public void setArea_id( Integer area_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( AREA_ID, area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.area_id = area_id; + LAZY_LOADED_OBJECTS.put( AREA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioAreaData toArea_id() + { + try + { + prepare( TO_AREA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_area_id; + } + + public void setToArea_id( db.data.siprp_local.outer.HsRelatorioAreaData to_area_id ) + { + try + { + preProcess( TO_AREA_ID, to_area_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_area_id = to_area_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Boolean getIs_principal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PRINCIPAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_principal; + } + + public void setIs_principal( Boolean is_principal ) + { + try + { + setLockedForRefresh( true ); + preProcess( IS_PRINCIPAL, is_principal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_principal = is_principal; + LAZY_LOADED_OBJECTS.put( IS_PRINCIPAL, Boolean.TRUE ); + } + + public Integer getHs_posto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_posto_id; + } + + public void setHs_posto_id( Integer hs_posto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_POSTO_ID, hs_posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_posto_id = hs_posto_id; + LAZY_LOADED_OBJECTS.put( HS_POSTO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPosto.ID_INDEX: + value = getId(); + break; + case HsRelatorioPosto.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsRelatorioPosto.AREA_ID_INDEX: + value = getArea_id(); + break; + case HsRelatorioPosto.TO_AREA_ID_INDEX: + value = toArea_id(); + break; + case HsRelatorioPosto.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsRelatorioPosto.IS_PRINCIPAL_INDEX: + value = getIs_principal(); + break; + case HsRelatorioPosto.HS_POSTO_ID_INDEX: + value = getHs_posto_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPosto.ID_INDEX: + value = this.id; + break; + case HsRelatorioPosto.DESCRIPTION_INDEX: + value = this.description; + break; + case HsRelatorioPosto.AREA_ID_INDEX: + value = this.area_id; + break; + case HsRelatorioPosto.TO_AREA_ID_INDEX: + value = this.to_area_id; + break; + case HsRelatorioPosto.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsRelatorioPosto.IS_PRINCIPAL_INDEX: + value = this.is_principal; + break; + case HsRelatorioPosto.HS_POSTO_ID_INDEX: + value = this.hs_posto_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPosto.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioPosto.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsRelatorioPosto.AREA_ID_INDEX: + setArea_id( ( Integer ) value ); + break; + case HsRelatorioPosto.TO_AREA_ID_INDEX: + setToArea_id( ( db.data.siprp_local.outer.HsRelatorioAreaData ) value ); + break; + case HsRelatorioPosto.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsRelatorioPosto.IS_PRINCIPAL_INDEX: + setIs_principal( ( Boolean ) value ); + break; + case HsRelatorioPosto.HS_POSTO_ID_INDEX: + setHs_posto_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPosto.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioPosto.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsRelatorioPosto.AREA_ID_INDEX: + this.area_id = ( Integer ) value; + break; + case HsRelatorioPosto.TO_AREA_ID_INDEX: + this.to_area_id = ( db.data.siprp_local.outer.HsRelatorioAreaData ) value; + break; + case HsRelatorioPosto.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsRelatorioPosto.IS_PRINCIPAL_INDEX: + this.is_principal = ( Boolean ) value; + break; + case HsRelatorioPosto.HS_POSTO_ID_INDEX: + this.hs_posto_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioPosto.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPosto.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsRelatorioPosto.AREA_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPosto.TO_AREA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioAreaData.class; + break; + case HsRelatorioPosto.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsRelatorioPosto.IS_PRINCIPAL_INDEX: + theClass = Boolean.class; + break; + case HsRelatorioPosto.HS_POSTO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioPosto._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioPosto.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPostoMedida.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPostoMedida.java new file mode 100644 index 00000000..ae0bf156 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPostoMedida.java @@ -0,0 +1,431 @@ +/* +* HsRelatorioPostoMedida.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioPostoMedida extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPostoMedida.CLASS_IDENTIFIER, HsRelatorioPostoMedida.POSTO_ID, HsRelatorioPostoMedida.TO_POSTO_ID ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.POSTO_ID, HsRelatorioPostoMedida.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.POSTO_ID_FULL, HsRelatorioPostoMedida.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.TO_POSTO_ID, HsRelatorioPostoMedida.TO_POSTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPostoMedida.CLASS_IDENTIFIER, HsRelatorioPostoMedida.MEDIDA_ID, HsRelatorioPostoMedida.TO_MEDIDA_ID ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.MEDIDA_ID, HsRelatorioPostoMedida.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.MEDIDA_ID_FULL, HsRelatorioPostoMedida.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.TO_MEDIDA_ID, HsRelatorioPostoMedida.TO_MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.IS_PLANO_ACTUACAO, HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_FULL, HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyposto_idTohs_relatorio_posto = + new com.evolute.entity.ForeignKey( HsRelatorioPostoMedida.class, HsRelatorioPostoMedida.POSTO_ID, db.data.siprp_local.outer.HsRelatorioPostoData.class, db.data.siprp_local.outer.HsRelatorioPostoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymedida_idTohs_relatorio_medida = + new com.evolute.entity.ForeignKey( HsRelatorioPostoMedida.class, HsRelatorioPostoMedida.MEDIDA_ID, db.data.siprp_local.outer.HsRelatorioMedidaData.class, db.data.siprp_local.outer.HsRelatorioMedidaData.ID ); + + public static final String TABLENAME = "hs_relatorio_posto_medida"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_posto_medida"; + + public static final int _INVALID__INDEX = -1; + public static final String POSTO_ID = "posto_id"; + public static final String POSTO_ID_FULL = "hs_relatorio_posto_medida.posto_id"; + public static final int POSTO_ID_INDEX = 0; + public static final String TO_POSTO_ID = "to_posto_id"; + public static final String TO_POSTO_ID_FULL = "hs_relatorio_posto_medida.to_posto_id"; + public static final int TO_POSTO_ID_INDEX = 1; + public static final String MEDIDA_ID = "medida_id"; + public static final String MEDIDA_ID_FULL = "hs_relatorio_posto_medida.medida_id"; + public static final int MEDIDA_ID_INDEX = 2; + public static final String TO_MEDIDA_ID = "to_medida_id"; + public static final String TO_MEDIDA_ID_FULL = "hs_relatorio_posto_medida.to_medida_id"; + public static final int TO_MEDIDA_ID_INDEX = 3; + public static final String IS_PLANO_ACTUACAO = "is_plano_actuacao"; + public static final String IS_PLANO_ACTUACAO_FULL = "hs_relatorio_posto_medida.is_plano_actuacao"; + public static final int IS_PLANO_ACTUACAO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + IS_PLANO_ACTUACAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + IS_PLANO_ACTUACAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + POSTO_ID, MEDIDA_ID, IS_PLANO_ACTUACAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + POSTO_ID, MEDIDA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + POSTO_ID, MEDIDA_ID, IS_PLANO_ACTUACAO, }; + + private Integer posto_id; + private db.data.siprp_local.outer.HsRelatorioPostoData to_posto_id; + private Integer medida_id; + private db.data.siprp_local.outer.HsRelatorioMedidaData to_medida_id; + private Boolean is_plano_actuacao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioPostoMedida() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false }; + } + + public Integer getPosto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.posto_id; + } + + public void setPosto_id( Integer posto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( POSTO_ID, posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.posto_id = posto_id; + LAZY_LOADED_OBJECTS.put( POSTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioPostoData toPosto_id() + { + try + { + prepare( TO_POSTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_posto_id; + } + + public void setToPosto_id( db.data.siprp_local.outer.HsRelatorioPostoData to_posto_id ) + { + try + { + preProcess( TO_POSTO_ID, to_posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_posto_id = to_posto_id; + } + + public Integer getMedida_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDIDA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medida_id; + } + + public void setMedida_id( Integer medida_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MEDIDA_ID, medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medida_id = medida_id; + LAZY_LOADED_OBJECTS.put( MEDIDA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioMedidaData toMedida_id() + { + try + { + prepare( TO_MEDIDA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medida_id; + } + + public void setToMedida_id( db.data.siprp_local.outer.HsRelatorioMedidaData to_medida_id ) + { + try + { + preProcess( TO_MEDIDA_ID, to_medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medida_id = to_medida_id; + } + + public Boolean getIs_plano_actuacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_PLANO_ACTUACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_plano_actuacao; + } + + public void setIs_plano_actuacao( Boolean is_plano_actuacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( IS_PLANO_ACTUACAO, is_plano_actuacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_plano_actuacao = is_plano_actuacao; + LAZY_LOADED_OBJECTS.put( IS_PLANO_ACTUACAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoMedida.POSTO_ID_INDEX: + value = getPosto_id(); + break; + case HsRelatorioPostoMedida.TO_POSTO_ID_INDEX: + value = toPosto_id(); + break; + case HsRelatorioPostoMedida.MEDIDA_ID_INDEX: + value = getMedida_id(); + break; + case HsRelatorioPostoMedida.TO_MEDIDA_ID_INDEX: + value = toMedida_id(); + break; + case HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX: + value = getIs_plano_actuacao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoMedida.POSTO_ID_INDEX: + value = this.posto_id; + break; + case HsRelatorioPostoMedida.TO_POSTO_ID_INDEX: + value = this.to_posto_id; + break; + case HsRelatorioPostoMedida.MEDIDA_ID_INDEX: + value = this.medida_id; + break; + case HsRelatorioPostoMedida.TO_MEDIDA_ID_INDEX: + value = this.to_medida_id; + break; + case HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX: + value = this.is_plano_actuacao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoMedida.POSTO_ID_INDEX: + setPosto_id( ( Integer ) value ); + break; + case HsRelatorioPostoMedida.TO_POSTO_ID_INDEX: + setToPosto_id( ( db.data.siprp_local.outer.HsRelatorioPostoData ) value ); + break; + case HsRelatorioPostoMedida.MEDIDA_ID_INDEX: + setMedida_id( ( Integer ) value ); + break; + case HsRelatorioPostoMedida.TO_MEDIDA_ID_INDEX: + setToMedida_id( ( db.data.siprp_local.outer.HsRelatorioMedidaData ) value ); + break; + case HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX: + setIs_plano_actuacao( ( Boolean ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoMedida.POSTO_ID_INDEX: + this.posto_id = ( Integer ) value; + break; + case HsRelatorioPostoMedida.TO_POSTO_ID_INDEX: + this.to_posto_id = ( db.data.siprp_local.outer.HsRelatorioPostoData ) value; + break; + case HsRelatorioPostoMedida.MEDIDA_ID_INDEX: + this.medida_id = ( Integer ) value; + break; + case HsRelatorioPostoMedida.TO_MEDIDA_ID_INDEX: + this.to_medida_id = ( db.data.siprp_local.outer.HsRelatorioMedidaData ) value; + break; + case HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX: + this.is_plano_actuacao = ( Boolean ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsRelatorioPostoMedida is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioPostoMedida.POSTO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoMedida.TO_POSTO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioPostoData.class; + break; + case HsRelatorioPostoMedida.MEDIDA_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoMedida.TO_MEDIDA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioMedidaData.class; + break; + case HsRelatorioPostoMedida.IS_PLANO_ACTUACAO_INDEX: + theClass = Boolean.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioPostoMedida._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioPostoMedida.PK_FIELD_NAMES ); + primaryKey.set( 0, getPosto_id() ); + primaryKey.set( 1, getMedida_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPostoRisco.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPostoRisco.java new file mode 100644 index 00000000..642653dc --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioPostoRisco.java @@ -0,0 +1,633 @@ +/* +* HsRelatorioPostoRisco.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioPostoRisco extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPostoRisco.CLASS_IDENTIFIER, HsRelatorioPostoRisco.POSTO_ID, HsRelatorioPostoRisco.TO_POSTO_ID ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.POSTO_ID, HsRelatorioPostoRisco.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.POSTO_ID_FULL, HsRelatorioPostoRisco.POSTO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.TO_POSTO_ID, HsRelatorioPostoRisco.TO_POSTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPostoRisco.CLASS_IDENTIFIER, HsRelatorioPostoRisco.RISCO_ID, HsRelatorioPostoRisco.TO_RISCO_ID ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.RISCO_ID, HsRelatorioPostoRisco.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.RISCO_ID_FULL, HsRelatorioPostoRisco.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.TO_RISCO_ID, HsRelatorioPostoRisco.TO_RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.PROBABILIDADE, HsRelatorioPostoRisco.PROBABILIDADE_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.PROBABILIDADE_FULL, HsRelatorioPostoRisco.PROBABILIDADE_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.SEVERIDADE, HsRelatorioPostoRisco.SEVERIDADE_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.SEVERIDADE_FULL, HsRelatorioPostoRisco.SEVERIDADE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioPostoRisco.CLASS_IDENTIFIER, HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID, HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID, HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_FULL, HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID, HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.ORDEM, HsRelatorioPostoRisco.ORDEM_INDEX ); + FIELD_INDEXES.put( HsRelatorioPostoRisco.ORDEM_FULL, HsRelatorioPostoRisco.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyposto_idTohs_relatorio_posto = + new com.evolute.entity.ForeignKey( HsRelatorioPostoRisco.class, HsRelatorioPostoRisco.POSTO_ID, db.data.siprp_local.outer.HsRelatorioPostoData.class, db.data.siprp_local.outer.HsRelatorioPostoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyrisco_idTohs_relatorio_risco = + new com.evolute.entity.ForeignKey( HsRelatorioPostoRisco.class, HsRelatorioPostoRisco.RISCO_ID, db.data.siprp_local.outer.HsRelatorioRiscoData.class, db.data.siprp_local.outer.HsRelatorioRiscoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyvalor_qualitativo_idTohs_relatorio_risco_valor_qualitativo = + new com.evolute.entity.ForeignKey( HsRelatorioPostoRisco.class, HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID, db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData.class, db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData.ID ); + + public static final String TABLENAME = "hs_relatorio_posto_risco"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_posto_risco"; + + public static final int _INVALID__INDEX = -1; + public static final String POSTO_ID = "posto_id"; + public static final String POSTO_ID_FULL = "hs_relatorio_posto_risco.posto_id"; + public static final int POSTO_ID_INDEX = 0; + public static final String TO_POSTO_ID = "to_posto_id"; + public static final String TO_POSTO_ID_FULL = "hs_relatorio_posto_risco.to_posto_id"; + public static final int TO_POSTO_ID_INDEX = 1; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "hs_relatorio_posto_risco.risco_id"; + public static final int RISCO_ID_INDEX = 2; + public static final String TO_RISCO_ID = "to_risco_id"; + public static final String TO_RISCO_ID_FULL = "hs_relatorio_posto_risco.to_risco_id"; + public static final int TO_RISCO_ID_INDEX = 3; + public static final String PROBABILIDADE = "probabilidade"; + public static final String PROBABILIDADE_FULL = "hs_relatorio_posto_risco.probabilidade"; + public static final int PROBABILIDADE_INDEX = 4; + public static final String SEVERIDADE = "severidade"; + public static final String SEVERIDADE_FULL = "hs_relatorio_posto_risco.severidade"; + public static final int SEVERIDADE_INDEX = 5; + public static final String VALOR_QUALITATIVO_ID = "valor_qualitativo_id"; + public static final String VALOR_QUALITATIVO_ID_FULL = "hs_relatorio_posto_risco.valor_qualitativo_id"; + public static final int VALOR_QUALITATIVO_ID_INDEX = 6; + public static final String TO_VALOR_QUALITATIVO_ID = "to_valor_qualitativo_id"; + public static final String TO_VALOR_QUALITATIVO_ID_FULL = "hs_relatorio_posto_risco.to_valor_qualitativo_id"; + public static final int TO_VALOR_QUALITATIVO_ID_INDEX = 7; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "hs_relatorio_posto_risco.ordem"; + public static final int ORDEM_INDEX = 8; + + public static final String FIELD_NAMES[] = new String[]{ + PROBABILIDADE, SEVERIDADE, VALOR_QUALITATIVO_ID, TO_VALOR_QUALITATIVO_ID, + ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PROBABILIDADE, TABLENAME + "." + SEVERIDADE, TABLENAME + "." + VALOR_QUALITATIVO_ID, TABLENAME + "." + TO_VALOR_QUALITATIVO_ID, + TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + POSTO_ID, RISCO_ID, PROBABILIDADE, SEVERIDADE, VALOR_QUALITATIVO_ID, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + POSTO_ID, RISCO_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + POSTO_ID, RISCO_ID, PROBABILIDADE, SEVERIDADE, VALOR_QUALITATIVO_ID, ORDEM, }; + + private Integer posto_id; + private db.data.siprp_local.outer.HsRelatorioPostoData to_posto_id; + private Integer risco_id; + private db.data.siprp_local.outer.HsRelatorioRiscoData to_risco_id; + private Integer probabilidade; + private Integer severidade; + private Integer valor_qualitativo_id; + private db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData to_valor_qualitativo_id; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioPostoRisco() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false, false, false }; + } + + public Integer getPosto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( POSTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.posto_id; + } + + public void setPosto_id( Integer posto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( POSTO_ID, posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.posto_id = posto_id; + LAZY_LOADED_OBJECTS.put( POSTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioPostoData toPosto_id() + { + try + { + prepare( TO_POSTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_posto_id; + } + + public void setToPosto_id( db.data.siprp_local.outer.HsRelatorioPostoData to_posto_id ) + { + try + { + preProcess( TO_POSTO_ID, to_posto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_posto_id = to_posto_id; + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioRiscoData toRisco_id() + { + try + { + prepare( TO_RISCO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_risco_id; + } + + public void setToRisco_id( db.data.siprp_local.outer.HsRelatorioRiscoData to_risco_id ) + { + try + { + preProcess( TO_RISCO_ID, to_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_risco_id = to_risco_id; + } + + public Integer getProbabilidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROBABILIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.probabilidade; + } + + public void setProbabilidade( Integer probabilidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROBABILIDADE, probabilidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.probabilidade = probabilidade; + LAZY_LOADED_OBJECTS.put( PROBABILIDADE, Boolean.TRUE ); + } + + public Integer getSeveridade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEVERIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.severidade; + } + + public void setSeveridade( Integer severidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( SEVERIDADE, severidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.severidade = severidade; + LAZY_LOADED_OBJECTS.put( SEVERIDADE, Boolean.TRUE ); + } + + public Integer getValor_qualitativo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( VALOR_QUALITATIVO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.valor_qualitativo_id; + } + + public void setValor_qualitativo_id( Integer valor_qualitativo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( VALOR_QUALITATIVO_ID, valor_qualitativo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.valor_qualitativo_id = valor_qualitativo_id; + LAZY_LOADED_OBJECTS.put( VALOR_QUALITATIVO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData toValor_qualitativo_id() + { + try + { + prepare( TO_VALOR_QUALITATIVO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_valor_qualitativo_id; + } + + public void setToValor_qualitativo_id( db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData to_valor_qualitativo_id ) + { + try + { + preProcess( TO_VALOR_QUALITATIVO_ID, to_valor_qualitativo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_valor_qualitativo_id = to_valor_qualitativo_id; + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoRisco.POSTO_ID_INDEX: + value = getPosto_id(); + break; + case HsRelatorioPostoRisco.TO_POSTO_ID_INDEX: + value = toPosto_id(); + break; + case HsRelatorioPostoRisco.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case HsRelatorioPostoRisco.TO_RISCO_ID_INDEX: + value = toRisco_id(); + break; + case HsRelatorioPostoRisco.PROBABILIDADE_INDEX: + value = getProbabilidade(); + break; + case HsRelatorioPostoRisco.SEVERIDADE_INDEX: + value = getSeveridade(); + break; + case HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX: + value = getValor_qualitativo_id(); + break; + case HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID_INDEX: + value = toValor_qualitativo_id(); + break; + case HsRelatorioPostoRisco.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoRisco.POSTO_ID_INDEX: + value = this.posto_id; + break; + case HsRelatorioPostoRisco.TO_POSTO_ID_INDEX: + value = this.to_posto_id; + break; + case HsRelatorioPostoRisco.RISCO_ID_INDEX: + value = this.risco_id; + break; + case HsRelatorioPostoRisco.TO_RISCO_ID_INDEX: + value = this.to_risco_id; + break; + case HsRelatorioPostoRisco.PROBABILIDADE_INDEX: + value = this.probabilidade; + break; + case HsRelatorioPostoRisco.SEVERIDADE_INDEX: + value = this.severidade; + break; + case HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX: + value = this.valor_qualitativo_id; + break; + case HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID_INDEX: + value = this.to_valor_qualitativo_id; + break; + case HsRelatorioPostoRisco.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoRisco.POSTO_ID_INDEX: + setPosto_id( ( Integer ) value ); + break; + case HsRelatorioPostoRisco.TO_POSTO_ID_INDEX: + setToPosto_id( ( db.data.siprp_local.outer.HsRelatorioPostoData ) value ); + break; + case HsRelatorioPostoRisco.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case HsRelatorioPostoRisco.TO_RISCO_ID_INDEX: + setToRisco_id( ( db.data.siprp_local.outer.HsRelatorioRiscoData ) value ); + break; + case HsRelatorioPostoRisco.PROBABILIDADE_INDEX: + setProbabilidade( ( Integer ) value ); + break; + case HsRelatorioPostoRisco.SEVERIDADE_INDEX: + setSeveridade( ( Integer ) value ); + break; + case HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX: + setValor_qualitativo_id( ( Integer ) value ); + break; + case HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID_INDEX: + setToValor_qualitativo_id( ( db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData ) value ); + break; + case HsRelatorioPostoRisco.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioPostoRisco.POSTO_ID_INDEX: + this.posto_id = ( Integer ) value; + break; + case HsRelatorioPostoRisco.TO_POSTO_ID_INDEX: + this.to_posto_id = ( db.data.siprp_local.outer.HsRelatorioPostoData ) value; + break; + case HsRelatorioPostoRisco.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case HsRelatorioPostoRisco.TO_RISCO_ID_INDEX: + this.to_risco_id = ( db.data.siprp_local.outer.HsRelatorioRiscoData ) value; + break; + case HsRelatorioPostoRisco.PROBABILIDADE_INDEX: + this.probabilidade = ( Integer ) value; + break; + case HsRelatorioPostoRisco.SEVERIDADE_INDEX: + this.severidade = ( Integer ) value; + break; + case HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX: + this.valor_qualitativo_id = ( Integer ) value; + break; + case HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID_INDEX: + this.to_valor_qualitativo_id = ( db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData ) value; + break; + case HsRelatorioPostoRisco.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsRelatorioPostoRisco is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioPostoRisco.POSTO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoRisco.TO_POSTO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioPostoData.class; + break; + case HsRelatorioPostoRisco.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoRisco.TO_RISCO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioRiscoData.class; + break; + case HsRelatorioPostoRisco.PROBABILIDADE_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoRisco.SEVERIDADE_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoRisco.VALOR_QUALITATIVO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioPostoRisco.TO_VALOR_QUALITATIVO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioRiscoValorQualitativoData.class; + break; + case HsRelatorioPostoRisco.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioPostoRisco._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioPostoRisco.PK_FIELD_NAMES ); + primaryKey.set( 0, getPosto_id() ); + primaryKey.set( 1, getRisco_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioRisco.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioRisco.java new file mode 100644 index 00000000..37522719 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioRisco.java @@ -0,0 +1,509 @@ +/* +* HsRelatorioRisco.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioRisco extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRelatorioRisco.ID, HsRelatorioRisco.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.ID_FULL, HsRelatorioRisco.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRelatorioRisco.CLASS_IDENTIFIER, HsRelatorioRisco.RELATORIO_ID, HsRelatorioRisco.TO_RELATORIO_ID ); + FIELD_INDEXES.put( HsRelatorioRisco.RELATORIO_ID, HsRelatorioRisco.RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.RELATORIO_ID_FULL, HsRelatorioRisco.RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.TO_RELATORIO_ID, HsRelatorioRisco.TO_RELATORIO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.DESCRIPTION, HsRelatorioRisco.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.DESCRIPTION_FULL, HsRelatorioRisco.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.DELETED_DATE, HsRelatorioRisco.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.DELETED_DATE_FULL, HsRelatorioRisco.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.HS_RISCO_ID, HsRelatorioRisco.HS_RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRisco.HS_RISCO_ID_FULL, HsRelatorioRisco.HS_RISCO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrelatorio_idTohs_relatorio = + new com.evolute.entity.ForeignKey( HsRelatorioRisco.class, HsRelatorioRisco.RELATORIO_ID, db.data.siprp_local.outer.HsRelatorioData.class, db.data.siprp_local.outer.HsRelatorioData.ID ); + + public static final String TABLENAME = "hs_relatorio_risco"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_risco"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_risco.id"; + public static final int ID_INDEX = 0; + public static final String RELATORIO_ID = "relatorio_id"; + public static final String RELATORIO_ID_FULL = "hs_relatorio_risco.relatorio_id"; + public static final int RELATORIO_ID_INDEX = 1; + public static final String TO_RELATORIO_ID = "to_relatorio_id"; + public static final String TO_RELATORIO_ID_FULL = "hs_relatorio_risco.to_relatorio_id"; + public static final int TO_RELATORIO_ID_INDEX = 2; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_relatorio_risco.description"; + public static final int DESCRIPTION_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_relatorio_risco.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + public static final String HS_RISCO_ID = "hs_risco_id"; + public static final String HS_RISCO_ID_FULL = "hs_relatorio_risco.hs_risco_id"; + public static final int HS_RISCO_ID_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + RELATORIO_ID, TO_RELATORIO_ID, DESCRIPTION, DELETED_DATE, HS_RISCO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + RELATORIO_ID, TABLENAME + "." + TO_RELATORIO_ID, TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, TABLENAME + "." + HS_RISCO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, RELATORIO_ID, DESCRIPTION, DELETED_DATE, HS_RISCO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, RELATORIO_ID, DESCRIPTION, DELETED_DATE, HS_RISCO_ID, }; + + private Integer id; + private Integer relatorio_id; + private db.data.siprp_local.outer.HsRelatorioData to_relatorio_id; + private String description; + private java.sql.Timestamp deleted_date; + private Integer hs_risco_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioRisco() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRelatorioMedida_risco_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioMedidaData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioPostoRisco_risco_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getRelatorio_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RELATORIO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.relatorio_id; + } + + public void setRelatorio_id( Integer relatorio_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RELATORIO_ID, relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.relatorio_id = relatorio_id; + LAZY_LOADED_OBJECTS.put( RELATORIO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRelatorioData toRelatorio_id() + { + try + { + prepare( TO_RELATORIO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_relatorio_id; + } + + public void setToRelatorio_id( db.data.siprp_local.outer.HsRelatorioData to_relatorio_id ) + { + try + { + preProcess( TO_RELATORIO_ID, to_relatorio_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_relatorio_id = to_relatorio_id; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getHs_risco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( HS_RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.hs_risco_id; + } + + public void setHs_risco_id( Integer hs_risco_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( HS_RISCO_ID, hs_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.hs_risco_id = hs_risco_id; + LAZY_LOADED_OBJECTS.put( HS_RISCO_ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRisco.ID_INDEX: + value = getId(); + break; + case HsRelatorioRisco.RELATORIO_ID_INDEX: + value = getRelatorio_id(); + break; + case HsRelatorioRisco.TO_RELATORIO_ID_INDEX: + value = toRelatorio_id(); + break; + case HsRelatorioRisco.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsRelatorioRisco.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case HsRelatorioRisco.HS_RISCO_ID_INDEX: + value = getHs_risco_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRisco.ID_INDEX: + value = this.id; + break; + case HsRelatorioRisco.RELATORIO_ID_INDEX: + value = this.relatorio_id; + break; + case HsRelatorioRisco.TO_RELATORIO_ID_INDEX: + value = this.to_relatorio_id; + break; + case HsRelatorioRisco.DESCRIPTION_INDEX: + value = this.description; + break; + case HsRelatorioRisco.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case HsRelatorioRisco.HS_RISCO_ID_INDEX: + value = this.hs_risco_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRisco.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioRisco.RELATORIO_ID_INDEX: + setRelatorio_id( ( Integer ) value ); + break; + case HsRelatorioRisco.TO_RELATORIO_ID_INDEX: + setToRelatorio_id( ( db.data.siprp_local.outer.HsRelatorioData ) value ); + break; + case HsRelatorioRisco.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsRelatorioRisco.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case HsRelatorioRisco.HS_RISCO_ID_INDEX: + setHs_risco_id( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRisco.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioRisco.RELATORIO_ID_INDEX: + this.relatorio_id = ( Integer ) value; + break; + case HsRelatorioRisco.TO_RELATORIO_ID_INDEX: + this.to_relatorio_id = ( db.data.siprp_local.outer.HsRelatorioData ) value; + break; + case HsRelatorioRisco.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsRelatorioRisco.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case HsRelatorioRisco.HS_RISCO_ID_INDEX: + this.hs_risco_id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioRisco.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioRisco.RELATORIO_ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioRisco.TO_RELATORIO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRelatorioData.class; + break; + case HsRelatorioRisco.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsRelatorioRisco.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case HsRelatorioRisco.HS_RISCO_ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioRisco._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioRisco.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioRiscoValorQualitativo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioRiscoValorQualitativo.java new file mode 100644 index 00000000..6be1a01b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRelatorioRiscoValorQualitativo.java @@ -0,0 +1,308 @@ +/* +* HsRelatorioRiscoValorQualitativo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRelatorioRiscoValorQualitativo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRelatorioRiscoValorQualitativo.ID, HsRelatorioRiscoValorQualitativo.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRiscoValorQualitativo.ID_FULL, HsRelatorioRiscoValorQualitativo.ID_INDEX ); + FIELD_INDEXES.put( HsRelatorioRiscoValorQualitativo.DESCRIPTION, HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRelatorioRiscoValorQualitativo.DESCRIPTION_FULL, HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_relatorio_risco_valor_qualitativo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_relatorio_risco_valor_qualitativo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_relatorio_risco_valor_qualitativo.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_relatorio_risco_valor_qualitativo.description"; + public static final int DESCRIPTION_INDEX = 1; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, }; + + private Integer id; + private String description; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRelatorioRiscoValorQualitativo() + { + super(); + dirtyProperties = new boolean[]{ false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsPostoRisco_valor_qualitativo() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "valor_qualitativo" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRelatorioPostoRisco_valor_qualitativo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "valor_qualitativo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRiscoValorQualitativo.ID_INDEX: + value = getId(); + break; + case HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX: + value = getDescription(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRiscoValorQualitativo.ID_INDEX: + value = this.id; + break; + case HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX: + value = this.description; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRiscoValorQualitativo.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRelatorioRiscoValorQualitativo.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRelatorioRiscoValorQualitativo.ID_INDEX: + theClass = Integer.class; + break; + case HsRelatorioRiscoValorQualitativo.DESCRIPTION_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRelatorioRiscoValorQualitativo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRelatorioRiscoValorQualitativo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRisco.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRisco.java new file mode 100644 index 00000000..35ff90c2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRisco.java @@ -0,0 +1,473 @@ +/* +* HsRisco.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRisco extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRisco.ID, HsRisco.ID_INDEX ); + FIELD_INDEXES.put( HsRisco.ID_FULL, HsRisco.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRisco.CLASS_IDENTIFIER, HsRisco.TEMA_ID, HsRisco.TO_TEMA_ID ); + FIELD_INDEXES.put( HsRisco.TEMA_ID, HsRisco.TEMA_ID_INDEX ); + FIELD_INDEXES.put( HsRisco.TEMA_ID_FULL, HsRisco.TEMA_ID_INDEX ); + FIELD_INDEXES.put( HsRisco.TO_TEMA_ID, HsRisco.TO_TEMA_ID_INDEX ); + FIELD_INDEXES.put( HsRisco.DESCRIPTION, HsRisco.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRisco.DESCRIPTION_FULL, HsRisco.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRisco.DELETED_DATE, HsRisco.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRisco.DELETED_DATE_FULL, HsRisco.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytema_idTohs_risco_tema = + new com.evolute.entity.ForeignKey( HsRisco.class, HsRisco.TEMA_ID, db.data.siprp_local.outer.HsRiscoTemaData.class, db.data.siprp_local.outer.HsRiscoTemaData.ID ); + + public static final String TABLENAME = "hs_risco"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_risco"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_risco.id"; + public static final int ID_INDEX = 0; + public static final String TEMA_ID = "tema_id"; + public static final String TEMA_ID_FULL = "hs_risco.tema_id"; + public static final int TEMA_ID_INDEX = 1; + public static final String TO_TEMA_ID = "to_tema_id"; + public static final String TO_TEMA_ID_FULL = "hs_risco.to_tema_id"; + public static final int TO_TEMA_ID_INDEX = 2; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_risco.description"; + public static final int DESCRIPTION_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_risco.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + TEMA_ID, TO_TEMA_ID, DESCRIPTION, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TEMA_ID, TABLENAME + "." + TO_TEMA_ID, TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TEMA_ID, DESCRIPTION, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TEMA_ID, DESCRIPTION, DELETED_DATE, }; + + private Integer id; + private Integer tema_id; + private db.data.siprp_local.outer.HsRiscoTemaData to_tema_id; + private String description; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRisco() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsPostoRisco_risco_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsPostoRiscoData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRiscoEmpresa_risco_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRiscoEmpresaData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromHsRiscoMedida_risco_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRiscoMedidaData.class , getPrimaryKey().getMap().get("id"), "risco_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getTema_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TEMA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tema_id; + } + + public void setTema_id( Integer tema_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TEMA_ID, tema_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tema_id = tema_id; + LAZY_LOADED_OBJECTS.put( TEMA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRiscoTemaData toTema_id() + { + try + { + prepare( TO_TEMA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tema_id; + } + + public void setToTema_id( db.data.siprp_local.outer.HsRiscoTemaData to_tema_id ) + { + try + { + preProcess( TO_TEMA_ID, to_tema_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tema_id = to_tema_id; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRisco.ID_INDEX: + value = getId(); + break; + case HsRisco.TEMA_ID_INDEX: + value = getTema_id(); + break; + case HsRisco.TO_TEMA_ID_INDEX: + value = toTema_id(); + break; + case HsRisco.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsRisco.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRisco.ID_INDEX: + value = this.id; + break; + case HsRisco.TEMA_ID_INDEX: + value = this.tema_id; + break; + case HsRisco.TO_TEMA_ID_INDEX: + value = this.to_tema_id; + break; + case HsRisco.DESCRIPTION_INDEX: + value = this.description; + break; + case HsRisco.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRisco.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRisco.TEMA_ID_INDEX: + setTema_id( ( Integer ) value ); + break; + case HsRisco.TO_TEMA_ID_INDEX: + setToTema_id( ( db.data.siprp_local.outer.HsRiscoTemaData ) value ); + break; + case HsRisco.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsRisco.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRisco.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRisco.TEMA_ID_INDEX: + this.tema_id = ( Integer ) value; + break; + case HsRisco.TO_TEMA_ID_INDEX: + this.to_tema_id = ( db.data.siprp_local.outer.HsRiscoTemaData ) value; + break; + case HsRisco.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsRisco.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRisco.ID_INDEX: + theClass = Integer.class; + break; + case HsRisco.TEMA_ID_INDEX: + theClass = Integer.class; + break; + case HsRisco.TO_TEMA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRiscoTemaData.class; + break; + case HsRisco.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsRisco.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRisco._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRisco.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoEmpresa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoEmpresa.java new file mode 100644 index 00000000..b8b38a4b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoEmpresa.java @@ -0,0 +1,381 @@ +/* +* HsRiscoEmpresa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRiscoEmpresa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRiscoEmpresa.CLASS_IDENTIFIER, HsRiscoEmpresa.RISCO_ID, HsRiscoEmpresa.TO_RISCO_ID ); + FIELD_INDEXES.put( HsRiscoEmpresa.RISCO_ID, HsRiscoEmpresa.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoEmpresa.RISCO_ID_FULL, HsRiscoEmpresa.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoEmpresa.TO_RISCO_ID, HsRiscoEmpresa.TO_RISCO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRiscoEmpresa.CLASS_IDENTIFIER, HsRiscoEmpresa.EMPRESA_ID, HsRiscoEmpresa.TO_EMPRESA_ID ); + FIELD_INDEXES.put( HsRiscoEmpresa.EMPRESA_ID, HsRiscoEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoEmpresa.EMPRESA_ID_FULL, HsRiscoEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoEmpresa.TO_EMPRESA_ID, HsRiscoEmpresa.TO_EMPRESA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrisco_idTohs_risco = + new com.evolute.entity.ForeignKey( HsRiscoEmpresa.class, HsRiscoEmpresa.RISCO_ID, db.data.siprp_local.outer.HsRiscoData.class, db.data.siprp_local.outer.HsRiscoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( HsRiscoEmpresa.class, HsRiscoEmpresa.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "hs_risco_empresa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_risco_empresa"; + + public static final int _INVALID__INDEX = -1; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "hs_risco_empresa.risco_id"; + public static final int RISCO_ID_INDEX = 0; + public static final String TO_RISCO_ID = "to_risco_id"; + public static final String TO_RISCO_ID_FULL = "hs_risco_empresa.to_risco_id"; + public static final int TO_RISCO_ID_INDEX = 1; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "hs_risco_empresa.empresa_id"; + public static final int EMPRESA_ID_INDEX = 2; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "hs_risco_empresa.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + RISCO_ID, EMPRESA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + RISCO_ID, EMPRESA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + RISCO_ID, EMPRESA_ID, }; + + private Integer risco_id; + private db.data.siprp_local.outer.HsRiscoData to_risco_id; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRiscoEmpresa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRiscoData toRisco_id() + { + try + { + prepare( TO_RISCO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_risco_id; + } + + public void setToRisco_id( db.data.siprp_local.outer.HsRiscoData to_risco_id ) + { + try + { + preProcess( TO_RISCO_ID, to_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_risco_id = to_risco_id; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoEmpresa.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case HsRiscoEmpresa.TO_RISCO_ID_INDEX: + value = toRisco_id(); + break; + case HsRiscoEmpresa.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case HsRiscoEmpresa.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoEmpresa.RISCO_ID_INDEX: + value = this.risco_id; + break; + case HsRiscoEmpresa.TO_RISCO_ID_INDEX: + value = this.to_risco_id; + break; + case HsRiscoEmpresa.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case HsRiscoEmpresa.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoEmpresa.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case HsRiscoEmpresa.TO_RISCO_ID_INDEX: + setToRisco_id( ( db.data.siprp_local.outer.HsRiscoData ) value ); + break; + case HsRiscoEmpresa.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case HsRiscoEmpresa.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoEmpresa.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case HsRiscoEmpresa.TO_RISCO_ID_INDEX: + this.to_risco_id = ( db.data.siprp_local.outer.HsRiscoData ) value; + break; + case HsRiscoEmpresa.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case HsRiscoEmpresa.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsRiscoEmpresa is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRiscoEmpresa.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case HsRiscoEmpresa.TO_RISCO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRiscoData.class; + break; + case HsRiscoEmpresa.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case HsRiscoEmpresa.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRiscoEmpresa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRiscoEmpresa.PK_FIELD_NAMES ); + primaryKey.set( 0, getRisco_id() ); + primaryKey.set( 1, getEmpresa_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoMedida.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoMedida.java new file mode 100644 index 00000000..6a9c6901 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoMedida.java @@ -0,0 +1,381 @@ +/* +* HsRiscoMedida.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRiscoMedida extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + com.evolute.entity.evo.EvoDataObject.register( HsRiscoMedida.CLASS_IDENTIFIER, HsRiscoMedida.RISCO_ID, HsRiscoMedida.TO_RISCO_ID ); + FIELD_INDEXES.put( HsRiscoMedida.RISCO_ID, HsRiscoMedida.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoMedida.RISCO_ID_FULL, HsRiscoMedida.RISCO_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoMedida.TO_RISCO_ID, HsRiscoMedida.TO_RISCO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( HsRiscoMedida.CLASS_IDENTIFIER, HsRiscoMedida.MEDIDA_ID, HsRiscoMedida.TO_MEDIDA_ID ); + FIELD_INDEXES.put( HsRiscoMedida.MEDIDA_ID, HsRiscoMedida.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoMedida.MEDIDA_ID_FULL, HsRiscoMedida.MEDIDA_ID_INDEX ); + FIELD_INDEXES.put( HsRiscoMedida.TO_MEDIDA_ID, HsRiscoMedida.TO_MEDIDA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyrisco_idTohs_risco = + new com.evolute.entity.ForeignKey( HsRiscoMedida.class, HsRiscoMedida.RISCO_ID, db.data.siprp_local.outer.HsRiscoData.class, db.data.siprp_local.outer.HsRiscoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymedida_idTohs_medida = + new com.evolute.entity.ForeignKey( HsRiscoMedida.class, HsRiscoMedida.MEDIDA_ID, db.data.siprp_local.outer.HsMedidaData.class, db.data.siprp_local.outer.HsMedidaData.ID ); + + public static final String TABLENAME = "hs_risco_medida"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_risco_medida"; + + public static final int _INVALID__INDEX = -1; + public static final String RISCO_ID = "risco_id"; + public static final String RISCO_ID_FULL = "hs_risco_medida.risco_id"; + public static final int RISCO_ID_INDEX = 0; + public static final String TO_RISCO_ID = "to_risco_id"; + public static final String TO_RISCO_ID_FULL = "hs_risco_medida.to_risco_id"; + public static final int TO_RISCO_ID_INDEX = 1; + public static final String MEDIDA_ID = "medida_id"; + public static final String MEDIDA_ID_FULL = "hs_risco_medida.medida_id"; + public static final int MEDIDA_ID_INDEX = 2; + public static final String TO_MEDIDA_ID = "to_medida_id"; + public static final String TO_MEDIDA_ID_FULL = "hs_risco_medida.to_medida_id"; + public static final int TO_MEDIDA_ID_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + RISCO_ID, MEDIDA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + RISCO_ID, MEDIDA_ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + RISCO_ID, MEDIDA_ID, }; + + private Integer risco_id; + private db.data.siprp_local.outer.HsRiscoData to_risco_id; + private Integer medida_id; + private db.data.siprp_local.outer.HsMedidaData to_medida_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRiscoMedida() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false }; + } + + public Integer getRisco_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( RISCO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.risco_id; + } + + public void setRisco_id( Integer risco_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( RISCO_ID, risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.risco_id = risco_id; + LAZY_LOADED_OBJECTS.put( RISCO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsRiscoData toRisco_id() + { + try + { + prepare( TO_RISCO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_risco_id; + } + + public void setToRisco_id( db.data.siprp_local.outer.HsRiscoData to_risco_id ) + { + try + { + preProcess( TO_RISCO_ID, to_risco_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_risco_id = to_risco_id; + } + + public Integer getMedida_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDIDA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medida_id; + } + + public void setMedida_id( Integer medida_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MEDIDA_ID, medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medida_id = medida_id; + LAZY_LOADED_OBJECTS.put( MEDIDA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.HsMedidaData toMedida_id() + { + try + { + prepare( TO_MEDIDA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_medida_id; + } + + public void setToMedida_id( db.data.siprp_local.outer.HsMedidaData to_medida_id ) + { + try + { + preProcess( TO_MEDIDA_ID, to_medida_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_medida_id = to_medida_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoMedida.RISCO_ID_INDEX: + value = getRisco_id(); + break; + case HsRiscoMedida.TO_RISCO_ID_INDEX: + value = toRisco_id(); + break; + case HsRiscoMedida.MEDIDA_ID_INDEX: + value = getMedida_id(); + break; + case HsRiscoMedida.TO_MEDIDA_ID_INDEX: + value = toMedida_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoMedida.RISCO_ID_INDEX: + value = this.risco_id; + break; + case HsRiscoMedida.TO_RISCO_ID_INDEX: + value = this.to_risco_id; + break; + case HsRiscoMedida.MEDIDA_ID_INDEX: + value = this.medida_id; + break; + case HsRiscoMedida.TO_MEDIDA_ID_INDEX: + value = this.to_medida_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoMedida.RISCO_ID_INDEX: + setRisco_id( ( Integer ) value ); + break; + case HsRiscoMedida.TO_RISCO_ID_INDEX: + setToRisco_id( ( db.data.siprp_local.outer.HsRiscoData ) value ); + break; + case HsRiscoMedida.MEDIDA_ID_INDEX: + setMedida_id( ( Integer ) value ); + break; + case HsRiscoMedida.TO_MEDIDA_ID_INDEX: + setToMedida_id( ( db.data.siprp_local.outer.HsMedidaData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoMedida.RISCO_ID_INDEX: + this.risco_id = ( Integer ) value; + break; + case HsRiscoMedida.TO_RISCO_ID_INDEX: + this.to_risco_id = ( db.data.siprp_local.outer.HsRiscoData ) value; + break; + case HsRiscoMedida.MEDIDA_ID_INDEX: + this.medida_id = ( Integer ) value; + break; + case HsRiscoMedida.TO_MEDIDA_ID_INDEX: + this.to_medida_id = ( db.data.siprp_local.outer.HsMedidaData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on HsRiscoMedida is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRiscoMedida.RISCO_ID_INDEX: + theClass = Integer.class; + break; + case HsRiscoMedida.TO_RISCO_ID_INDEX: + theClass = db.data.siprp_local.outer.HsRiscoData.class; + break; + case HsRiscoMedida.MEDIDA_ID_INDEX: + theClass = Integer.class; + break; + case HsRiscoMedida.TO_MEDIDA_ID_INDEX: + theClass = db.data.siprp_local.outer.HsMedidaData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRiscoMedida._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRiscoMedida.PK_FIELD_NAMES ); + primaryKey.set( 0, getRisco_id() ); + primaryKey.set( 1, getMedida_id() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoTema.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoTema.java new file mode 100644 index 00000000..b82bc37c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/HsRiscoTema.java @@ -0,0 +1,344 @@ +/* +* HsRiscoTema.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class HsRiscoTema extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( HsRiscoTema.ID, HsRiscoTema.ID_INDEX ); + FIELD_INDEXES.put( HsRiscoTema.ID_FULL, HsRiscoTema.ID_INDEX ); + FIELD_INDEXES.put( HsRiscoTema.DESCRIPTION, HsRiscoTema.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRiscoTema.DESCRIPTION_FULL, HsRiscoTema.DESCRIPTION_INDEX ); + FIELD_INDEXES.put( HsRiscoTema.DELETED_DATE, HsRiscoTema.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( HsRiscoTema.DELETED_DATE_FULL, HsRiscoTema.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "hs_risco_tema"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.hs_risco_tema"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "hs_risco_tema.id"; + public static final int ID_INDEX = 0; + public static final String DESCRIPTION = "description"; + public static final String DESCRIPTION_FULL = "hs_risco_tema.description"; + public static final int DESCRIPTION_INDEX = 1; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "hs_risco_tema.deleted_date"; + public static final int DELETED_DATE_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRIPTION, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRIPTION, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRIPTION, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRIPTION, DELETED_DATE, }; + + private Integer id; + private String description; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public HsRiscoTema() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRisco_tema_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRiscoData.class , getPrimaryKey().getMap().get("id"), "tema_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescription() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRIPTION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.description; + } + + public void setDescription( String description ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRIPTION, description ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.description = description; + LAZY_LOADED_OBJECTS.put( DESCRIPTION, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoTema.ID_INDEX: + value = getId(); + break; + case HsRiscoTema.DESCRIPTION_INDEX: + value = getDescription(); + break; + case HsRiscoTema.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoTema.ID_INDEX: + value = this.id; + break; + case HsRiscoTema.DESCRIPTION_INDEX: + value = this.description; + break; + case HsRiscoTema.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoTema.ID_INDEX: + setId( ( Integer ) value ); + break; + case HsRiscoTema.DESCRIPTION_INDEX: + setDescription( ( String ) value ); + break; + case HsRiscoTema.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case HsRiscoTema.ID_INDEX: + this.id = ( Integer ) value; + break; + case HsRiscoTema.DESCRIPTION_INDEX: + this.description = ( String ) value; + break; + case HsRiscoTema.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case HsRiscoTema.ID_INDEX: + theClass = Integer.class; + break; + case HsRiscoTema.DESCRIPTION_INDEX: + theClass = String.class; + break; + case HsRiscoTema.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : HsRiscoTema._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, HsRiscoTema.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Ids.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Ids.java new file mode 100644 index 00000000..42cc4252 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Ids.java @@ -0,0 +1,229 @@ +/* +* Ids.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Ids extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Ids.ID, Ids.ID_INDEX ); + FIELD_INDEXES.put( Ids.ID_FULL, Ids.ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "ids"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.ids"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "ids.id"; + public static final int ID_INDEX = 0; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, }; + + private Integer id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Ids() + { + super(); + dirtyProperties = new boolean[]{ false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Ids.ID_INDEX: + value = getId(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Ids.ID_INDEX: + value = this.id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Ids.ID_INDEX: + setId( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Ids.ID_INDEX: + this.id = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Ids.ID_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Ids._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Ids.PK_FIELD_NAMES ); + primaryKey.set( 0, getId() ); + } + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Image.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Image.java new file mode 100644 index 00000000..69e6eda8 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Image.java @@ -0,0 +1,365 @@ +/* +* Image.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Image extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Image.ID, Image.ID_INDEX ); + FIELD_INDEXES.put( Image.ID_FULL, Image.ID_INDEX ); + FIELD_INDEXES.put( Image.NAME, Image.NAME_INDEX ); + FIELD_INDEXES.put( Image.NAME_FULL, Image.NAME_INDEX ); + FIELD_INDEXES.put( Image.IMAGE_DATA, Image.IMAGE_DATA_INDEX ); + FIELD_INDEXES.put( Image.IMAGE_DATA_FULL, Image.IMAGE_DATA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "image"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.image"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "image.id"; + public static final int ID_INDEX = 0; + public static final String NAME = "name"; + public static final String NAME_FULL = "image.name"; + public static final int NAME_INDEX = 1; + public static final String IMAGE_DATA = "image_data"; + public static final String IMAGE_DATA_FULL = "image.image_data"; + public static final int IMAGE_DATA_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + NAME, IMAGE_DATA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NAME, TABLENAME + "." + IMAGE_DATA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NAME, IMAGE_DATA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NAME, }; + + private Integer id; + private String name; + private byte[] image_data; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Image() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEmpresas_empresa_logo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EmpresasData.class , getPrimaryKey().getMap().get("id"), "empresa_logo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesTecnicosHst_assinatura() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesTecnicosHstData.class , getPrimaryKey().getMap().get("id"), "assinatura" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getName() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.name; + } + + public void setName( String name ) + { + try + { + setLockedForRefresh( true ); + preProcess( NAME, name ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.name = name; + LAZY_LOADED_OBJECTS.put( NAME, Boolean.TRUE ); + } + + public byte[] getImage_data() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IMAGE_DATA ); + Boolean isLazyLoaded = isPropertyLoaded( IMAGE_DATA ); + if ( ! isLazyLoaded ) + { + this.image_data = ( byte[] ) getProvider().loadFieldFromDatabase( IMAGE_DATA, this ); + LAZY_LOADED_OBJECTS.put( IMAGE_DATA, Boolean.TRUE ); + } + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.image_data; + } + + public void setImage_data( byte[] image_data ) + { + try + { + setLockedForRefresh( true ); + preProcess( IMAGE_DATA, image_data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.image_data = image_data; + LAZY_LOADED_OBJECTS.put( IMAGE_DATA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Image.ID_INDEX: + value = getId(); + break; + case Image.NAME_INDEX: + value = getName(); + break; + case Image.IMAGE_DATA_INDEX: + value = getImage_data(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Image.ID_INDEX: + value = this.id; + break; + case Image.NAME_INDEX: + value = this.name; + break; + case Image.IMAGE_DATA_INDEX: + value = this.image_data; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Image.ID_INDEX: + setId( ( Integer ) value ); + break; + case Image.NAME_INDEX: + setName( ( String ) value ); + break; + case Image.IMAGE_DATA_INDEX: + setImage_data( ( byte[] ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Image.ID_INDEX: + this.id = ( Integer ) value; + break; + case Image.NAME_INDEX: + this.name = ( String ) value; + break; + case Image.IMAGE_DATA_INDEX: + this.image_data = ( byte[] ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Image.ID_INDEX: + theClass = Integer.class; + break; + case Image.NAME_INDEX: + theClass = String.class; + break; + case Image.IMAGE_DATA_INDEX: + theClass = byte[].class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Image._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Image.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + LAZY_LOADED_OBJECTS.put( IMAGE_DATA, Boolean.FALSE ); + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Lembretes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Lembretes.java new file mode 100644 index 00000000..598af78b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Lembretes.java @@ -0,0 +1,1505 @@ +/* +* Lembretes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Lembretes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Lembretes.ID, Lembretes.ID_INDEX ); + FIELD_INDEXES.put( Lembretes.ID_FULL, Lembretes.ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TIPO_ID, Lembretes.TIPO_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TIPO_ID_FULL, Lembretes.TIPO_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.DATA, Lembretes.DATA_INDEX ); + FIELD_INDEXES.put( Lembretes.DATA_FULL, Lembretes.DATA_INDEX ); + FIELD_INDEXES.put( Lembretes.DESCRICAO, Lembretes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Lembretes.DESCRICAO_FULL, Lembretes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Lembretes.TEXTO, Lembretes.TEXTO_INDEX ); + FIELD_INDEXES.put( Lembretes.TEXTO_FULL, Lembretes.TEXTO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.EMPRESA_ID, Lembretes.TO_EMPRESA_ID ); + FIELD_INDEXES.put( Lembretes.EMPRESA_ID, Lembretes.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.EMPRESA_ID_FULL, Lembretes.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_EMPRESA_ID, Lembretes.TO_EMPRESA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.ESTABELECIMENTO_ID, Lembretes.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( Lembretes.ESTABELECIMENTO_ID, Lembretes.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.ESTABELECIMENTO_ID_FULL, Lembretes.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_ESTABELECIMENTO_ID, Lembretes.TO_ESTABELECIMENTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.TRABALHADOR_ID, Lembretes.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( Lembretes.TRABALHADOR_ID, Lembretes.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TRABALHADOR_ID_FULL, Lembretes.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_TRABALHADOR_ID, Lembretes.TO_TRABALHADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.MARCACAO_ESTABELECIMENTO_ID, Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( Lembretes.MARCACAO_ESTABELECIMENTO_ID, Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.MARCACAO_ESTABELECIMENTO_ID_FULL, Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID, Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.MARCACAO_TRABALHADOR_ID, Lembretes.TO_MARCACAO_TRABALHADOR_ID ); + FIELD_INDEXES.put( Lembretes.MARCACAO_TRABALHADOR_ID, Lembretes.MARCACAO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.MARCACAO_TRABALHADOR_ID_FULL, Lembretes.MARCACAO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_MARCACAO_TRABALHADOR_ID, Lembretes.TO_MARCACAO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.ENVIAR_EMAIL, Lembretes.ENVIAR_EMAIL_INDEX ); + FIELD_INDEXES.put( Lembretes.ENVIAR_EMAIL_FULL, Lembretes.ENVIAR_EMAIL_INDEX ); + FIELD_INDEXES.put( Lembretes.PERIODICIDADE_DIAS, Lembretes.PERIODICIDADE_DIAS_INDEX ); + FIELD_INDEXES.put( Lembretes.PERIODICIDADE_DIAS_FULL, Lembretes.PERIODICIDADE_DIAS_INDEX ); + FIELD_INDEXES.put( Lembretes.PERIODICIDADE_MESES, Lembretes.PERIODICIDADE_MESES_INDEX ); + FIELD_INDEXES.put( Lembretes.PERIODICIDADE_MESES_FULL, Lembretes.PERIODICIDADE_MESES_INDEX ); + FIELD_INDEXES.put( Lembretes.ULTIMO_ENVIO, Lembretes.ULTIMO_ENVIO_INDEX ); + FIELD_INDEXES.put( Lembretes.ULTIMO_ENVIO_FULL, Lembretes.ULTIMO_ENVIO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID, Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID ); + FIELD_INDEXES.put( Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID, Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_FULL, Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID, Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.TRABALHADORES_ECDS_DATAS_ID, Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID ); + FIELD_INDEXES.put( Lembretes.TRABALHADORES_ECDS_DATAS_ID, Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TRABALHADORES_ECDS_DATAS_ID_FULL, Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID, Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.DELETED_DATE, Lembretes.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( Lembretes.DELETED_DATE_FULL, Lembretes.DELETED_DATE_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Lembretes.CLASS_IDENTIFIER, Lembretes.EXAME_ID, Lembretes.TO_EXAME_ID ); + FIELD_INDEXES.put( Lembretes.EXAME_ID, Lembretes.EXAME_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.EXAME_ID_FULL, Lembretes.EXAME_ID_INDEX ); + FIELD_INDEXES.put( Lembretes.TO_EXAME_ID, Lembretes.TO_EXAME_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymarcacao_estabelecimento_idTomarcacoes_estabelecimento = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.MARCACAO_ESTABELECIMENTO_ID, db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class, db.data.siprp_local.outer.MarcacoesEstabelecimentoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymarcacao_trabalhador_idTomarcacoes_trabalhador = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.MARCACAO_TRABALHADOR_ID, db.data.siprp_local.outer.MarcacoesTrabalhadorData.class, db.data.siprp_local.outer.MarcacoesTrabalhadorData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_consultas_datas_idTotrabalhadores_consultas_datas = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class, db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_ecds_datas_idTotrabalhadores_ecds_datas = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.TRABALHADORES_ECDS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyexame_idToexames = + new com.evolute.entity.ForeignKey( Lembretes.class, Lembretes.EXAME_ID, db.data.siprp_local.outer.ExamesData.class, db.data.siprp_local.outer.ExamesData.ID ); + + public static final String TABLENAME = "lembretes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.lembretes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "lembretes.id"; + public static final int ID_INDEX = 0; + public static final String TIPO_ID = "tipo_id"; + public static final String TIPO_ID_FULL = "lembretes.tipo_id"; + public static final int TIPO_ID_INDEX = 1; + public static final String DATA = "data"; + public static final String DATA_FULL = "lembretes.data"; + public static final int DATA_INDEX = 2; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "lembretes.descricao"; + public static final int DESCRICAO_INDEX = 3; + public static final String TEXTO = "texto"; + public static final String TEXTO_FULL = "lembretes.texto"; + public static final int TEXTO_INDEX = 4; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "lembretes.empresa_id"; + public static final int EMPRESA_ID_INDEX = 5; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "lembretes.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 6; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "lembretes.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 7; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "lembretes.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 8; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "lembretes.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 9; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "lembretes.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 10; + public static final String MARCACAO_ESTABELECIMENTO_ID = "marcacao_estabelecimento_id"; + public static final String MARCACAO_ESTABELECIMENTO_ID_FULL = "lembretes.marcacao_estabelecimento_id"; + public static final int MARCACAO_ESTABELECIMENTO_ID_INDEX = 11; + public static final String TO_MARCACAO_ESTABELECIMENTO_ID = "to_marcacao_estabelecimento_id"; + public static final String TO_MARCACAO_ESTABELECIMENTO_ID_FULL = "lembretes.to_marcacao_estabelecimento_id"; + public static final int TO_MARCACAO_ESTABELECIMENTO_ID_INDEX = 12; + public static final String MARCACAO_TRABALHADOR_ID = "marcacao_trabalhador_id"; + public static final String MARCACAO_TRABALHADOR_ID_FULL = "lembretes.marcacao_trabalhador_id"; + public static final int MARCACAO_TRABALHADOR_ID_INDEX = 13; + public static final String TO_MARCACAO_TRABALHADOR_ID = "to_marcacao_trabalhador_id"; + public static final String TO_MARCACAO_TRABALHADOR_ID_FULL = "lembretes.to_marcacao_trabalhador_id"; + public static final int TO_MARCACAO_TRABALHADOR_ID_INDEX = 14; + public static final String ENVIAR_EMAIL = "enviar_email"; + public static final String ENVIAR_EMAIL_FULL = "lembretes.enviar_email"; + public static final int ENVIAR_EMAIL_INDEX = 15; + public static final String PERIODICIDADE_DIAS = "periodicidade_dias"; + public static final String PERIODICIDADE_DIAS_FULL = "lembretes.periodicidade_dias"; + public static final int PERIODICIDADE_DIAS_INDEX = 16; + public static final String PERIODICIDADE_MESES = "periodicidade_meses"; + public static final String PERIODICIDADE_MESES_FULL = "lembretes.periodicidade_meses"; + public static final int PERIODICIDADE_MESES_INDEX = 17; + public static final String ULTIMO_ENVIO = "ultimo_envio"; + public static final String ULTIMO_ENVIO_FULL = "lembretes.ultimo_envio"; + public static final int ULTIMO_ENVIO_INDEX = 18; + public static final String TRABALHADORES_CONSULTAS_DATAS_ID = "trabalhadores_consultas_datas_id"; + public static final String TRABALHADORES_CONSULTAS_DATAS_ID_FULL = "lembretes.trabalhadores_consultas_datas_id"; + public static final int TRABALHADORES_CONSULTAS_DATAS_ID_INDEX = 19; + public static final String TO_TRABALHADORES_CONSULTAS_DATAS_ID = "to_trabalhadores_consultas_datas_id"; + public static final String TO_TRABALHADORES_CONSULTAS_DATAS_ID_FULL = "lembretes.to_trabalhadores_consultas_datas_id"; + public static final int TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX = 20; + public static final String TRABALHADORES_ECDS_DATAS_ID = "trabalhadores_ecds_datas_id"; + public static final String TRABALHADORES_ECDS_DATAS_ID_FULL = "lembretes.trabalhadores_ecds_datas_id"; + public static final int TRABALHADORES_ECDS_DATAS_ID_INDEX = 21; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID = "to_trabalhadores_ecds_datas_id"; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID_FULL = "lembretes.to_trabalhadores_ecds_datas_id"; + public static final int TO_TRABALHADORES_ECDS_DATAS_ID_INDEX = 22; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "lembretes.deleted_date"; + public static final int DELETED_DATE_INDEX = 23; + public static final String EXAME_ID = "exame_id"; + public static final String EXAME_ID_FULL = "lembretes.exame_id"; + public static final int EXAME_ID_INDEX = 24; + public static final String TO_EXAME_ID = "to_exame_id"; + public static final String TO_EXAME_ID_FULL = "lembretes.to_exame_id"; + public static final int TO_EXAME_ID_INDEX = 25; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO_ID, DATA, DESCRICAO, TEXTO, EMPRESA_ID, TO_EMPRESA_ID, ESTABELECIMENTO_ID, + TO_ESTABELECIMENTO_ID, TRABALHADOR_ID, TO_TRABALHADOR_ID, + MARCACAO_ESTABELECIMENTO_ID, TO_MARCACAO_ESTABELECIMENTO_ID, + MARCACAO_TRABALHADOR_ID, TO_MARCACAO_TRABALHADOR_ID, ENVIAR_EMAIL, + PERIODICIDADE_DIAS, PERIODICIDADE_MESES, ULTIMO_ENVIO, + TRABALHADORES_CONSULTAS_DATAS_ID, TO_TRABALHADORES_CONSULTAS_DATAS_ID, + TRABALHADORES_ECDS_DATAS_ID, TO_TRABALHADORES_ECDS_DATAS_ID, DELETED_DATE, + EXAME_ID, TO_EXAME_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO_ID, TABLENAME + "." + DATA, TABLENAME + "." + DESCRICAO, TABLENAME + "." + TEXTO, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + ESTABELECIMENTO_ID, + TABLENAME + "." + TO_ESTABELECIMENTO_ID, TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, + TABLENAME + "." + MARCACAO_ESTABELECIMENTO_ID, TABLENAME + "." + TO_MARCACAO_ESTABELECIMENTO_ID, + TABLENAME + "." + MARCACAO_TRABALHADOR_ID, TABLENAME + "." + TO_MARCACAO_TRABALHADOR_ID, TABLENAME + "." + ENVIAR_EMAIL, + TABLENAME + "." + PERIODICIDADE_DIAS, TABLENAME + "." + PERIODICIDADE_MESES, TABLENAME + "." + ULTIMO_ENVIO, + TABLENAME + "." + TRABALHADORES_CONSULTAS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_CONSULTAS_DATAS_ID, + TABLENAME + "." + TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + DELETED_DATE, + TABLENAME + "." + EXAME_ID, TABLENAME + "." + TO_EXAME_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO_ID, DATA, DESCRICAO, TEXTO, EMPRESA_ID, ESTABELECIMENTO_ID, TRABALHADOR_ID, + MARCACAO_ESTABELECIMENTO_ID, MARCACAO_TRABALHADOR_ID, ENVIAR_EMAIL, + PERIODICIDADE_DIAS, PERIODICIDADE_MESES, ULTIMO_ENVIO, + TRABALHADORES_CONSULTAS_DATAS_ID, TRABALHADORES_ECDS_DATAS_ID, + DELETED_DATE, EXAME_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO_ID, DATA, DESCRICAO, TEXTO, EMPRESA_ID, ESTABELECIMENTO_ID, TRABALHADOR_ID, + MARCACAO_ESTABELECIMENTO_ID, MARCACAO_TRABALHADOR_ID, ENVIAR_EMAIL, + PERIODICIDADE_DIAS, PERIODICIDADE_MESES, ULTIMO_ENVIO, + TRABALHADORES_CONSULTAS_DATAS_ID, TRABALHADORES_ECDS_DATAS_ID, + DELETED_DATE, EXAME_ID, }; + + private Integer id; + private Integer tipo_id; + private java.util.Date data; + private String descricao; + private String texto; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private Integer marcacao_estabelecimento_id; + private db.data.siprp_local.outer.MarcacoesEstabelecimentoData to_marcacao_estabelecimento_id; + private Integer marcacao_trabalhador_id; + private db.data.siprp_local.outer.MarcacoesTrabalhadorData to_marcacao_trabalhador_id; + private String enviar_email; + private Integer periodicidade_dias; + private Integer periodicidade_meses; + private java.util.Date ultimo_envio; + private Integer trabalhadores_consultas_datas_id; + private db.data.siprp_local.outer.TrabalhadoresConsultasDatasData to_trabalhadores_consultas_datas_id; + private Integer trabalhadores_ecds_datas_id; + private db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id; + private java.sql.Timestamp deleted_date; + private Integer exame_id; + private db.data.siprp_local.outer.ExamesData to_exame_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Lembretes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTipo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_id; + } + + public void setTipo_id( Integer tipo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO_ID, tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_id = tipo_id; + LAZY_LOADED_OBJECTS.put( TIPO_ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getTexto() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TEXTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.texto; + } + + public void setTexto( String texto ) + { + try + { + setLockedForRefresh( true ); + preProcess( TEXTO, texto ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.texto = texto; + LAZY_LOADED_OBJECTS.put( TEXTO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getMarcacao_estabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCACAO_ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marcacao_estabelecimento_id; + } + + public void setMarcacao_estabelecimento_id( Integer marcacao_estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCACAO_ESTABELECIMENTO_ID, marcacao_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marcacao_estabelecimento_id = marcacao_estabelecimento_id; + LAZY_LOADED_OBJECTS.put( MARCACAO_ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesEstabelecimentoData toMarcacao_estabelecimento_id() + { + try + { + prepare( TO_MARCACAO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_marcacao_estabelecimento_id; + } + + public void setToMarcacao_estabelecimento_id( db.data.siprp_local.outer.MarcacoesEstabelecimentoData to_marcacao_estabelecimento_id ) + { + try + { + preProcess( TO_MARCACAO_ESTABELECIMENTO_ID, to_marcacao_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_marcacao_estabelecimento_id = to_marcacao_estabelecimento_id; + } + + public Integer getMarcacao_trabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCACAO_TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marcacao_trabalhador_id; + } + + public void setMarcacao_trabalhador_id( Integer marcacao_trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCACAO_TRABALHADOR_ID, marcacao_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marcacao_trabalhador_id = marcacao_trabalhador_id; + LAZY_LOADED_OBJECTS.put( MARCACAO_TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesTrabalhadorData toMarcacao_trabalhador_id() + { + try + { + prepare( TO_MARCACAO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_marcacao_trabalhador_id; + } + + public void setToMarcacao_trabalhador_id( db.data.siprp_local.outer.MarcacoesTrabalhadorData to_marcacao_trabalhador_id ) + { + try + { + preProcess( TO_MARCACAO_TRABALHADOR_ID, to_marcacao_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_marcacao_trabalhador_id = to_marcacao_trabalhador_id; + } + + public String getEnviar_email() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ENVIAR_EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.enviar_email; + } + + public void setEnviar_email( String enviar_email ) + { + try + { + setLockedForRefresh( true ); + preProcess( ENVIAR_EMAIL, enviar_email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.enviar_email = enviar_email; + LAZY_LOADED_OBJECTS.put( ENVIAR_EMAIL, Boolean.TRUE ); + } + + public Integer getPeriodicidade_dias() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERIODICIDADE_DIAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.periodicidade_dias; + } + + public void setPeriodicidade_dias( Integer periodicidade_dias ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERIODICIDADE_DIAS, periodicidade_dias ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.periodicidade_dias = periodicidade_dias; + LAZY_LOADED_OBJECTS.put( PERIODICIDADE_DIAS, Boolean.TRUE ); + } + + public Integer getPeriodicidade_meses() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERIODICIDADE_MESES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.periodicidade_meses; + } + + public void setPeriodicidade_meses( Integer periodicidade_meses ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERIODICIDADE_MESES, periodicidade_meses ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.periodicidade_meses = periodicidade_meses; + LAZY_LOADED_OBJECTS.put( PERIODICIDADE_MESES, Boolean.TRUE ); + } + + public java.util.Date getUltimo_envio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ULTIMO_ENVIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ultimo_envio; + } + + public void setUltimo_envio( java.util.Date ultimo_envio ) + { + try + { + setLockedForRefresh( true ); + preProcess( ULTIMO_ENVIO, ultimo_envio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ultimo_envio = ultimo_envio; + LAZY_LOADED_OBJECTS.put( ULTIMO_ENVIO, Boolean.TRUE ); + } + + public Integer getTrabalhadores_consultas_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_CONSULTAS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_consultas_datas_id; + } + + public void setTrabalhadores_consultas_datas_id( Integer trabalhadores_consultas_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_CONSULTAS_DATAS_ID, trabalhadores_consultas_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_consultas_datas_id = trabalhadores_consultas_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_CONSULTAS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresConsultasDatasData toTrabalhadores_consultas_datas_id() + { + try + { + prepare( TO_TRABALHADORES_CONSULTAS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_consultas_datas_id; + } + + public void setToTrabalhadores_consultas_datas_id( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData to_trabalhadores_consultas_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_CONSULTAS_DATAS_ID, to_trabalhadores_consultas_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_consultas_datas_id = to_trabalhadores_consultas_datas_id; + } + + public Integer getTrabalhadores_ecds_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_ECDS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_ecds_datas_id; + } + + public void setTrabalhadores_ecds_datas_id( Integer trabalhadores_ecds_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_ECDS_DATAS_ID, trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_ecds_datas_id = trabalhadores_ecds_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_ECDS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresEcdsDatasData toTrabalhadores_ecds_datas_id() + { + try + { + prepare( TO_TRABALHADORES_ECDS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_ecds_datas_id; + } + + public void setToTrabalhadores_ecds_datas_id( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_ECDS_DATAS_ID, to_trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_ecds_datas_id = to_trabalhadores_ecds_datas_id; + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Integer getExame_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EXAME_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.exame_id; + } + + public void setExame_id( Integer exame_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EXAME_ID, exame_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.exame_id = exame_id; + LAZY_LOADED_OBJECTS.put( EXAME_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ExamesData toExame_id() + { + try + { + prepare( TO_EXAME_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_exame_id; + } + + public void setToExame_id( db.data.siprp_local.outer.ExamesData to_exame_id ) + { + try + { + preProcess( TO_EXAME_ID, to_exame_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_exame_id = to_exame_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Lembretes.ID_INDEX: + value = getId(); + break; + case Lembretes.TIPO_ID_INDEX: + value = getTipo_id(); + break; + case Lembretes.DATA_INDEX: + value = getData(); + break; + case Lembretes.DESCRICAO_INDEX: + value = getDescricao(); + break; + case Lembretes.TEXTO_INDEX: + value = getTexto(); + break; + case Lembretes.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case Lembretes.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case Lembretes.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case Lembretes.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case Lembretes.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case Lembretes.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX: + value = getMarcacao_estabelecimento_id(); + break; + case Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID_INDEX: + value = toMarcacao_estabelecimento_id(); + break; + case Lembretes.MARCACAO_TRABALHADOR_ID_INDEX: + value = getMarcacao_trabalhador_id(); + break; + case Lembretes.TO_MARCACAO_TRABALHADOR_ID_INDEX: + value = toMarcacao_trabalhador_id(); + break; + case Lembretes.ENVIAR_EMAIL_INDEX: + value = getEnviar_email(); + break; + case Lembretes.PERIODICIDADE_DIAS_INDEX: + value = getPeriodicidade_dias(); + break; + case Lembretes.PERIODICIDADE_MESES_INDEX: + value = getPeriodicidade_meses(); + break; + case Lembretes.ULTIMO_ENVIO_INDEX: + value = getUltimo_envio(); + break; + case Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = getTrabalhadores_consultas_datas_id(); + break; + case Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = toTrabalhadores_consultas_datas_id(); + break; + case Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = getTrabalhadores_ecds_datas_id(); + break; + case Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = toTrabalhadores_ecds_datas_id(); + break; + case Lembretes.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + case Lembretes.EXAME_ID_INDEX: + value = getExame_id(); + break; + case Lembretes.TO_EXAME_ID_INDEX: + value = toExame_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Lembretes.ID_INDEX: + value = this.id; + break; + case Lembretes.TIPO_ID_INDEX: + value = this.tipo_id; + break; + case Lembretes.DATA_INDEX: + value = this.data; + break; + case Lembretes.DESCRICAO_INDEX: + value = this.descricao; + break; + case Lembretes.TEXTO_INDEX: + value = this.texto; + break; + case Lembretes.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case Lembretes.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case Lembretes.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case Lembretes.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case Lembretes.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case Lembretes.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX: + value = this.marcacao_estabelecimento_id; + break; + case Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID_INDEX: + value = this.to_marcacao_estabelecimento_id; + break; + case Lembretes.MARCACAO_TRABALHADOR_ID_INDEX: + value = this.marcacao_trabalhador_id; + break; + case Lembretes.TO_MARCACAO_TRABALHADOR_ID_INDEX: + value = this.to_marcacao_trabalhador_id; + break; + case Lembretes.ENVIAR_EMAIL_INDEX: + value = this.enviar_email; + break; + case Lembretes.PERIODICIDADE_DIAS_INDEX: + value = this.periodicidade_dias; + break; + case Lembretes.PERIODICIDADE_MESES_INDEX: + value = this.periodicidade_meses; + break; + case Lembretes.ULTIMO_ENVIO_INDEX: + value = this.ultimo_envio; + break; + case Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = this.trabalhadores_consultas_datas_id; + break; + case Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = this.to_trabalhadores_consultas_datas_id; + break; + case Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.trabalhadores_ecds_datas_id; + break; + case Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.to_trabalhadores_ecds_datas_id; + break; + case Lembretes.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + case Lembretes.EXAME_ID_INDEX: + value = this.exame_id; + break; + case Lembretes.TO_EXAME_ID_INDEX: + value = this.to_exame_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Lembretes.ID_INDEX: + setId( ( Integer ) value ); + break; + case Lembretes.TIPO_ID_INDEX: + setTipo_id( ( Integer ) value ); + break; + case Lembretes.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case Lembretes.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case Lembretes.TEXTO_INDEX: + setTexto( ( String ) value ); + break; + case Lembretes.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case Lembretes.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case Lembretes.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case Lembretes.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + case Lembretes.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case Lembretes.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX: + setMarcacao_estabelecimento_id( ( Integer ) value ); + break; + case Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID_INDEX: + setToMarcacao_estabelecimento_id( ( db.data.siprp_local.outer.MarcacoesEstabelecimentoData ) value ); + break; + case Lembretes.MARCACAO_TRABALHADOR_ID_INDEX: + setMarcacao_trabalhador_id( ( Integer ) value ); + break; + case Lembretes.TO_MARCACAO_TRABALHADOR_ID_INDEX: + setToMarcacao_trabalhador_id( ( db.data.siprp_local.outer.MarcacoesTrabalhadorData ) value ); + break; + case Lembretes.ENVIAR_EMAIL_INDEX: + setEnviar_email( ( String ) value ); + break; + case Lembretes.PERIODICIDADE_DIAS_INDEX: + setPeriodicidade_dias( ( Integer ) value ); + break; + case Lembretes.PERIODICIDADE_MESES_INDEX: + setPeriodicidade_meses( ( Integer ) value ); + break; + case Lembretes.ULTIMO_ENVIO_INDEX: + setUltimo_envio( ( java.util.Date ) value ); + break; + case Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + setTrabalhadores_consultas_datas_id( ( Integer ) value ); + break; + case Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + setToTrabalhadores_consultas_datas_id( ( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData ) value ); + break; + case Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + setTrabalhadores_ecds_datas_id( ( Integer ) value ); + break; + case Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + setToTrabalhadores_ecds_datas_id( ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value ); + break; + case Lembretes.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + case Lembretes.EXAME_ID_INDEX: + setExame_id( ( Integer ) value ); + break; + case Lembretes.TO_EXAME_ID_INDEX: + setToExame_id( ( db.data.siprp_local.outer.ExamesData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Lembretes.ID_INDEX: + this.id = ( Integer ) value; + break; + case Lembretes.TIPO_ID_INDEX: + this.tipo_id = ( Integer ) value; + break; + case Lembretes.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case Lembretes.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case Lembretes.TEXTO_INDEX: + this.texto = ( String ) value; + break; + case Lembretes.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case Lembretes.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case Lembretes.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case Lembretes.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + case Lembretes.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case Lembretes.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX: + this.marcacao_estabelecimento_id = ( Integer ) value; + break; + case Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID_INDEX: + this.to_marcacao_estabelecimento_id = ( db.data.siprp_local.outer.MarcacoesEstabelecimentoData ) value; + break; + case Lembretes.MARCACAO_TRABALHADOR_ID_INDEX: + this.marcacao_trabalhador_id = ( Integer ) value; + break; + case Lembretes.TO_MARCACAO_TRABALHADOR_ID_INDEX: + this.to_marcacao_trabalhador_id = ( db.data.siprp_local.outer.MarcacoesTrabalhadorData ) value; + break; + case Lembretes.ENVIAR_EMAIL_INDEX: + this.enviar_email = ( String ) value; + break; + case Lembretes.PERIODICIDADE_DIAS_INDEX: + this.periodicidade_dias = ( Integer ) value; + break; + case Lembretes.PERIODICIDADE_MESES_INDEX: + this.periodicidade_meses = ( Integer ) value; + break; + case Lembretes.ULTIMO_ENVIO_INDEX: + this.ultimo_envio = ( java.util.Date ) value; + break; + case Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + this.trabalhadores_consultas_datas_id = ( Integer ) value; + break; + case Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + this.to_trabalhadores_consultas_datas_id = ( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData ) value; + break; + case Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.trabalhadores_ecds_datas_id = ( Integer ) value; + break; + case Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.to_trabalhadores_ecds_datas_id = ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value; + break; + case Lembretes.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + case Lembretes.EXAME_ID_INDEX: + this.exame_id = ( Integer ) value; + break; + case Lembretes.TO_EXAME_ID_INDEX: + this.to_exame_id = ( db.data.siprp_local.outer.ExamesData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Lembretes.ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TIPO_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.DATA_INDEX: + theClass = java.util.Date.class; + break; + case Lembretes.DESCRICAO_INDEX: + theClass = String.class; + break; + case Lembretes.TEXTO_INDEX: + theClass = String.class; + break; + case Lembretes.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case Lembretes.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + case Lembretes.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case Lembretes.MARCACAO_ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_MARCACAO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class; + break; + case Lembretes.MARCACAO_TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_MARCACAO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesTrabalhadorData.class; + break; + case Lembretes.ENVIAR_EMAIL_INDEX: + theClass = String.class; + break; + case Lembretes.PERIODICIDADE_DIAS_INDEX: + theClass = Integer.class; + break; + case Lembretes.PERIODICIDADE_MESES_INDEX: + theClass = Integer.class; + break; + case Lembretes.ULTIMO_ENVIO_INDEX: + theClass = java.util.Date.class; + break; + case Lembretes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class; + break; + case Lembretes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class; + break; + case Lembretes.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Lembretes.EXAME_ID_INDEX: + theClass = Integer.class; + break; + case Lembretes.TO_EXAME_ID_INDEX: + theClass = db.data.siprp_local.outer.ExamesData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Lembretes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Lembretes.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/LembretesTipos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/LembretesTipos.java new file mode 100644 index 00000000..3febd3e2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/LembretesTipos.java @@ -0,0 +1,431 @@ +/* +* LembretesTipos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class LembretesTipos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( LembretesTipos.ID, LembretesTipos.ID_INDEX ); + FIELD_INDEXES.put( LembretesTipos.ID_FULL, LembretesTipos.ID_INDEX ); + FIELD_INDEXES.put( LembretesTipos.CODIGO, LembretesTipos.CODIGO_INDEX ); + FIELD_INDEXES.put( LembretesTipos.CODIGO_FULL, LembretesTipos.CODIGO_INDEX ); + FIELD_INDEXES.put( LembretesTipos.DESCRICAO, LembretesTipos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( LembretesTipos.DESCRICAO_FULL, LembretesTipos.DESCRICAO_INDEX ); + FIELD_INDEXES.put( LembretesTipos.ORDEM, LembretesTipos.ORDEM_INDEX ); + FIELD_INDEXES.put( LembretesTipos.ORDEM_FULL, LembretesTipos.ORDEM_INDEX ); + FIELD_INDEXES.put( LembretesTipos.ACTIVO, LembretesTipos.ACTIVO_INDEX ); + FIELD_INDEXES.put( LembretesTipos.ACTIVO_FULL, LembretesTipos.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "lembretes_tipos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.lembretes_tipos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "lembretes_tipos.id"; + public static final int ID_INDEX = 0; + public static final String CODIGO = "codigo"; + public static final String CODIGO_FULL = "lembretes_tipos.codigo"; + public static final int CODIGO_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "lembretes_tipos.descricao"; + public static final int DESCRICAO_INDEX = 2; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "lembretes_tipos.ordem"; + public static final int ORDEM_INDEX = 3; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "lembretes_tipos.activo"; + public static final int ACTIVO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + CODIGO, DESCRICAO, ORDEM, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CODIGO, TABLENAME + "." + DESCRICAO, TABLENAME + "." + ORDEM, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, CODIGO, DESCRICAO, ORDEM, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, CODIGO, DESCRICAO, ORDEM, ACTIVO, }; + + private Integer id; + private String codigo; + private String descricao; + private Integer ordem; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public LembretesTipos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getCodigo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo; + } + + public void setCodigo( String codigo ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO, codigo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo = codigo; + LAZY_LOADED_OBJECTS.put( CODIGO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case LembretesTipos.ID_INDEX: + value = getId(); + break; + case LembretesTipos.CODIGO_INDEX: + value = getCodigo(); + break; + case LembretesTipos.DESCRICAO_INDEX: + value = getDescricao(); + break; + case LembretesTipos.ORDEM_INDEX: + value = getOrdem(); + break; + case LembretesTipos.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case LembretesTipos.ID_INDEX: + value = this.id; + break; + case LembretesTipos.CODIGO_INDEX: + value = this.codigo; + break; + case LembretesTipos.DESCRICAO_INDEX: + value = this.descricao; + break; + case LembretesTipos.ORDEM_INDEX: + value = this.ordem; + break; + case LembretesTipos.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case LembretesTipos.ID_INDEX: + setId( ( Integer ) value ); + break; + case LembretesTipos.CODIGO_INDEX: + setCodigo( ( String ) value ); + break; + case LembretesTipos.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case LembretesTipos.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case LembretesTipos.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case LembretesTipos.ID_INDEX: + this.id = ( Integer ) value; + break; + case LembretesTipos.CODIGO_INDEX: + this.codigo = ( String ) value; + break; + case LembretesTipos.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case LembretesTipos.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case LembretesTipos.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case LembretesTipos.ID_INDEX: + theClass = Integer.class; + break; + case LembretesTipos.CODIGO_INDEX: + theClass = String.class; + break; + case LembretesTipos.DESCRICAO_INDEX: + theClass = String.class; + break; + case LembretesTipos.ORDEM_INDEX: + theClass = Integer.class; + break; + case LembretesTipos.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : LembretesTipos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, LembretesTipos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesEmpresa.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesEmpresa.java new file mode 100644 index 00000000..bd44751d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesEmpresa.java @@ -0,0 +1,481 @@ +/* +* MarcacoesEmpresa.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class MarcacoesEmpresa extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesEmpresa.ID, MarcacoesEmpresa.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.ID_FULL, MarcacoesEmpresa.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.DATA, MarcacoesEmpresa.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.DATA_FULL, MarcacoesEmpresa.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.TEXTO, MarcacoesEmpresa.TEXTO_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.TEXTO_FULL, MarcacoesEmpresa.TEXTO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesEmpresa.CLASS_IDENTIFIER, MarcacoesEmpresa.EMPRESA_ID, MarcacoesEmpresa.TO_EMPRESA_ID ); + FIELD_INDEXES.put( MarcacoesEmpresa.EMPRESA_ID, MarcacoesEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.EMPRESA_ID_FULL, MarcacoesEmpresa.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.TO_EMPRESA_ID, MarcacoesEmpresa.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.REALIZADA, MarcacoesEmpresa.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesEmpresa.REALIZADA_FULL, MarcacoesEmpresa.REALIZADA_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( MarcacoesEmpresa.class, MarcacoesEmpresa.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "marcacoes_empresa"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.marcacoes_empresa"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_empresa.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_empresa.data"; + public static final int DATA_INDEX = 1; + public static final String TEXTO = "texto"; + public static final String TEXTO_FULL = "marcacoes_empresa.texto"; + public static final int TEXTO_INDEX = 2; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "marcacoes_empresa.empresa_id"; + public static final int EMPRESA_ID_INDEX = 3; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "marcacoes_empresa.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 4; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "marcacoes_empresa.realizada"; + public static final int REALIZADA_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, TEXTO, EMPRESA_ID, TO_EMPRESA_ID, REALIZADA, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + TEXTO, TABLENAME + "." + EMPRESA_ID, TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + REALIZADA, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, TEXTO, EMPRESA_ID, REALIZADA, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, TEXTO, EMPRESA_ID, REALIZADA, }; + + private Integer id; + private java.util.Date data; + private String texto; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private String realizada; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesEmpresa() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getTexto() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TEXTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.texto; + } + + public void setTexto( String texto ) + { + try + { + setLockedForRefresh( true ); + preProcess( TEXTO, texto ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.texto = texto; + LAZY_LOADED_OBJECTS.put( TEXTO, Boolean.TRUE ); + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + setLockedForRefresh( true ); + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + value = getId(); + break; + case MarcacoesEmpresa.DATA_INDEX: + value = getData(); + break; + case MarcacoesEmpresa.TEXTO_INDEX: + value = getTexto(); + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + value = getRealizada(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + value = this.id; + break; + case MarcacoesEmpresa.DATA_INDEX: + value = this.data; + break; + case MarcacoesEmpresa.TEXTO_INDEX: + value = this.texto; + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + value = this.realizada; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesEmpresa.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesEmpresa.TEXTO_INDEX: + setTexto( ( String ) value ); + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesEmpresa.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesEmpresa.TEXTO_INDEX: + this.texto = ( String ) value; + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesEmpresa.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEmpresa.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEmpresa.TEXTO_INDEX: + theClass = String.class; + break; + case MarcacoesEmpresa.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEmpresa.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case MarcacoesEmpresa.REALIZADA_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesEmpresa._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesEmpresa.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesEstabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesEstabelecimento.java new file mode 100644 index 00000000..c6417ef2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesEstabelecimento.java @@ -0,0 +1,866 @@ +/* +* MarcacoesEstabelecimento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class MarcacoesEstabelecimento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesEstabelecimento.ID, MarcacoesEstabelecimento.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ID_FULL, MarcacoesEstabelecimento.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA, MarcacoesEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_FULL, MarcacoesEstabelecimento.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.REALIZADA, MarcacoesEstabelecimento.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.REALIZADA_FULL, MarcacoesEstabelecimento.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_EMAIL, MarcacoesEstabelecimento.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_EMAIL_FULL, MarcacoesEstabelecimento.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_RELATORIO, MarcacoesEstabelecimento.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.DATA_RELATORIO_FULL, MarcacoesEstabelecimento.DATA_RELATORIO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesEstabelecimento.CLASS_IDENTIFIER, MarcacoesEstabelecimento.ESTABELECIMENTO_ID, MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ESTABELECIMENTO_ID, MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ESTABELECIMENTO_ID_FULL, MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID, MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ESTADO, MarcacoesEstabelecimento.ESTADO_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.ESTADO_FULL, MarcacoesEstabelecimento.ESTADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesEstabelecimento.CLASS_IDENTIFIER, MarcacoesEstabelecimento.TECNICO_HST, MarcacoesEstabelecimento.TO_TECNICO_HST ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TECNICO_HST, MarcacoesEstabelecimento.TECNICO_HST_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TECNICO_HST_FULL, MarcacoesEstabelecimento.TECNICO_HST_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TO_TECNICO_HST, MarcacoesEstabelecimento.TO_TECNICO_HST_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.OBSERVACOES, MarcacoesEstabelecimento.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.OBSERVACOES_FULL, MarcacoesEstabelecimento.OBSERVACOES_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesEstabelecimento.CLASS_IDENTIFIER, MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST, MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST, MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_FULL, MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX ); + FIELD_INDEXES.put( MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST, MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( MarcacoesEstabelecimento.class, MarcacoesEstabelecimento.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytecnico_hstTomarcacoes_tecnicos_hst = + new com.evolute.entity.ForeignKey( MarcacoesEstabelecimento.class, MarcacoesEstabelecimento.TECNICO_HST, db.data.siprp_local.outer.MarcacoesTecnicosHstData.class, db.data.siprp_local.outer.MarcacoesTecnicosHstData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytecnico_superior_hstTomarcacoes_tecnicos_hst = + new com.evolute.entity.ForeignKey( MarcacoesEstabelecimento.class, MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST, db.data.siprp_local.outer.MarcacoesTecnicosHstData.class, db.data.siprp_local.outer.MarcacoesTecnicosHstData.ID ); + + public static final String TABLENAME = "marcacoes_estabelecimento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.marcacoes_estabelecimento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_estabelecimento.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_estabelecimento.data"; + public static final int DATA_INDEX = 1; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "marcacoes_estabelecimento.realizada"; + public static final int REALIZADA_INDEX = 2; + public static final String DATA_EMAIL = "data_email"; + public static final String DATA_EMAIL_FULL = "marcacoes_estabelecimento.data_email"; + public static final int DATA_EMAIL_INDEX = 3; + public static final String DATA_RELATORIO = "data_relatorio"; + public static final String DATA_RELATORIO_FULL = "marcacoes_estabelecimento.data_relatorio"; + public static final int DATA_RELATORIO_INDEX = 4; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "marcacoes_estabelecimento.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 5; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "marcacoes_estabelecimento.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 6; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "marcacoes_estabelecimento.estado"; + public static final int ESTADO_INDEX = 7; + public static final String TECNICO_HST = "tecnico_hst"; + public static final String TECNICO_HST_FULL = "marcacoes_estabelecimento.tecnico_hst"; + public static final int TECNICO_HST_INDEX = 8; + public static final String TO_TECNICO_HST = "to_tecnico_hst"; + public static final String TO_TECNICO_HST_FULL = "marcacoes_estabelecimento.to_tecnico_hst"; + public static final int TO_TECNICO_HST_INDEX = 9; + public static final String OBSERVACOES = "observacoes"; + public static final String OBSERVACOES_FULL = "marcacoes_estabelecimento.observacoes"; + public static final int OBSERVACOES_INDEX = 10; + public static final String TECNICO_SUPERIOR_HST = "tecnico_superior_hst"; + public static final String TECNICO_SUPERIOR_HST_FULL = "marcacoes_estabelecimento.tecnico_superior_hst"; + public static final int TECNICO_SUPERIOR_HST_INDEX = 11; + public static final String TO_TECNICO_SUPERIOR_HST = "to_tecnico_superior_hst"; + public static final String TO_TECNICO_SUPERIOR_HST_FULL = "marcacoes_estabelecimento.to_tecnico_superior_hst"; + public static final int TO_TECNICO_SUPERIOR_HST_INDEX = 12; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO_ID, + TO_ESTABELECIMENTO_ID, ESTADO, TECNICO_HST, TO_TECNICO_HST, OBSERVACOES, + TECNICO_SUPERIOR_HST, TO_TECNICO_SUPERIOR_HST, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + REALIZADA, TABLENAME + "." + DATA_EMAIL, TABLENAME + "." + DATA_RELATORIO, TABLENAME + "." + ESTABELECIMENTO_ID, + TABLENAME + "." + TO_ESTABELECIMENTO_ID, TABLENAME + "." + ESTADO, TABLENAME + "." + TECNICO_HST, TABLENAME + "." + TO_TECNICO_HST, TABLENAME + "." + OBSERVACOES, + TABLENAME + "." + TECNICO_SUPERIOR_HST, TABLENAME + "." + TO_TECNICO_SUPERIOR_HST, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO_ID, ESTADO, + TECNICO_HST, OBSERVACOES, TECNICO_SUPERIOR_HST, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO_ID, ESTADO, + TECNICO_HST, OBSERVACOES, TECNICO_SUPERIOR_HST, }; + + private Integer id; + private java.util.Date data; + private String realizada; + private java.util.Date data_email; + private java.util.Date data_relatorio; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + private Integer estado; + private Integer tecnico_hst; + private db.data.siprp_local.outer.MarcacoesTecnicosHstData to_tecnico_hst; + private String observacoes; + private Integer tecnico_superior_hst; + private db.data.siprp_local.outer.MarcacoesTecnicosHstData to_tecnico_superior_hst; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesEstabelecimento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromHsRelatorio_marcacao_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.HsRelatorioData.class , getPrimaryKey().getMap().get("id"), "marcacao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromLembretes_marcacao_estabelecimento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "marcacao_estabelecimento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + setLockedForRefresh( true ); + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public java.util.Date getData_email() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_email; + } + + public void setData_email( java.util.Date data_email ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_EMAIL, data_email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_email = data_email; + LAZY_LOADED_OBJECTS.put( DATA_EMAIL, Boolean.TRUE ); + } + + public java.util.Date getData_relatorio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RELATORIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_relatorio; + } + + public void setData_relatorio( java.util.Date data_relatorio ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_RELATORIO, data_relatorio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_relatorio = data_relatorio; + LAZY_LOADED_OBJECTS.put( DATA_RELATORIO, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getTecnico_hst() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_HST ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_hst; + } + + public void setTecnico_hst( Integer tecnico_hst ) + { + try + { + setLockedForRefresh( true ); + preProcess( TECNICO_HST, tecnico_hst ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_hst = tecnico_hst; + LAZY_LOADED_OBJECTS.put( TECNICO_HST, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesTecnicosHstData toTecnico_hst() + { + try + { + prepare( TO_TECNICO_HST ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tecnico_hst; + } + + public void setToTecnico_hst( db.data.siprp_local.outer.MarcacoesTecnicosHstData to_tecnico_hst ) + { + try + { + preProcess( TO_TECNICO_HST, to_tecnico_hst ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tecnico_hst = to_tecnico_hst; + } + + public String getObservacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes; + } + + public void setObservacoes( String observacoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACOES, observacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes = observacoes; + LAZY_LOADED_OBJECTS.put( OBSERVACOES, Boolean.TRUE ); + } + + public Integer getTecnico_superior_hst() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TECNICO_SUPERIOR_HST ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tecnico_superior_hst; + } + + public void setTecnico_superior_hst( Integer tecnico_superior_hst ) + { + try + { + setLockedForRefresh( true ); + preProcess( TECNICO_SUPERIOR_HST, tecnico_superior_hst ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tecnico_superior_hst = tecnico_superior_hst; + LAZY_LOADED_OBJECTS.put( TECNICO_SUPERIOR_HST, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesTecnicosHstData toTecnico_superior_hst() + { + try + { + prepare( TO_TECNICO_SUPERIOR_HST ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tecnico_superior_hst; + } + + public void setToTecnico_superior_hst( db.data.siprp_local.outer.MarcacoesTecnicosHstData to_tecnico_superior_hst ) + { + try + { + preProcess( TO_TECNICO_SUPERIOR_HST, to_tecnico_superior_hst ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tecnico_superior_hst = to_tecnico_superior_hst; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + value = getId(); + break; + case MarcacoesEstabelecimento.DATA_INDEX: + value = getData(); + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + value = getRealizada(); + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + value = getData_email(); + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + value = getData_relatorio(); + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case MarcacoesEstabelecimento.ESTADO_INDEX: + value = getEstado(); + break; + case MarcacoesEstabelecimento.TECNICO_HST_INDEX: + value = getTecnico_hst(); + break; + case MarcacoesEstabelecimento.TO_TECNICO_HST_INDEX: + value = toTecnico_hst(); + break; + case MarcacoesEstabelecimento.OBSERVACOES_INDEX: + value = getObservacoes(); + break; + case MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX: + value = getTecnico_superior_hst(); + break; + case MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST_INDEX: + value = toTecnico_superior_hst(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + value = this.id; + break; + case MarcacoesEstabelecimento.DATA_INDEX: + value = this.data; + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + value = this.realizada; + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + value = this.data_email; + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + value = this.data_relatorio; + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case MarcacoesEstabelecimento.ESTADO_INDEX: + value = this.estado; + break; + case MarcacoesEstabelecimento.TECNICO_HST_INDEX: + value = this.tecnico_hst; + break; + case MarcacoesEstabelecimento.TO_TECNICO_HST_INDEX: + value = this.to_tecnico_hst; + break; + case MarcacoesEstabelecimento.OBSERVACOES_INDEX: + value = this.observacoes; + break; + case MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX: + value = this.tecnico_superior_hst; + break; + case MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST_INDEX: + value = this.to_tecnico_superior_hst; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesEstabelecimento.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + setData_email( ( java.util.Date ) value ); + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + setData_relatorio( ( java.util.Date ) value ); + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + case MarcacoesEstabelecimento.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case MarcacoesEstabelecimento.TECNICO_HST_INDEX: + setTecnico_hst( ( Integer ) value ); + break; + case MarcacoesEstabelecimento.TO_TECNICO_HST_INDEX: + setToTecnico_hst( ( db.data.siprp_local.outer.MarcacoesTecnicosHstData ) value ); + break; + case MarcacoesEstabelecimento.OBSERVACOES_INDEX: + setObservacoes( ( String ) value ); + break; + case MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX: + setTecnico_superior_hst( ( Integer ) value ); + break; + case MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST_INDEX: + setToTecnico_superior_hst( ( db.data.siprp_local.outer.MarcacoesTecnicosHstData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesEstabelecimento.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + this.data_email = ( java.util.Date ) value; + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + this.data_relatorio = ( java.util.Date ) value; + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + case MarcacoesEstabelecimento.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case MarcacoesEstabelecimento.TECNICO_HST_INDEX: + this.tecnico_hst = ( Integer ) value; + break; + case MarcacoesEstabelecimento.TO_TECNICO_HST_INDEX: + this.to_tecnico_hst = ( db.data.siprp_local.outer.MarcacoesTecnicosHstData ) value; + break; + case MarcacoesEstabelecimento.OBSERVACOES_INDEX: + this.observacoes = ( String ) value; + break; + case MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX: + this.tecnico_superior_hst = ( Integer ) value; + break; + case MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST_INDEX: + this.to_tecnico_superior_hst = ( db.data.siprp_local.outer.MarcacoesTecnicosHstData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesEstabelecimento.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEstabelecimento.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEstabelecimento.REALIZADA_INDEX: + theClass = String.class; + break; + case MarcacoesEstabelecimento.DATA_EMAIL_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEstabelecimento.DATA_RELATORIO_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesEstabelecimento.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesEstabelecimento.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + case MarcacoesEstabelecimento.ESTADO_INDEX: + theClass = Integer.class; + break; + case MarcacoesEstabelecimento.TECNICO_HST_INDEX: + theClass = Integer.class; + break; + case MarcacoesEstabelecimento.TO_TECNICO_HST_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesTecnicosHstData.class; + break; + case MarcacoesEstabelecimento.OBSERVACOES_INDEX: + theClass = String.class; + break; + case MarcacoesEstabelecimento.TECNICO_SUPERIOR_HST_INDEX: + theClass = Integer.class; + break; + case MarcacoesEstabelecimento.TO_TECNICO_SUPERIOR_HST_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesTecnicosHstData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesEstabelecimento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesEstabelecimento.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesGruposRealizados.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesGruposRealizados.java new file mode 100644 index 00000000..1f95dc3c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesGruposRealizados.java @@ -0,0 +1,537 @@ +/* +* MarcacoesGruposRealizados.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class MarcacoesGruposRealizados extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesGruposRealizados.ID, MarcacoesGruposRealizados.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.ID_FULL, MarcacoesGruposRealizados.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesGruposRealizados.CLASS_IDENTIFIER, MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID, MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID, MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_FULL, MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID, MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesGruposRealizados.CLASS_IDENTIFIER, MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID, MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID, MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_FULL, MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID, MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesGruposRealizados.CLASS_IDENTIFIER, MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID, MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID, MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_FULL, MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID, MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeymarcacao_trabalhador_idTomarcacoes_trabalhador = + new com.evolute.entity.ForeignKey( MarcacoesGruposRealizados.class, MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID, db.data.siprp_local.outer.MarcacoesTrabalhadorData.class, db.data.siprp_local.outer.MarcacoesTrabalhadorData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeygrupo_protocolo_idToprt_grupos_protocolo = + new com.evolute.entity.ForeignKey( MarcacoesGruposRealizados.class, MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID, db.data.siprp_local.outer.PrtGruposProtocoloData.class, db.data.siprp_local.outer.PrtGruposProtocoloData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeymarcacoes_trabalhador_estado_idTomarcacoes_trabalhador_estados = + new com.evolute.entity.ForeignKey( MarcacoesGruposRealizados.class, MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID, db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData.class, db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData.ID ); + + public static final String TABLENAME = "marcacoes_grupos_realizados"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.marcacoes_grupos_realizados"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_grupos_realizados.id"; + public static final int ID_INDEX = 0; + public static final String MARCACAO_TRABALHADOR_ID = "marcacao_trabalhador_id"; + public static final String MARCACAO_TRABALHADOR_ID_FULL = "marcacoes_grupos_realizados.marcacao_trabalhador_id"; + public static final int MARCACAO_TRABALHADOR_ID_INDEX = 1; + public static final String TO_MARCACAO_TRABALHADOR_ID = "to_marcacao_trabalhador_id"; + public static final String TO_MARCACAO_TRABALHADOR_ID_FULL = "marcacoes_grupos_realizados.to_marcacao_trabalhador_id"; + public static final int TO_MARCACAO_TRABALHADOR_ID_INDEX = 2; + public static final String GRUPO_PROTOCOLO_ID = "grupo_protocolo_id"; + public static final String GRUPO_PROTOCOLO_ID_FULL = "marcacoes_grupos_realizados.grupo_protocolo_id"; + public static final int GRUPO_PROTOCOLO_ID_INDEX = 3; + public static final String TO_GRUPO_PROTOCOLO_ID = "to_grupo_protocolo_id"; + public static final String TO_GRUPO_PROTOCOLO_ID_FULL = "marcacoes_grupos_realizados.to_grupo_protocolo_id"; + public static final int TO_GRUPO_PROTOCOLO_ID_INDEX = 4; + public static final String MARCACOES_TRABALHADOR_ESTADO_ID = "marcacoes_trabalhador_estado_id"; + public static final String MARCACOES_TRABALHADOR_ESTADO_ID_FULL = "marcacoes_grupos_realizados.marcacoes_trabalhador_estado_id"; + public static final int MARCACOES_TRABALHADOR_ESTADO_ID_INDEX = 5; + public static final String TO_MARCACOES_TRABALHADOR_ESTADO_ID = "to_marcacoes_trabalhador_estado_id"; + public static final String TO_MARCACOES_TRABALHADOR_ESTADO_ID_FULL = "marcacoes_grupos_realizados.to_marcacoes_trabalhador_estado_id"; + public static final int TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + MARCACAO_TRABALHADOR_ID, TO_MARCACAO_TRABALHADOR_ID, GRUPO_PROTOCOLO_ID, + TO_GRUPO_PROTOCOLO_ID, MARCACOES_TRABALHADOR_ESTADO_ID, + TO_MARCACOES_TRABALHADOR_ESTADO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + MARCACAO_TRABALHADOR_ID, TABLENAME + "." + TO_MARCACAO_TRABALHADOR_ID, TABLENAME + "." + GRUPO_PROTOCOLO_ID, + TABLENAME + "." + TO_GRUPO_PROTOCOLO_ID, TABLENAME + "." + MARCACOES_TRABALHADOR_ESTADO_ID, + TABLENAME + "." + TO_MARCACOES_TRABALHADOR_ESTADO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, MARCACAO_TRABALHADOR_ID, GRUPO_PROTOCOLO_ID, + MARCACOES_TRABALHADOR_ESTADO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, MARCACAO_TRABALHADOR_ID, GRUPO_PROTOCOLO_ID, + MARCACOES_TRABALHADOR_ESTADO_ID, }; + + private Integer id; + private Integer marcacao_trabalhador_id; + private db.data.siprp_local.outer.MarcacoesTrabalhadorData to_marcacao_trabalhador_id; + private Integer grupo_protocolo_id; + private db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_protocolo_id; + private Integer marcacoes_trabalhador_estado_id; + private db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData to_marcacoes_trabalhador_estado_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesGruposRealizados() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getMarcacao_trabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCACAO_TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marcacao_trabalhador_id; + } + + public void setMarcacao_trabalhador_id( Integer marcacao_trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCACAO_TRABALHADOR_ID, marcacao_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marcacao_trabalhador_id = marcacao_trabalhador_id; + LAZY_LOADED_OBJECTS.put( MARCACAO_TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesTrabalhadorData toMarcacao_trabalhador_id() + { + try + { + prepare( TO_MARCACAO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_marcacao_trabalhador_id; + } + + public void setToMarcacao_trabalhador_id( db.data.siprp_local.outer.MarcacoesTrabalhadorData to_marcacao_trabalhador_id ) + { + try + { + preProcess( TO_MARCACAO_TRABALHADOR_ID, to_marcacao_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_marcacao_trabalhador_id = to_marcacao_trabalhador_id; + } + + public Integer getGrupo_protocolo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( GRUPO_PROTOCOLO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.grupo_protocolo_id; + } + + public void setGrupo_protocolo_id( Integer grupo_protocolo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( GRUPO_PROTOCOLO_ID, grupo_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.grupo_protocolo_id = grupo_protocolo_id; + LAZY_LOADED_OBJECTS.put( GRUPO_PROTOCOLO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrtGruposProtocoloData toGrupo_protocolo_id() + { + try + { + prepare( TO_GRUPO_PROTOCOLO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_grupo_protocolo_id; + } + + public void setToGrupo_protocolo_id( db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_protocolo_id ) + { + try + { + preProcess( TO_GRUPO_PROTOCOLO_ID, to_grupo_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_grupo_protocolo_id = to_grupo_protocolo_id; + } + + public Integer getMarcacoes_trabalhador_estado_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCACOES_TRABALHADOR_ESTADO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marcacoes_trabalhador_estado_id; + } + + public void setMarcacoes_trabalhador_estado_id( Integer marcacoes_trabalhador_estado_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCACOES_TRABALHADOR_ESTADO_ID, marcacoes_trabalhador_estado_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marcacoes_trabalhador_estado_id = marcacoes_trabalhador_estado_id; + LAZY_LOADED_OBJECTS.put( MARCACOES_TRABALHADOR_ESTADO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData toMarcacoes_trabalhador_estado_id() + { + try + { + prepare( TO_MARCACOES_TRABALHADOR_ESTADO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_marcacoes_trabalhador_estado_id; + } + + public void setToMarcacoes_trabalhador_estado_id( db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData to_marcacoes_trabalhador_estado_id ) + { + try + { + preProcess( TO_MARCACOES_TRABALHADOR_ESTADO_ID, to_marcacoes_trabalhador_estado_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_marcacoes_trabalhador_estado_id = to_marcacoes_trabalhador_estado_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesGruposRealizados.ID_INDEX: + value = getId(); + break; + case MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX: + value = getMarcacao_trabalhador_id(); + break; + case MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID_INDEX: + value = toMarcacao_trabalhador_id(); + break; + case MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX: + value = getGrupo_protocolo_id(); + break; + case MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID_INDEX: + value = toGrupo_protocolo_id(); + break; + case MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + value = getMarcacoes_trabalhador_estado_id(); + break; + case MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + value = toMarcacoes_trabalhador_estado_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesGruposRealizados.ID_INDEX: + value = this.id; + break; + case MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX: + value = this.marcacao_trabalhador_id; + break; + case MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID_INDEX: + value = this.to_marcacao_trabalhador_id; + break; + case MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX: + value = this.grupo_protocolo_id; + break; + case MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID_INDEX: + value = this.to_grupo_protocolo_id; + break; + case MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + value = this.marcacoes_trabalhador_estado_id; + break; + case MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + value = this.to_marcacoes_trabalhador_estado_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesGruposRealizados.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX: + setMarcacao_trabalhador_id( ( Integer ) value ); + break; + case MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID_INDEX: + setToMarcacao_trabalhador_id( ( db.data.siprp_local.outer.MarcacoesTrabalhadorData ) value ); + break; + case MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX: + setGrupo_protocolo_id( ( Integer ) value ); + break; + case MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID_INDEX: + setToGrupo_protocolo_id( ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value ); + break; + case MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + setMarcacoes_trabalhador_estado_id( ( Integer ) value ); + break; + case MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + setToMarcacoes_trabalhador_estado_id( ( db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesGruposRealizados.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX: + this.marcacao_trabalhador_id = ( Integer ) value; + break; + case MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID_INDEX: + this.to_marcacao_trabalhador_id = ( db.data.siprp_local.outer.MarcacoesTrabalhadorData ) value; + break; + case MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX: + this.grupo_protocolo_id = ( Integer ) value; + break; + case MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID_INDEX: + this.to_grupo_protocolo_id = ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value; + break; + case MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + this.marcacoes_trabalhador_estado_id = ( Integer ) value; + break; + case MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + this.to_marcacoes_trabalhador_estado_id = ( db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesGruposRealizados.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesGruposRealizados.MARCACAO_TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesGruposRealizados.TO_MARCACAO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesTrabalhadorData.class; + break; + case MarcacoesGruposRealizados.GRUPO_PROTOCOLO_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesGruposRealizados.TO_GRUPO_PROTOCOLO_ID_INDEX: + theClass = db.data.siprp_local.outer.PrtGruposProtocoloData.class; + break; + case MarcacoesGruposRealizados.MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesGruposRealizados.TO_MARCACOES_TRABALHADOR_ESTADO_ID_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesGruposRealizados._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesGruposRealizados.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTecnicosHst.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTecnicosHst.java new file mode 100644 index 00000000..7fe45391 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTecnicosHst.java @@ -0,0 +1,763 @@ +/* +* MarcacoesTecnicosHst.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class MarcacoesTecnicosHst extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesTecnicosHst.ID, MarcacoesTecnicosHst.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.ID_FULL, MarcacoesTecnicosHst.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.NOME, MarcacoesTecnicosHst.NOME_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.NOME_FULL, MarcacoesTecnicosHst.NOME_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.NOME_PLAIN, MarcacoesTecnicosHst.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.NOME_PLAIN_FULL, MarcacoesTecnicosHst.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.INICIAIS, MarcacoesTecnicosHst.INICIAIS_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.INICIAIS_FULL, MarcacoesTecnicosHst.INICIAIS_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.IDENTIFICADOR, MarcacoesTecnicosHst.IDENTIFICADOR_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.IDENTIFICADOR_FULL, MarcacoesTecnicosHst.IDENTIFICADOR_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.INACTIVO, MarcacoesTecnicosHst.INACTIVO_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.INACTIVO_FULL, MarcacoesTecnicosHst.INACTIVO_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.CAP, MarcacoesTecnicosHst.CAP_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.CAP_FULL, MarcacoesTecnicosHst.CAP_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.FORMACAO, MarcacoesTecnicosHst.FORMACAO_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.FORMACAO_FULL, MarcacoesTecnicosHst.FORMACAO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesTecnicosHst.CLASS_IDENTIFIER, MarcacoesTecnicosHst.ASSINATURA, MarcacoesTecnicosHst.TO_ASSINATURA ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.ASSINATURA, MarcacoesTecnicosHst.ASSINATURA_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.ASSINATURA_FULL, MarcacoesTecnicosHst.ASSINATURA_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.TO_ASSINATURA, MarcacoesTecnicosHst.TO_ASSINATURA_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.IS_SUPERIOR, MarcacoesTecnicosHst.IS_SUPERIOR_INDEX ); + FIELD_INDEXES.put( MarcacoesTecnicosHst.IS_SUPERIOR_FULL, MarcacoesTecnicosHst.IS_SUPERIOR_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyassinaturaToimage = + new com.evolute.entity.ForeignKey( MarcacoesTecnicosHst.class, MarcacoesTecnicosHst.ASSINATURA, db.data.siprp_local.outer.ImageData.class, db.data.siprp_local.outer.ImageData.ID ); + + public static final String TABLENAME = "marcacoes_tecnicos_hst"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.marcacoes_tecnicos_hst"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_tecnicos_hst.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "marcacoes_tecnicos_hst.nome"; + public static final int NOME_INDEX = 1; + public static final String NOME_PLAIN = "nome_plain"; + public static final String NOME_PLAIN_FULL = "marcacoes_tecnicos_hst.nome_plain"; + public static final int NOME_PLAIN_INDEX = 2; + public static final String INICIAIS = "iniciais"; + public static final String INICIAIS_FULL = "marcacoes_tecnicos_hst.iniciais"; + public static final int INICIAIS_INDEX = 3; + public static final String IDENTIFICADOR = "identificador"; + public static final String IDENTIFICADOR_FULL = "marcacoes_tecnicos_hst.identificador"; + public static final int IDENTIFICADOR_INDEX = 4; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "marcacoes_tecnicos_hst.inactivo"; + public static final int INACTIVO_INDEX = 5; + public static final String CAP = "cap"; + public static final String CAP_FULL = "marcacoes_tecnicos_hst.cap"; + public static final int CAP_INDEX = 6; + public static final String FORMACAO = "formacao"; + public static final String FORMACAO_FULL = "marcacoes_tecnicos_hst.formacao"; + public static final int FORMACAO_INDEX = 7; + public static final String ASSINATURA = "assinatura"; + public static final String ASSINATURA_FULL = "marcacoes_tecnicos_hst.assinatura"; + public static final int ASSINATURA_INDEX = 8; + public static final String TO_ASSINATURA = "to_assinatura"; + public static final String TO_ASSINATURA_FULL = "marcacoes_tecnicos_hst.to_assinatura"; + public static final int TO_ASSINATURA_INDEX = 9; + public static final String IS_SUPERIOR = "is_superior"; + public static final String IS_SUPERIOR_FULL = "marcacoes_tecnicos_hst.is_superior"; + public static final int IS_SUPERIOR_INDEX = 10; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, NOME_PLAIN, INICIAIS, IDENTIFICADOR, INACTIVO, CAP, FORMACAO, ASSINATURA, + TO_ASSINATURA, IS_SUPERIOR, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + NOME_PLAIN, TABLENAME + "." + INICIAIS, TABLENAME + "." + IDENTIFICADOR, TABLENAME + "." + INACTIVO, TABLENAME + "." + CAP, TABLENAME + "." + FORMACAO, TABLENAME + "." + ASSINATURA, + TABLENAME + "." + TO_ASSINATURA, TABLENAME + "." + IS_SUPERIOR, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, NOME_PLAIN, INICIAIS, IDENTIFICADOR, INACTIVO, CAP, FORMACAO, ASSINATURA, + IS_SUPERIOR, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, NOME_PLAIN, INICIAIS, IDENTIFICADOR, INACTIVO, CAP, FORMACAO, ASSINATURA, + IS_SUPERIOR, }; + + private Integer id; + private String nome; + private String nome_plain; + private String iniciais; + private Integer identificador; + private String inactivo; + private String cap; + private String formacao; + private Integer assinatura; + private db.data.siprp_local.outer.ImageData to_assinatura; + private String is_superior; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesTecnicosHst() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromMarcacoesEstabelecimento_tecnico_hst() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "tecnico_hst" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesEstabelecimento_tecnico_superior_hst() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesEstabelecimentoData.class , getPrimaryKey().getMap().get("id"), "tecnico_superior_hst" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getNome_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_plain; + } + + public void setNome_plain( String nome_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME_PLAIN, nome_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_plain = nome_plain; + LAZY_LOADED_OBJECTS.put( NOME_PLAIN, Boolean.TRUE ); + } + + public String getIniciais() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INICIAIS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.iniciais; + } + + public void setIniciais( String iniciais ) + { + try + { + setLockedForRefresh( true ); + preProcess( INICIAIS, iniciais ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.iniciais = iniciais; + LAZY_LOADED_OBJECTS.put( INICIAIS, Boolean.TRUE ); + } + + public Integer getIdentificador() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IDENTIFICADOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.identificador; + } + + public void setIdentificador( Integer identificador ) + { + try + { + setLockedForRefresh( true ); + preProcess( IDENTIFICADOR, identificador ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.identificador = identificador; + LAZY_LOADED_OBJECTS.put( IDENTIFICADOR, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public String getCap() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CAP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.cap; + } + + public void setCap( String cap ) + { + try + { + setLockedForRefresh( true ); + preProcess( CAP, cap ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.cap = cap; + LAZY_LOADED_OBJECTS.put( CAP, Boolean.TRUE ); + } + + public String getFormacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FORMACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.formacao; + } + + public void setFormacao( String formacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( FORMACAO, formacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.formacao = formacao; + LAZY_LOADED_OBJECTS.put( FORMACAO, Boolean.TRUE ); + } + + public Integer getAssinatura() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ASSINATURA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.assinatura; + } + + public void setAssinatura( Integer assinatura ) + { + try + { + setLockedForRefresh( true ); + preProcess( ASSINATURA, assinatura ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.assinatura = assinatura; + LAZY_LOADED_OBJECTS.put( ASSINATURA, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ImageData toAssinatura() + { + try + { + prepare( TO_ASSINATURA ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_assinatura; + } + + public void setToAssinatura( db.data.siprp_local.outer.ImageData to_assinatura ) + { + try + { + preProcess( TO_ASSINATURA, to_assinatura ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_assinatura = to_assinatura; + } + + public String getIs_superior() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( IS_SUPERIOR ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.is_superior; + } + + public void setIs_superior( String is_superior ) + { + try + { + setLockedForRefresh( true ); + preProcess( IS_SUPERIOR, is_superior ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.is_superior = is_superior; + LAZY_LOADED_OBJECTS.put( IS_SUPERIOR, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTecnicosHst.ID_INDEX: + value = getId(); + break; + case MarcacoesTecnicosHst.NOME_INDEX: + value = getNome(); + break; + case MarcacoesTecnicosHst.NOME_PLAIN_INDEX: + value = getNome_plain(); + break; + case MarcacoesTecnicosHst.INICIAIS_INDEX: + value = getIniciais(); + break; + case MarcacoesTecnicosHst.IDENTIFICADOR_INDEX: + value = getIdentificador(); + break; + case MarcacoesTecnicosHst.INACTIVO_INDEX: + value = getInactivo(); + break; + case MarcacoesTecnicosHst.CAP_INDEX: + value = getCap(); + break; + case MarcacoesTecnicosHst.FORMACAO_INDEX: + value = getFormacao(); + break; + case MarcacoesTecnicosHst.ASSINATURA_INDEX: + value = getAssinatura(); + break; + case MarcacoesTecnicosHst.TO_ASSINATURA_INDEX: + value = toAssinatura(); + break; + case MarcacoesTecnicosHst.IS_SUPERIOR_INDEX: + value = getIs_superior(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTecnicosHst.ID_INDEX: + value = this.id; + break; + case MarcacoesTecnicosHst.NOME_INDEX: + value = this.nome; + break; + case MarcacoesTecnicosHst.NOME_PLAIN_INDEX: + value = this.nome_plain; + break; + case MarcacoesTecnicosHst.INICIAIS_INDEX: + value = this.iniciais; + break; + case MarcacoesTecnicosHst.IDENTIFICADOR_INDEX: + value = this.identificador; + break; + case MarcacoesTecnicosHst.INACTIVO_INDEX: + value = this.inactivo; + break; + case MarcacoesTecnicosHst.CAP_INDEX: + value = this.cap; + break; + case MarcacoesTecnicosHst.FORMACAO_INDEX: + value = this.formacao; + break; + case MarcacoesTecnicosHst.ASSINATURA_INDEX: + value = this.assinatura; + break; + case MarcacoesTecnicosHst.TO_ASSINATURA_INDEX: + value = this.to_assinatura; + break; + case MarcacoesTecnicosHst.IS_SUPERIOR_INDEX: + value = this.is_superior; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTecnicosHst.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesTecnicosHst.NOME_INDEX: + setNome( ( String ) value ); + break; + case MarcacoesTecnicosHst.NOME_PLAIN_INDEX: + setNome_plain( ( String ) value ); + break; + case MarcacoesTecnicosHst.INICIAIS_INDEX: + setIniciais( ( String ) value ); + break; + case MarcacoesTecnicosHst.IDENTIFICADOR_INDEX: + setIdentificador( ( Integer ) value ); + break; + case MarcacoesTecnicosHst.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + case MarcacoesTecnicosHst.CAP_INDEX: + setCap( ( String ) value ); + break; + case MarcacoesTecnicosHst.FORMACAO_INDEX: + setFormacao( ( String ) value ); + break; + case MarcacoesTecnicosHst.ASSINATURA_INDEX: + setAssinatura( ( Integer ) value ); + break; + case MarcacoesTecnicosHst.TO_ASSINATURA_INDEX: + setToAssinatura( ( db.data.siprp_local.outer.ImageData ) value ); + break; + case MarcacoesTecnicosHst.IS_SUPERIOR_INDEX: + setIs_superior( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTecnicosHst.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesTecnicosHst.NOME_INDEX: + this.nome = ( String ) value; + break; + case MarcacoesTecnicosHst.NOME_PLAIN_INDEX: + this.nome_plain = ( String ) value; + break; + case MarcacoesTecnicosHst.INICIAIS_INDEX: + this.iniciais = ( String ) value; + break; + case MarcacoesTecnicosHst.IDENTIFICADOR_INDEX: + this.identificador = ( Integer ) value; + break; + case MarcacoesTecnicosHst.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + case MarcacoesTecnicosHst.CAP_INDEX: + this.cap = ( String ) value; + break; + case MarcacoesTecnicosHst.FORMACAO_INDEX: + this.formacao = ( String ) value; + break; + case MarcacoesTecnicosHst.ASSINATURA_INDEX: + this.assinatura = ( Integer ) value; + break; + case MarcacoesTecnicosHst.TO_ASSINATURA_INDEX: + this.to_assinatura = ( db.data.siprp_local.outer.ImageData ) value; + break; + case MarcacoesTecnicosHst.IS_SUPERIOR_INDEX: + this.is_superior = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesTecnicosHst.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTecnicosHst.NOME_INDEX: + theClass = String.class; + break; + case MarcacoesTecnicosHst.NOME_PLAIN_INDEX: + theClass = String.class; + break; + case MarcacoesTecnicosHst.INICIAIS_INDEX: + theClass = String.class; + break; + case MarcacoesTecnicosHst.IDENTIFICADOR_INDEX: + theClass = Integer.class; + break; + case MarcacoesTecnicosHst.INACTIVO_INDEX: + theClass = String.class; + break; + case MarcacoesTecnicosHst.CAP_INDEX: + theClass = String.class; + break; + case MarcacoesTecnicosHst.FORMACAO_INDEX: + theClass = String.class; + break; + case MarcacoesTecnicosHst.ASSINATURA_INDEX: + theClass = Integer.class; + break; + case MarcacoesTecnicosHst.TO_ASSINATURA_INDEX: + theClass = db.data.siprp_local.outer.ImageData.class; + break; + case MarcacoesTecnicosHst.IS_SUPERIOR_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesTecnicosHst._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesTecnicosHst.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTrabalhador.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTrabalhador.java new file mode 100644 index 00000000..6db98e5b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTrabalhador.java @@ -0,0 +1,1030 @@ +/* +* MarcacoesTrabalhador.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class MarcacoesTrabalhador extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesTrabalhador.ID, MarcacoesTrabalhador.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.ID_FULL, MarcacoesTrabalhador.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA, MarcacoesTrabalhador.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_FULL, MarcacoesTrabalhador.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.REALIZADA, MarcacoesTrabalhador.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.REALIZADA_FULL, MarcacoesTrabalhador.REALIZADA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_EMAIL, MarcacoesTrabalhador.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_EMAIL_FULL, MarcacoesTrabalhador.DATA_EMAIL_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_RELATORIO, MarcacoesTrabalhador.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DATA_RELATORIO_FULL, MarcacoesTrabalhador.DATA_RELATORIO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TIPO, MarcacoesTrabalhador.TIPO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TIPO_FULL, MarcacoesTrabalhador.TIPO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesTrabalhador.CLASS_IDENTIFIER, MarcacoesTrabalhador.TRABALHADOR_ID, MarcacoesTrabalhador.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TRABALHADOR_ID, MarcacoesTrabalhador.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TRABALHADOR_ID_FULL, MarcacoesTrabalhador.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TO_TRABALHADOR_ID, MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.MOTIVO, MarcacoesTrabalhador.MOTIVO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.MOTIVO_FULL, MarcacoesTrabalhador.MOTIVO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.ESTADO, MarcacoesTrabalhador.ESTADO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.ESTADO_FULL, MarcacoesTrabalhador.ESTADO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.OBSERVACOES, MarcacoesTrabalhador.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.OBSERVACOES_FULL, MarcacoesTrabalhador.OBSERVACOES_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesTrabalhador.CLASS_IDENTIFIER, MarcacoesTrabalhador.PRESTADOR_ID, MarcacoesTrabalhador.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( MarcacoesTrabalhador.PRESTADOR_ID, MarcacoesTrabalhador.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.PRESTADOR_ID_FULL, MarcacoesTrabalhador.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.TO_PRESTADOR_ID, MarcacoesTrabalhador.TO_PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.MEDICO_ID, MarcacoesTrabalhador.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.MEDICO_ID_FULL, MarcacoesTrabalhador.MEDICO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.INSERTED_STAMP, MarcacoesTrabalhador.INSERTED_STAMP_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.INSERTED_STAMP_FULL, MarcacoesTrabalhador.INSERTED_STAMP_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DELETED_STAMP, MarcacoesTrabalhador.DELETED_STAMP_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhador.DELETED_STAMP_FULL, MarcacoesTrabalhador.DELETED_STAMP_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( MarcacoesTrabalhador.class, MarcacoesTrabalhador.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( MarcacoesTrabalhador.class, MarcacoesTrabalhador.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final String TABLENAME = "marcacoes_trabalhador"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.marcacoes_trabalhador"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_trabalhador.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_trabalhador.data"; + public static final int DATA_INDEX = 1; + public static final String REALIZADA = "realizada"; + public static final String REALIZADA_FULL = "marcacoes_trabalhador.realizada"; + public static final int REALIZADA_INDEX = 2; + public static final String DATA_EMAIL = "data_email"; + public static final String DATA_EMAIL_FULL = "marcacoes_trabalhador.data_email"; + public static final int DATA_EMAIL_INDEX = 3; + public static final String DATA_RELATORIO = "data_relatorio"; + public static final String DATA_RELATORIO_FULL = "marcacoes_trabalhador.data_relatorio"; + public static final int DATA_RELATORIO_INDEX = 4; + public static final String TIPO = "tipo"; + public static final String TIPO_FULL = "marcacoes_trabalhador.tipo"; + public static final int TIPO_INDEX = 5; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "marcacoes_trabalhador.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 6; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "marcacoes_trabalhador.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 7; + public static final String MOTIVO = "motivo"; + public static final String MOTIVO_FULL = "marcacoes_trabalhador.motivo"; + public static final int MOTIVO_INDEX = 8; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "marcacoes_trabalhador.estado"; + public static final int ESTADO_INDEX = 9; + public static final String OBSERVACOES = "observacoes"; + public static final String OBSERVACOES_FULL = "marcacoes_trabalhador.observacoes"; + public static final int OBSERVACOES_INDEX = 10; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "marcacoes_trabalhador.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 11; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "marcacoes_trabalhador.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 12; + public static final String MEDICO_ID = "medico_id"; + public static final String MEDICO_ID_FULL = "marcacoes_trabalhador.medico_id"; + public static final int MEDICO_ID_INDEX = 13; + public static final String INSERTED_STAMP = "inserted_stamp"; + public static final String INSERTED_STAMP_FULL = "marcacoes_trabalhador.inserted_stamp"; + public static final int INSERTED_STAMP_INDEX = 14; + public static final String DELETED_STAMP = "deleted_stamp"; + public static final String DELETED_STAMP_FULL = "marcacoes_trabalhador.deleted_stamp"; + public static final int DELETED_STAMP_INDEX = 15; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR_ID, + TO_TRABALHADOR_ID, MOTIVO, ESTADO, OBSERVACOES, PRESTADOR_ID, TO_PRESTADOR_ID, + MEDICO_ID, INSERTED_STAMP, DELETED_STAMP, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + REALIZADA, TABLENAME + "." + DATA_EMAIL, TABLENAME + "." + DATA_RELATORIO, TABLENAME + "." + TIPO, TABLENAME + "." + TRABALHADOR_ID, + TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + MOTIVO, TABLENAME + "." + ESTADO, TABLENAME + "." + OBSERVACOES, TABLENAME + "." + PRESTADOR_ID, TABLENAME + "." + TO_PRESTADOR_ID, + TABLENAME + "." + MEDICO_ID, TABLENAME + "." + INSERTED_STAMP, TABLENAME + "." + DELETED_STAMP, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR_ID, MOTIVO, ESTADO, + OBSERVACOES, PRESTADOR_ID, MEDICO_ID, INSERTED_STAMP, DELETED_STAMP, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, REALIZADA, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR_ID, MOTIVO, ESTADO, + OBSERVACOES, PRESTADOR_ID, MEDICO_ID, INSERTED_STAMP, DELETED_STAMP, }; + + private Integer id; + private java.util.Date data; + private String realizada; + private java.util.Date data_email; + private java.util.Date data_relatorio; + private Integer tipo; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private Integer motivo; + private Integer estado; + private String observacoes; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + private Integer medico_id; + private java.sql.Timestamp inserted_stamp; + private java.sql.Timestamp deleted_stamp; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesTrabalhador() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromLembretes_marcacao_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "marcacao_trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesGruposRealizados_marcacao_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesGruposRealizadosData.class , getPrimaryKey().getMap().get("id"), "marcacao_trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesTrabalhadorEstados_marcacao_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData.class , getPrimaryKey().getMap().get("id"), "marcacao_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getRealizada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( REALIZADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.realizada; + } + + public void setRealizada( String realizada ) + { + try + { + setLockedForRefresh( true ); + preProcess( REALIZADA, realizada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.realizada = realizada; + LAZY_LOADED_OBJECTS.put( REALIZADA, Boolean.TRUE ); + } + + public java.util.Date getData_email() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMAIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_email; + } + + public void setData_email( java.util.Date data_email ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_EMAIL, data_email ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_email = data_email; + LAZY_LOADED_OBJECTS.put( DATA_EMAIL, Boolean.TRUE ); + } + + public java.util.Date getData_relatorio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RELATORIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_relatorio; + } + + public void setData_relatorio( java.util.Date data_relatorio ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_RELATORIO, data_relatorio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_relatorio = data_relatorio; + LAZY_LOADED_OBJECTS.put( DATA_RELATORIO, Boolean.TRUE ); + } + + public Integer getTipo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo; + } + + public void setTipo( Integer tipo ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO, tipo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo = tipo; + LAZY_LOADED_OBJECTS.put( TIPO, Boolean.TRUE ); + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getMotivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MOTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.motivo; + } + + public void setMotivo( Integer motivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( MOTIVO, motivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.motivo = motivo; + LAZY_LOADED_OBJECTS.put( MOTIVO, Boolean.TRUE ); + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public String getObservacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes; + } + + public void setObservacoes( String observacoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACOES, observacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes = observacoes; + LAZY_LOADED_OBJECTS.put( OBSERVACOES, Boolean.TRUE ); + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Integer getMedico_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MEDICO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.medico_id; + } + + public void setMedico_id( Integer medico_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MEDICO_ID, medico_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.medico_id = medico_id; + LAZY_LOADED_OBJECTS.put( MEDICO_ID, Boolean.TRUE ); + } + + public java.sql.Timestamp getInserted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INSERTED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inserted_stamp; + } + + public void setInserted_stamp( java.sql.Timestamp inserted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( INSERTED_STAMP, inserted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inserted_stamp = inserted_stamp; + LAZY_LOADED_OBJECTS.put( INSERTED_STAMP, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_stamp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_STAMP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_stamp; + } + + public void setDeleted_stamp( java.sql.Timestamp deleted_stamp ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_STAMP, deleted_stamp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_stamp = deleted_stamp; + LAZY_LOADED_OBJECTS.put( DELETED_STAMP, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + value = getId(); + break; + case MarcacoesTrabalhador.DATA_INDEX: + value = getData(); + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + value = getRealizada(); + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + value = getData_email(); + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + value = getData_relatorio(); + break; + case MarcacoesTrabalhador.TIPO_INDEX: + value = getTipo(); + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case MarcacoesTrabalhador.MOTIVO_INDEX: + value = getMotivo(); + break; + case MarcacoesTrabalhador.ESTADO_INDEX: + value = getEstado(); + break; + case MarcacoesTrabalhador.OBSERVACOES_INDEX: + value = getObservacoes(); + break; + case MarcacoesTrabalhador.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case MarcacoesTrabalhador.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + case MarcacoesTrabalhador.MEDICO_ID_INDEX: + value = getMedico_id(); + break; + case MarcacoesTrabalhador.INSERTED_STAMP_INDEX: + value = getInserted_stamp(); + break; + case MarcacoesTrabalhador.DELETED_STAMP_INDEX: + value = getDeleted_stamp(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + value = this.id; + break; + case MarcacoesTrabalhador.DATA_INDEX: + value = this.data; + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + value = this.realizada; + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + value = this.data_email; + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + value = this.data_relatorio; + break; + case MarcacoesTrabalhador.TIPO_INDEX: + value = this.tipo; + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case MarcacoesTrabalhador.MOTIVO_INDEX: + value = this.motivo; + break; + case MarcacoesTrabalhador.ESTADO_INDEX: + value = this.estado; + break; + case MarcacoesTrabalhador.OBSERVACOES_INDEX: + value = this.observacoes; + break; + case MarcacoesTrabalhador.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case MarcacoesTrabalhador.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + case MarcacoesTrabalhador.MEDICO_ID_INDEX: + value = this.medico_id; + break; + case MarcacoesTrabalhador.INSERTED_STAMP_INDEX: + value = this.inserted_stamp; + break; + case MarcacoesTrabalhador.DELETED_STAMP_INDEX: + value = this.deleted_stamp; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesTrabalhador.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + setRealizada( ( String ) value ); + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + setData_email( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + setData_relatorio( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhador.TIPO_INDEX: + setTipo( ( Integer ) value ); + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case MarcacoesTrabalhador.MOTIVO_INDEX: + setMotivo( ( Integer ) value ); + break; + case MarcacoesTrabalhador.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case MarcacoesTrabalhador.OBSERVACOES_INDEX: + setObservacoes( ( String ) value ); + break; + case MarcacoesTrabalhador.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case MarcacoesTrabalhador.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case MarcacoesTrabalhador.MEDICO_ID_INDEX: + setMedico_id( ( Integer ) value ); + break; + case MarcacoesTrabalhador.INSERTED_STAMP_INDEX: + setInserted_stamp( ( java.sql.Timestamp ) value ); + break; + case MarcacoesTrabalhador.DELETED_STAMP_INDEX: + setDeleted_stamp( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesTrabalhador.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + this.realizada = ( String ) value; + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + this.data_email = ( java.util.Date ) value; + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + this.data_relatorio = ( java.util.Date ) value; + break; + case MarcacoesTrabalhador.TIPO_INDEX: + this.tipo = ( Integer ) value; + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case MarcacoesTrabalhador.MOTIVO_INDEX: + this.motivo = ( Integer ) value; + break; + case MarcacoesTrabalhador.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case MarcacoesTrabalhador.OBSERVACOES_INDEX: + this.observacoes = ( String ) value; + break; + case MarcacoesTrabalhador.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case MarcacoesTrabalhador.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case MarcacoesTrabalhador.MEDICO_ID_INDEX: + this.medico_id = ( Integer ) value; + break; + case MarcacoesTrabalhador.INSERTED_STAMP_INDEX: + this.inserted_stamp = ( java.sql.Timestamp ) value; + break; + case MarcacoesTrabalhador.DELETED_STAMP_INDEX: + this.deleted_stamp = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesTrabalhador.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhador.REALIZADA_INDEX: + theClass = String.class; + break; + case MarcacoesTrabalhador.DATA_EMAIL_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhador.DATA_RELATORIO_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhador.TIPO_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case MarcacoesTrabalhador.MOTIVO_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.ESTADO_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.OBSERVACOES_INDEX: + theClass = String.class; + break; + case MarcacoesTrabalhador.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case MarcacoesTrabalhador.MEDICO_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhador.INSERTED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + case MarcacoesTrabalhador.DELETED_STAMP_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesTrabalhador._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesTrabalhador.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTrabalhadorEstados.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTrabalhadorEstados.java new file mode 100644 index 00000000..6d386be3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/MarcacoesTrabalhadorEstados.java @@ -0,0 +1,545 @@ +/* +* MarcacoesTrabalhadorEstados.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class MarcacoesTrabalhadorEstados extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.ID, MarcacoesTrabalhadorEstados.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.ID_FULL, MarcacoesTrabalhadorEstados.ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.DATA, MarcacoesTrabalhadorEstados.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.DATA_FULL, MarcacoesTrabalhadorEstados.DATA_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.ESTADO, MarcacoesTrabalhadorEstados.ESTADO_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.ESTADO_FULL, MarcacoesTrabalhadorEstados.ESTADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesTrabalhadorEstados.CLASS_IDENTIFIER, MarcacoesTrabalhadorEstados.MARCACAO_ID, MarcacoesTrabalhadorEstados.TO_MARCACAO_ID ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.MARCACAO_ID, MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.MARCACAO_ID_FULL, MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.TO_MARCACAO_ID, MarcacoesTrabalhadorEstados.TO_MARCACAO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( MarcacoesTrabalhadorEstados.CLASS_IDENTIFIER, MarcacoesTrabalhadorEstados.PRESTADOR_ID, MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.PRESTADOR_ID, MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.PRESTADOR_ID_FULL, MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID, MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeymarcacao_idTomarcacoes_trabalhador = + new com.evolute.entity.ForeignKey( MarcacoesTrabalhadorEstados.class, MarcacoesTrabalhadorEstados.MARCACAO_ID, db.data.siprp_local.outer.MarcacoesTrabalhadorData.class, db.data.siprp_local.outer.MarcacoesTrabalhadorData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( MarcacoesTrabalhadorEstados.class, MarcacoesTrabalhadorEstados.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final String TABLENAME = "marcacoes_trabalhador_estados"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.marcacoes_trabalhador_estados"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "marcacoes_trabalhador_estados.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "marcacoes_trabalhador_estados.data"; + public static final int DATA_INDEX = 1; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "marcacoes_trabalhador_estados.estado"; + public static final int ESTADO_INDEX = 2; + public static final String MARCACAO_ID = "marcacao_id"; + public static final String MARCACAO_ID_FULL = "marcacoes_trabalhador_estados.marcacao_id"; + public static final int MARCACAO_ID_INDEX = 3; + public static final String TO_MARCACAO_ID = "to_marcacao_id"; + public static final String TO_MARCACAO_ID_FULL = "marcacoes_trabalhador_estados.to_marcacao_id"; + public static final int TO_MARCACAO_ID_INDEX = 4; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "marcacoes_trabalhador_estados.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 5; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "marcacoes_trabalhador_estados.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, ESTADO, MARCACAO_ID, TO_MARCACAO_ID, PRESTADOR_ID, TO_PRESTADOR_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + ESTADO, TABLENAME + "." + MARCACAO_ID, TABLENAME + "." + TO_MARCACAO_ID, TABLENAME + "." + PRESTADOR_ID, TABLENAME + "." + TO_PRESTADOR_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, ESTADO, MARCACAO_ID, PRESTADOR_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, ESTADO, MARCACAO_ID, PRESTADOR_ID, }; + + private Integer id; + private java.util.Date data; + private Integer estado; + private Integer marcacao_id; + private db.data.siprp_local.outer.MarcacoesTrabalhadorData to_marcacao_id; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public MarcacoesTrabalhadorEstados() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromMarcacoesGruposRealizados_marcacoes_trabalhador_estado_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesGruposRealizadosData.class , getPrimaryKey().getMap().get("id"), "marcacoes_trabalhador_estado_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getMarcacao_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MARCACAO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.marcacao_id; + } + + public void setMarcacao_id( Integer marcacao_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( MARCACAO_ID, marcacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.marcacao_id = marcacao_id; + LAZY_LOADED_OBJECTS.put( MARCACAO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.MarcacoesTrabalhadorData toMarcacao_id() + { + try + { + prepare( TO_MARCACAO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_marcacao_id; + } + + public void setToMarcacao_id( db.data.siprp_local.outer.MarcacoesTrabalhadorData to_marcacao_id ) + { + try + { + preProcess( TO_MARCACAO_ID, to_marcacao_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_marcacao_id = to_marcacao_id; + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhadorEstados.ID_INDEX: + value = getId(); + break; + case MarcacoesTrabalhadorEstados.DATA_INDEX: + value = getData(); + break; + case MarcacoesTrabalhadorEstados.ESTADO_INDEX: + value = getEstado(); + break; + case MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX: + value = getMarcacao_id(); + break; + case MarcacoesTrabalhadorEstados.TO_MARCACAO_ID_INDEX: + value = toMarcacao_id(); + break; + case MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhadorEstados.ID_INDEX: + value = this.id; + break; + case MarcacoesTrabalhadorEstados.DATA_INDEX: + value = this.data; + break; + case MarcacoesTrabalhadorEstados.ESTADO_INDEX: + value = this.estado; + break; + case MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX: + value = this.marcacao_id; + break; + case MarcacoesTrabalhadorEstados.TO_MARCACAO_ID_INDEX: + value = this.to_marcacao_id; + break; + case MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhadorEstados.ID_INDEX: + setId( ( Integer ) value ); + break; + case MarcacoesTrabalhadorEstados.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case MarcacoesTrabalhadorEstados.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX: + setMarcacao_id( ( Integer ) value ); + break; + case MarcacoesTrabalhadorEstados.TO_MARCACAO_ID_INDEX: + setToMarcacao_id( ( db.data.siprp_local.outer.MarcacoesTrabalhadorData ) value ); + break; + case MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case MarcacoesTrabalhadorEstados.ID_INDEX: + this.id = ( Integer ) value; + break; + case MarcacoesTrabalhadorEstados.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case MarcacoesTrabalhadorEstados.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX: + this.marcacao_id = ( Integer ) value; + break; + case MarcacoesTrabalhadorEstados.TO_MARCACAO_ID_INDEX: + this.to_marcacao_id = ( db.data.siprp_local.outer.MarcacoesTrabalhadorData ) value; + break; + case MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case MarcacoesTrabalhadorEstados.ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhadorEstados.DATA_INDEX: + theClass = java.util.Date.class; + break; + case MarcacoesTrabalhadorEstados.ESTADO_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhadorEstados.MARCACAO_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhadorEstados.TO_MARCACAO_ID_INDEX: + theClass = db.data.siprp_local.outer.MarcacoesTrabalhadorData.class; + break; + case MarcacoesTrabalhadorEstados.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case MarcacoesTrabalhadorEstados.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : MarcacoesTrabalhadorEstados._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, MarcacoesTrabalhadorEstados.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Medicos.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Medicos.java new file mode 100644 index 00000000..b85284be --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Medicos.java @@ -0,0 +1,409 @@ +/* +* Medicos.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Medicos extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Medicos.ID, Medicos.ID_INDEX ); + FIELD_INDEXES.put( Medicos.ID_FULL, Medicos.ID_INDEX ); + FIELD_INDEXES.put( Medicos.NOME, Medicos.NOME_INDEX ); + FIELD_INDEXES.put( Medicos.NOME_FULL, Medicos.NOME_INDEX ); + FIELD_INDEXES.put( Medicos.NUMERO_CEDULA, Medicos.NUMERO_CEDULA_INDEX ); + FIELD_INDEXES.put( Medicos.NUMERO_CEDULA_FULL, Medicos.NUMERO_CEDULA_INDEX ); + FIELD_INDEXES.put( Medicos.INACTIVO, Medicos.INACTIVO_INDEX ); + FIELD_INDEXES.put( Medicos.INACTIVO_FULL, Medicos.INACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "medicos"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.medicos"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "medicos.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "medicos.nome"; + public static final int NOME_INDEX = 1; + public static final String NUMERO_CEDULA = "numero_cedula"; + public static final String NUMERO_CEDULA_FULL = "medicos.numero_cedula"; + public static final int NUMERO_CEDULA_INDEX = 2; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "medicos.inactivo"; + public static final int INACTIVO_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, NUMERO_CEDULA, INACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + NUMERO_CEDULA, TABLENAME + "." + INACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, NUMERO_CEDULA, INACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, NUMERO_CEDULA, INACTIVO, }; + + private Integer id; + private String nome; + private String numero_cedula; + private String inactivo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Medicos() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEstabelecimentos_medico_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "medico_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromExames_medico_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "medico_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getNumero_cedula() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_CEDULA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_cedula; + } + + public void setNumero_cedula( String numero_cedula ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_CEDULA, numero_cedula ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_cedula = numero_cedula; + LAZY_LOADED_OBJECTS.put( NUMERO_CEDULA, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + value = getId(); + break; + case Medicos.NOME_INDEX: + value = getNome(); + break; + case Medicos.NUMERO_CEDULA_INDEX: + value = getNumero_cedula(); + break; + case Medicos.INACTIVO_INDEX: + value = getInactivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + value = this.id; + break; + case Medicos.NOME_INDEX: + value = this.nome; + break; + case Medicos.NUMERO_CEDULA_INDEX: + value = this.numero_cedula; + break; + case Medicos.INACTIVO_INDEX: + value = this.inactivo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + setId( ( Integer ) value ); + break; + case Medicos.NOME_INDEX: + setNome( ( String ) value ); + break; + case Medicos.NUMERO_CEDULA_INDEX: + setNumero_cedula( ( String ) value ); + break; + case Medicos.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Medicos.ID_INDEX: + this.id = ( Integer ) value; + break; + case Medicos.NOME_INDEX: + this.nome = ( String ) value; + break; + case Medicos.NUMERO_CEDULA_INDEX: + this.numero_cedula = ( String ) value; + break; + case Medicos.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Medicos.ID_INDEX: + theClass = Integer.class; + break; + case Medicos.NOME_INDEX: + theClass = String.class; + break; + case Medicos.NUMERO_CEDULA_INDEX: + theClass = String.class; + break; + case Medicos.INACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Medicos._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Medicos.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Paises.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Paises.java new file mode 100644 index 00000000..338dd7ba --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Paises.java @@ -0,0 +1,583 @@ +/* +* Paises.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Paises extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Paises.ID, Paises.ID_INDEX ); + FIELD_INDEXES.put( Paises.ID_FULL, Paises.ID_INDEX ); + FIELD_INDEXES.put( Paises.DESCRICAO, Paises.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Paises.DESCRICAO_FULL, Paises.DESCRICAO_INDEX ); + FIELD_INDEXES.put( Paises.DESCRICAO_PLAIN, Paises.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( Paises.DESCRICAO_PLAIN_FULL, Paises.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( Paises.ORDEM, Paises.ORDEM_INDEX ); + FIELD_INDEXES.put( Paises.ORDEM_FULL, Paises.ORDEM_INDEX ); + FIELD_INDEXES.put( Paises.ACTIVO, Paises.ACTIVO_INDEX ); + FIELD_INDEXES.put( Paises.ACTIVO_FULL, Paises.ACTIVO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Paises.CLASS_IDENTIFIER, Paises.CONTINENTE_ID, Paises.TO_CONTINENTE_ID ); + FIELD_INDEXES.put( Paises.CONTINENTE_ID, Paises.CONTINENTE_ID_INDEX ); + FIELD_INDEXES.put( Paises.CONTINENTE_ID_FULL, Paises.CONTINENTE_ID_INDEX ); + FIELD_INDEXES.put( Paises.TO_CONTINENTE_ID, Paises.TO_CONTINENTE_ID_INDEX ); + FIELD_INDEXES.put( Paises.NACIONALIDADE, Paises.NACIONALIDADE_INDEX ); + FIELD_INDEXES.put( Paises.NACIONALIDADE_FULL, Paises.NACIONALIDADE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeycontinente_idTopaises_continentes = + new com.evolute.entity.ForeignKey( Paises.class, Paises.CONTINENTE_ID, db.data.siprp_local.outer.PaisesContinentesData.class, db.data.siprp_local.outer.PaisesContinentesData.ID ); + + public static final String TABLENAME = "paises"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.paises"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "paises.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "paises.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DESCRICAO_PLAIN = "descricao_plain"; + public static final String DESCRICAO_PLAIN_FULL = "paises.descricao_plain"; + public static final int DESCRICAO_PLAIN_INDEX = 2; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "paises.ordem"; + public static final int ORDEM_INDEX = 3; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "paises.activo"; + public static final int ACTIVO_INDEX = 4; + public static final String CONTINENTE_ID = "continente_id"; + public static final String CONTINENTE_ID_FULL = "paises.continente_id"; + public static final int CONTINENTE_ID_INDEX = 5; + public static final String TO_CONTINENTE_ID = "to_continente_id"; + public static final String TO_CONTINENTE_ID_FULL = "paises.to_continente_id"; + public static final int TO_CONTINENTE_ID_INDEX = 6; + public static final String NACIONALIDADE = "nacionalidade"; + public static final String NACIONALIDADE_FULL = "paises.nacionalidade"; + public static final int NACIONALIDADE_INDEX = 7; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, CONTINENTE_ID, TO_CONTINENTE_ID, + NACIONALIDADE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + ORDEM, TABLENAME + "." + ACTIVO, TABLENAME + "." + CONTINENTE_ID, TABLENAME + "." + TO_CONTINENTE_ID, + TABLENAME + "." + NACIONALIDADE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, CONTINENTE_ID, NACIONALIDADE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, CONTINENTE_ID, NACIONALIDADE, }; + + private Integer id; + private String descricao; + private String descricao_plain; + private Integer ordem; + private String activo; + private Integer continente_id; + private db.data.siprp_local.outer.PaisesContinentesData to_continente_id; + private String nacionalidade; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Paises() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getDescricao_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao_plain; + } + + public void setDescricao_plain( String descricao_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO_PLAIN, descricao_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao_plain = descricao_plain; + LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Integer getContinente_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTINENTE_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.continente_id; + } + + public void setContinente_id( Integer continente_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTINENTE_ID, continente_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.continente_id = continente_id; + LAZY_LOADED_OBJECTS.put( CONTINENTE_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PaisesContinentesData toContinente_id() + { + try + { + prepare( TO_CONTINENTE_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_continente_id; + } + + public void setToContinente_id( db.data.siprp_local.outer.PaisesContinentesData to_continente_id ) + { + try + { + preProcess( TO_CONTINENTE_ID, to_continente_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_continente_id = to_continente_id; + } + + public String getNacionalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NACIONALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nacionalidade; + } + + public void setNacionalidade( String nacionalidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( NACIONALIDADE, nacionalidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nacionalidade = nacionalidade; + LAZY_LOADED_OBJECTS.put( NACIONALIDADE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Paises.ID_INDEX: + value = getId(); + break; + case Paises.DESCRICAO_INDEX: + value = getDescricao(); + break; + case Paises.DESCRICAO_PLAIN_INDEX: + value = getDescricao_plain(); + break; + case Paises.ORDEM_INDEX: + value = getOrdem(); + break; + case Paises.ACTIVO_INDEX: + value = getActivo(); + break; + case Paises.CONTINENTE_ID_INDEX: + value = getContinente_id(); + break; + case Paises.TO_CONTINENTE_ID_INDEX: + value = toContinente_id(); + break; + case Paises.NACIONALIDADE_INDEX: + value = getNacionalidade(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Paises.ID_INDEX: + value = this.id; + break; + case Paises.DESCRICAO_INDEX: + value = this.descricao; + break; + case Paises.DESCRICAO_PLAIN_INDEX: + value = this.descricao_plain; + break; + case Paises.ORDEM_INDEX: + value = this.ordem; + break; + case Paises.ACTIVO_INDEX: + value = this.activo; + break; + case Paises.CONTINENTE_ID_INDEX: + value = this.continente_id; + break; + case Paises.TO_CONTINENTE_ID_INDEX: + value = this.to_continente_id; + break; + case Paises.NACIONALIDADE_INDEX: + value = this.nacionalidade; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Paises.ID_INDEX: + setId( ( Integer ) value ); + break; + case Paises.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case Paises.DESCRICAO_PLAIN_INDEX: + setDescricao_plain( ( String ) value ); + break; + case Paises.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case Paises.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + case Paises.CONTINENTE_ID_INDEX: + setContinente_id( ( Integer ) value ); + break; + case Paises.TO_CONTINENTE_ID_INDEX: + setToContinente_id( ( db.data.siprp_local.outer.PaisesContinentesData ) value ); + break; + case Paises.NACIONALIDADE_INDEX: + setNacionalidade( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Paises.ID_INDEX: + this.id = ( Integer ) value; + break; + case Paises.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case Paises.DESCRICAO_PLAIN_INDEX: + this.descricao_plain = ( String ) value; + break; + case Paises.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case Paises.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + case Paises.CONTINENTE_ID_INDEX: + this.continente_id = ( Integer ) value; + break; + case Paises.TO_CONTINENTE_ID_INDEX: + this.to_continente_id = ( db.data.siprp_local.outer.PaisesContinentesData ) value; + break; + case Paises.NACIONALIDADE_INDEX: + this.nacionalidade = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Paises.ID_INDEX: + theClass = Integer.class; + break; + case Paises.DESCRICAO_INDEX: + theClass = String.class; + break; + case Paises.DESCRICAO_PLAIN_INDEX: + theClass = String.class; + break; + case Paises.ORDEM_INDEX: + theClass = Integer.class; + break; + case Paises.ACTIVO_INDEX: + theClass = String.class; + break; + case Paises.CONTINENTE_ID_INDEX: + theClass = Integer.class; + break; + case Paises.TO_CONTINENTE_ID_INDEX: + theClass = db.data.siprp_local.outer.PaisesContinentesData.class; + break; + case Paises.NACIONALIDADE_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Paises._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Paises.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PaisesContinentes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PaisesContinentes.java new file mode 100644 index 00000000..455da067 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PaisesContinentes.java @@ -0,0 +1,445 @@ +/* +* PaisesContinentes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PaisesContinentes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PaisesContinentes.ID, PaisesContinentes.ID_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.ID_FULL, PaisesContinentes.ID_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.DESCRICAO, PaisesContinentes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.DESCRICAO_FULL, PaisesContinentes.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.DESCRICAO_PLAIN, PaisesContinentes.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.DESCRICAO_PLAIN_FULL, PaisesContinentes.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.ORDEM, PaisesContinentes.ORDEM_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.ORDEM_FULL, PaisesContinentes.ORDEM_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.ACTIVO, PaisesContinentes.ACTIVO_INDEX ); + FIELD_INDEXES.put( PaisesContinentes.ACTIVO_FULL, PaisesContinentes.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "paises_continentes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.paises_continentes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "paises_continentes.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "paises_continentes.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DESCRICAO_PLAIN = "descricao_plain"; + public static final String DESCRICAO_PLAIN_FULL = "paises_continentes.descricao_plain"; + public static final int DESCRICAO_PLAIN_INDEX = 2; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "paises_continentes.ordem"; + public static final int ORDEM_INDEX = 3; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "paises_continentes.activo"; + public static final int ACTIVO_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + ORDEM, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DESCRICAO_PLAIN, ORDEM, ACTIVO, }; + + private Integer id; + private String descricao; + private String descricao_plain; + private Integer ordem; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PaisesContinentes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPaises_continente_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PaisesData.class , getPrimaryKey().getMap().get("id"), "continente_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getDescricao_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao_plain; + } + + public void setDescricao_plain( String descricao_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO_PLAIN, descricao_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao_plain = descricao_plain; + LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PaisesContinentes.ID_INDEX: + value = getId(); + break; + case PaisesContinentes.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PaisesContinentes.DESCRICAO_PLAIN_INDEX: + value = getDescricao_plain(); + break; + case PaisesContinentes.ORDEM_INDEX: + value = getOrdem(); + break; + case PaisesContinentes.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PaisesContinentes.ID_INDEX: + value = this.id; + break; + case PaisesContinentes.DESCRICAO_INDEX: + value = this.descricao; + break; + case PaisesContinentes.DESCRICAO_PLAIN_INDEX: + value = this.descricao_plain; + break; + case PaisesContinentes.ORDEM_INDEX: + value = this.ordem; + break; + case PaisesContinentes.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PaisesContinentes.ID_INDEX: + setId( ( Integer ) value ); + break; + case PaisesContinentes.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PaisesContinentes.DESCRICAO_PLAIN_INDEX: + setDescricao_plain( ( String ) value ); + break; + case PaisesContinentes.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case PaisesContinentes.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PaisesContinentes.ID_INDEX: + this.id = ( Integer ) value; + break; + case PaisesContinentes.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PaisesContinentes.DESCRICAO_PLAIN_INDEX: + this.descricao_plain = ( String ) value; + break; + case PaisesContinentes.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case PaisesContinentes.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PaisesContinentes.ID_INDEX: + theClass = Integer.class; + break; + case PaisesContinentes.DESCRICAO_INDEX: + theClass = String.class; + break; + case PaisesContinentes.DESCRICAO_PLAIN_INDEX: + theClass = String.class; + break; + case PaisesContinentes.ORDEM_INDEX: + theClass = Integer.class; + break; + case PaisesContinentes.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PaisesContinentes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PaisesContinentes.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesDocumento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesDocumento.java new file mode 100644 index 00000000..04662e0f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesDocumento.java @@ -0,0 +1,545 @@ +/* +* PesDocumento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PesDocumento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PesDocumento.ID, PesDocumento.ID_INDEX ); + FIELD_INDEXES.put( PesDocumento.ID_FULL, PesDocumento.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PesDocumento.CLASS_IDENTIFIER, PesDocumento.TIPO_ID, PesDocumento.TO_TIPO_ID ); + FIELD_INDEXES.put( PesDocumento.TIPO_ID, PesDocumento.TIPO_ID_INDEX ); + FIELD_INDEXES.put( PesDocumento.TIPO_ID_FULL, PesDocumento.TIPO_ID_INDEX ); + FIELD_INDEXES.put( PesDocumento.TO_TIPO_ID, PesDocumento.TO_TIPO_ID_INDEX ); + FIELD_INDEXES.put( PesDocumento.NUMERO, PesDocumento.NUMERO_INDEX ); + FIELD_INDEXES.put( PesDocumento.NUMERO_FULL, PesDocumento.NUMERO_INDEX ); + FIELD_INDEXES.put( PesDocumento.LOCAL_EMISSAO, PesDocumento.LOCAL_EMISSAO_INDEX ); + FIELD_INDEXES.put( PesDocumento.LOCAL_EMISSAO_FULL, PesDocumento.LOCAL_EMISSAO_INDEX ); + FIELD_INDEXES.put( PesDocumento.DATA_EMISSAO, PesDocumento.DATA_EMISSAO_INDEX ); + FIELD_INDEXES.put( PesDocumento.DATA_EMISSAO_FULL, PesDocumento.DATA_EMISSAO_INDEX ); + FIELD_INDEXES.put( PesDocumento.DATA_VALIDADE, PesDocumento.DATA_VALIDADE_INDEX ); + FIELD_INDEXES.put( PesDocumento.DATA_VALIDADE_FULL, PesDocumento.DATA_VALIDADE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytipo_idTopes_documento_tipo = + new com.evolute.entity.ForeignKey( PesDocumento.class, PesDocumento.TIPO_ID, db.data.siprp_local.outer.PesDocumentoTipoData.class, db.data.siprp_local.outer.PesDocumentoTipoData.ID ); + + public static final String TABLENAME = "pes_documento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.pes_documento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "pes_documento.id"; + public static final int ID_INDEX = 0; + public static final String TIPO_ID = "tipo_id"; + public static final String TIPO_ID_FULL = "pes_documento.tipo_id"; + public static final int TIPO_ID_INDEX = 1; + public static final String TO_TIPO_ID = "to_tipo_id"; + public static final String TO_TIPO_ID_FULL = "pes_documento.to_tipo_id"; + public static final int TO_TIPO_ID_INDEX = 2; + public static final String NUMERO = "numero"; + public static final String NUMERO_FULL = "pes_documento.numero"; + public static final int NUMERO_INDEX = 3; + public static final String LOCAL_EMISSAO = "local_emissao"; + public static final String LOCAL_EMISSAO_FULL = "pes_documento.local_emissao"; + public static final int LOCAL_EMISSAO_INDEX = 4; + public static final String DATA_EMISSAO = "data_emissao"; + public static final String DATA_EMISSAO_FULL = "pes_documento.data_emissao"; + public static final int DATA_EMISSAO_INDEX = 5; + public static final String DATA_VALIDADE = "data_validade"; + public static final String DATA_VALIDADE_FULL = "pes_documento.data_validade"; + public static final int DATA_VALIDADE_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO_ID, TO_TIPO_ID, NUMERO, LOCAL_EMISSAO, DATA_EMISSAO, DATA_VALIDADE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO_ID, TABLENAME + "." + TO_TIPO_ID, TABLENAME + "." + NUMERO, TABLENAME + "." + LOCAL_EMISSAO, TABLENAME + "." + DATA_EMISSAO, TABLENAME + "." + DATA_VALIDADE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO_ID, NUMERO, LOCAL_EMISSAO, DATA_EMISSAO, DATA_VALIDADE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO_ID, NUMERO, LOCAL_EMISSAO, DATA_EMISSAO, DATA_VALIDADE, }; + + private Integer id; + private Integer tipo_id; + private db.data.siprp_local.outer.PesDocumentoTipoData to_tipo_id; + private String numero; + private String local_emissao; + private java.util.Date data_emissao; + private java.util.Date data_validade; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PesDocumento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPesPessoaDocumento_documento_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PesPessoaDocumentoData.class , getPrimaryKey().getMap().get("id"), "documento_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getTipo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_id; + } + + public void setTipo_id( Integer tipo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO_ID, tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_id = tipo_id; + LAZY_LOADED_OBJECTS.put( TIPO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PesDocumentoTipoData toTipo_id() + { + try + { + prepare( TO_TIPO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tipo_id; + } + + public void setToTipo_id( db.data.siprp_local.outer.PesDocumentoTipoData to_tipo_id ) + { + try + { + preProcess( TO_TIPO_ID, to_tipo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tipo_id = to_tipo_id; + } + + public String getNumero() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero; + } + + public void setNumero( String numero ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO, numero ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero = numero; + LAZY_LOADED_OBJECTS.put( NUMERO, Boolean.TRUE ); + } + + public String getLocal_emissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCAL_EMISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.local_emissao; + } + + public void setLocal_emissao( String local_emissao ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCAL_EMISSAO, local_emissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.local_emissao = local_emissao; + LAZY_LOADED_OBJECTS.put( LOCAL_EMISSAO, Boolean.TRUE ); + } + + public java.util.Date getData_emissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_EMISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_emissao; + } + + public void setData_emissao( java.util.Date data_emissao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_EMISSAO, data_emissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_emissao = data_emissao; + LAZY_LOADED_OBJECTS.put( DATA_EMISSAO, Boolean.TRUE ); + } + + public java.util.Date getData_validade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_VALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_validade; + } + + public void setData_validade( java.util.Date data_validade ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_VALIDADE, data_validade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_validade = data_validade; + LAZY_LOADED_OBJECTS.put( DATA_VALIDADE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumento.ID_INDEX: + value = getId(); + break; + case PesDocumento.TIPO_ID_INDEX: + value = getTipo_id(); + break; + case PesDocumento.TO_TIPO_ID_INDEX: + value = toTipo_id(); + break; + case PesDocumento.NUMERO_INDEX: + value = getNumero(); + break; + case PesDocumento.LOCAL_EMISSAO_INDEX: + value = getLocal_emissao(); + break; + case PesDocumento.DATA_EMISSAO_INDEX: + value = getData_emissao(); + break; + case PesDocumento.DATA_VALIDADE_INDEX: + value = getData_validade(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumento.ID_INDEX: + value = this.id; + break; + case PesDocumento.TIPO_ID_INDEX: + value = this.tipo_id; + break; + case PesDocumento.TO_TIPO_ID_INDEX: + value = this.to_tipo_id; + break; + case PesDocumento.NUMERO_INDEX: + value = this.numero; + break; + case PesDocumento.LOCAL_EMISSAO_INDEX: + value = this.local_emissao; + break; + case PesDocumento.DATA_EMISSAO_INDEX: + value = this.data_emissao; + break; + case PesDocumento.DATA_VALIDADE_INDEX: + value = this.data_validade; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumento.ID_INDEX: + setId( ( Integer ) value ); + break; + case PesDocumento.TIPO_ID_INDEX: + setTipo_id( ( Integer ) value ); + break; + case PesDocumento.TO_TIPO_ID_INDEX: + setToTipo_id( ( db.data.siprp_local.outer.PesDocumentoTipoData ) value ); + break; + case PesDocumento.NUMERO_INDEX: + setNumero( ( String ) value ); + break; + case PesDocumento.LOCAL_EMISSAO_INDEX: + setLocal_emissao( ( String ) value ); + break; + case PesDocumento.DATA_EMISSAO_INDEX: + setData_emissao( ( java.util.Date ) value ); + break; + case PesDocumento.DATA_VALIDADE_INDEX: + setData_validade( ( java.util.Date ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumento.ID_INDEX: + this.id = ( Integer ) value; + break; + case PesDocumento.TIPO_ID_INDEX: + this.tipo_id = ( Integer ) value; + break; + case PesDocumento.TO_TIPO_ID_INDEX: + this.to_tipo_id = ( db.data.siprp_local.outer.PesDocumentoTipoData ) value; + break; + case PesDocumento.NUMERO_INDEX: + this.numero = ( String ) value; + break; + case PesDocumento.LOCAL_EMISSAO_INDEX: + this.local_emissao = ( String ) value; + break; + case PesDocumento.DATA_EMISSAO_INDEX: + this.data_emissao = ( java.util.Date ) value; + break; + case PesDocumento.DATA_VALIDADE_INDEX: + this.data_validade = ( java.util.Date ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PesDocumento.ID_INDEX: + theClass = Integer.class; + break; + case PesDocumento.TIPO_ID_INDEX: + theClass = Integer.class; + break; + case PesDocumento.TO_TIPO_ID_INDEX: + theClass = db.data.siprp_local.outer.PesDocumentoTipoData.class; + break; + case PesDocumento.NUMERO_INDEX: + theClass = String.class; + break; + case PesDocumento.LOCAL_EMISSAO_INDEX: + theClass = String.class; + break; + case PesDocumento.DATA_EMISSAO_INDEX: + theClass = java.util.Date.class; + break; + case PesDocumento.DATA_VALIDADE_INDEX: + theClass = java.util.Date.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PesDocumento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PesDocumento.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesDocumentoTipo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesDocumentoTipo.java new file mode 100644 index 00000000..64adc61d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesDocumentoTipo.java @@ -0,0 +1,445 @@ +/* +* PesDocumentoTipo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PesDocumentoTipo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PesDocumentoTipo.ID, PesDocumentoTipo.ID_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.ID_FULL, PesDocumentoTipo.ID_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.CODIGO, PesDocumentoTipo.CODIGO_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.CODIGO_FULL, PesDocumentoTipo.CODIGO_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.DESCRICAO, PesDocumentoTipo.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.DESCRICAO_FULL, PesDocumentoTipo.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.ORDEM, PesDocumentoTipo.ORDEM_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.ORDEM_FULL, PesDocumentoTipo.ORDEM_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.DELETED_DATE, PesDocumentoTipo.DELETED_DATE_INDEX ); + FIELD_INDEXES.put( PesDocumentoTipo.DELETED_DATE_FULL, PesDocumentoTipo.DELETED_DATE_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "pes_documento_tipo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.pes_documento_tipo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "pes_documento_tipo.id"; + public static final int ID_INDEX = 0; + public static final String CODIGO = "codigo"; + public static final String CODIGO_FULL = "pes_documento_tipo.codigo"; + public static final int CODIGO_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "pes_documento_tipo.descricao"; + public static final int DESCRICAO_INDEX = 2; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "pes_documento_tipo.ordem"; + public static final int ORDEM_INDEX = 3; + public static final String DELETED_DATE = "deleted_date"; + public static final String DELETED_DATE_FULL = "pes_documento_tipo.deleted_date"; + public static final int DELETED_DATE_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + CODIGO, DESCRICAO, ORDEM, DELETED_DATE, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CODIGO, TABLENAME + "." + DESCRICAO, TABLENAME + "." + ORDEM, TABLENAME + "." + DELETED_DATE, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, CODIGO, DESCRICAO, ORDEM, DELETED_DATE, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, CODIGO, DESCRICAO, ORDEM, DELETED_DATE, }; + + private Integer id; + private String codigo; + private String descricao; + private Integer ordem; + private java.sql.Timestamp deleted_date; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PesDocumentoTipo() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPesDocumento_tipo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PesDocumentoData.class , getPrimaryKey().getMap().get("id"), "tipo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getCodigo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo; + } + + public void setCodigo( String codigo ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO, codigo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo = codigo; + LAZY_LOADED_OBJECTS.put( CODIGO, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public java.sql.Timestamp getDeleted_date() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DELETED_DATE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.deleted_date; + } + + public void setDeleted_date( java.sql.Timestamp deleted_date ) + { + try + { + setLockedForRefresh( true ); + preProcess( DELETED_DATE, deleted_date ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.deleted_date = deleted_date; + LAZY_LOADED_OBJECTS.put( DELETED_DATE, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumentoTipo.ID_INDEX: + value = getId(); + break; + case PesDocumentoTipo.CODIGO_INDEX: + value = getCodigo(); + break; + case PesDocumentoTipo.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PesDocumentoTipo.ORDEM_INDEX: + value = getOrdem(); + break; + case PesDocumentoTipo.DELETED_DATE_INDEX: + value = getDeleted_date(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumentoTipo.ID_INDEX: + value = this.id; + break; + case PesDocumentoTipo.CODIGO_INDEX: + value = this.codigo; + break; + case PesDocumentoTipo.DESCRICAO_INDEX: + value = this.descricao; + break; + case PesDocumentoTipo.ORDEM_INDEX: + value = this.ordem; + break; + case PesDocumentoTipo.DELETED_DATE_INDEX: + value = this.deleted_date; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumentoTipo.ID_INDEX: + setId( ( Integer ) value ); + break; + case PesDocumentoTipo.CODIGO_INDEX: + setCodigo( ( String ) value ); + break; + case PesDocumentoTipo.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PesDocumentoTipo.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case PesDocumentoTipo.DELETED_DATE_INDEX: + setDeleted_date( ( java.sql.Timestamp ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesDocumentoTipo.ID_INDEX: + this.id = ( Integer ) value; + break; + case PesDocumentoTipo.CODIGO_INDEX: + this.codigo = ( String ) value; + break; + case PesDocumentoTipo.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PesDocumentoTipo.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case PesDocumentoTipo.DELETED_DATE_INDEX: + this.deleted_date = ( java.sql.Timestamp ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PesDocumentoTipo.ID_INDEX: + theClass = Integer.class; + break; + case PesDocumentoTipo.CODIGO_INDEX: + theClass = String.class; + break; + case PesDocumentoTipo.DESCRICAO_INDEX: + theClass = String.class; + break; + case PesDocumentoTipo.ORDEM_INDEX: + theClass = Integer.class; + break; + case PesDocumentoTipo.DELETED_DATE_INDEX: + theClass = java.sql.Timestamp.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PesDocumentoTipo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PesDocumentoTipo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesPessoaDocumento.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesPessoaDocumento.java new file mode 100644 index 00000000..2dee83cd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PesPessoaDocumento.java @@ -0,0 +1,431 @@ +/* +* PesPessoaDocumento.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PesPessoaDocumento extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PesPessoaDocumento.ID, PesPessoaDocumento.ID_INDEX ); + FIELD_INDEXES.put( PesPessoaDocumento.ID_FULL, PesPessoaDocumento.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PesPessoaDocumento.CLASS_IDENTIFIER, PesPessoaDocumento.PESSOA_ID, PesPessoaDocumento.TO_PESSOA_ID ); + FIELD_INDEXES.put( PesPessoaDocumento.PESSOA_ID, PesPessoaDocumento.PESSOA_ID_INDEX ); + FIELD_INDEXES.put( PesPessoaDocumento.PESSOA_ID_FULL, PesPessoaDocumento.PESSOA_ID_INDEX ); + FIELD_INDEXES.put( PesPessoaDocumento.TO_PESSOA_ID, PesPessoaDocumento.TO_PESSOA_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PesPessoaDocumento.CLASS_IDENTIFIER, PesPessoaDocumento.DOCUMENTO_ID, PesPessoaDocumento.TO_DOCUMENTO_ID ); + FIELD_INDEXES.put( PesPessoaDocumento.DOCUMENTO_ID, PesPessoaDocumento.DOCUMENTO_ID_INDEX ); + FIELD_INDEXES.put( PesPessoaDocumento.DOCUMENTO_ID_FULL, PesPessoaDocumento.DOCUMENTO_ID_INDEX ); + FIELD_INDEXES.put( PesPessoaDocumento.TO_DOCUMENTO_ID, PesPessoaDocumento.TO_DOCUMENTO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeypessoa_idToevo_pessoa = + new com.evolute.entity.ForeignKey( PesPessoaDocumento.class, PesPessoaDocumento.PESSOA_ID, db.data.siprp_local.outer.EvoPessoaData.class, db.data.siprp_local.outer.EvoPessoaData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeydocumento_idTopes_documento = + new com.evolute.entity.ForeignKey( PesPessoaDocumento.class, PesPessoaDocumento.DOCUMENTO_ID, db.data.siprp_local.outer.PesDocumentoData.class, db.data.siprp_local.outer.PesDocumentoData.ID ); + + public static final String TABLENAME = "pes_pessoa_documento"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.pes_pessoa_documento"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "pes_pessoa_documento.id"; + public static final int ID_INDEX = 0; + public static final String PESSOA_ID = "pessoa_id"; + public static final String PESSOA_ID_FULL = "pes_pessoa_documento.pessoa_id"; + public static final int PESSOA_ID_INDEX = 1; + public static final String TO_PESSOA_ID = "to_pessoa_id"; + public static final String TO_PESSOA_ID_FULL = "pes_pessoa_documento.to_pessoa_id"; + public static final int TO_PESSOA_ID_INDEX = 2; + public static final String DOCUMENTO_ID = "documento_id"; + public static final String DOCUMENTO_ID_FULL = "pes_pessoa_documento.documento_id"; + public static final int DOCUMENTO_ID_INDEX = 3; + public static final String TO_DOCUMENTO_ID = "to_documento_id"; + public static final String TO_DOCUMENTO_ID_FULL = "pes_pessoa_documento.to_documento_id"; + public static final int TO_DOCUMENTO_ID_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + PESSOA_ID, TO_PESSOA_ID, DOCUMENTO_ID, TO_DOCUMENTO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PESSOA_ID, TABLENAME + "." + TO_PESSOA_ID, TABLENAME + "." + DOCUMENTO_ID, TABLENAME + "." + TO_DOCUMENTO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PESSOA_ID, DOCUMENTO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PESSOA_ID, DOCUMENTO_ID, }; + + private Integer id; + private Integer pessoa_id; + private db.data.siprp_local.outer.EvoPessoaData to_pessoa_id; + private Integer documento_id; + private db.data.siprp_local.outer.PesDocumentoData to_documento_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PesPessoaDocumento() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getPessoa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PESSOA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.pessoa_id; + } + + public void setPessoa_id( Integer pessoa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PESSOA_ID, pessoa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.pessoa_id = pessoa_id; + LAZY_LOADED_OBJECTS.put( PESSOA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoPessoaData toPessoa_id() + { + try + { + prepare( TO_PESSOA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_pessoa_id; + } + + public void setToPessoa_id( db.data.siprp_local.outer.EvoPessoaData to_pessoa_id ) + { + try + { + preProcess( TO_PESSOA_ID, to_pessoa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_pessoa_id = to_pessoa_id; + } + + public Integer getDocumento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DOCUMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.documento_id; + } + + public void setDocumento_id( Integer documento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( DOCUMENTO_ID, documento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.documento_id = documento_id; + LAZY_LOADED_OBJECTS.put( DOCUMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PesDocumentoData toDocumento_id() + { + try + { + prepare( TO_DOCUMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_documento_id; + } + + public void setToDocumento_id( db.data.siprp_local.outer.PesDocumentoData to_documento_id ) + { + try + { + preProcess( TO_DOCUMENTO_ID, to_documento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_documento_id = to_documento_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesPessoaDocumento.ID_INDEX: + value = getId(); + break; + case PesPessoaDocumento.PESSOA_ID_INDEX: + value = getPessoa_id(); + break; + case PesPessoaDocumento.TO_PESSOA_ID_INDEX: + value = toPessoa_id(); + break; + case PesPessoaDocumento.DOCUMENTO_ID_INDEX: + value = getDocumento_id(); + break; + case PesPessoaDocumento.TO_DOCUMENTO_ID_INDEX: + value = toDocumento_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesPessoaDocumento.ID_INDEX: + value = this.id; + break; + case PesPessoaDocumento.PESSOA_ID_INDEX: + value = this.pessoa_id; + break; + case PesPessoaDocumento.TO_PESSOA_ID_INDEX: + value = this.to_pessoa_id; + break; + case PesPessoaDocumento.DOCUMENTO_ID_INDEX: + value = this.documento_id; + break; + case PesPessoaDocumento.TO_DOCUMENTO_ID_INDEX: + value = this.to_documento_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesPessoaDocumento.ID_INDEX: + setId( ( Integer ) value ); + break; + case PesPessoaDocumento.PESSOA_ID_INDEX: + setPessoa_id( ( Integer ) value ); + break; + case PesPessoaDocumento.TO_PESSOA_ID_INDEX: + setToPessoa_id( ( db.data.siprp_local.outer.EvoPessoaData ) value ); + break; + case PesPessoaDocumento.DOCUMENTO_ID_INDEX: + setDocumento_id( ( Integer ) value ); + break; + case PesPessoaDocumento.TO_DOCUMENTO_ID_INDEX: + setToDocumento_id( ( db.data.siprp_local.outer.PesDocumentoData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PesPessoaDocumento.ID_INDEX: + this.id = ( Integer ) value; + break; + case PesPessoaDocumento.PESSOA_ID_INDEX: + this.pessoa_id = ( Integer ) value; + break; + case PesPessoaDocumento.TO_PESSOA_ID_INDEX: + this.to_pessoa_id = ( db.data.siprp_local.outer.EvoPessoaData ) value; + break; + case PesPessoaDocumento.DOCUMENTO_ID_INDEX: + this.documento_id = ( Integer ) value; + break; + case PesPessoaDocumento.TO_DOCUMENTO_ID_INDEX: + this.to_documento_id = ( db.data.siprp_local.outer.PesDocumentoData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PesPessoaDocumento.ID_INDEX: + theClass = Integer.class; + break; + case PesPessoaDocumento.PESSOA_ID_INDEX: + theClass = Integer.class; + break; + case PesPessoaDocumento.TO_PESSOA_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoPessoaData.class; + break; + case PesPessoaDocumento.DOCUMENTO_ID_INDEX: + theClass = Integer.class; + break; + case PesPessoaDocumento.TO_DOCUMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.PesDocumentoData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PesPessoaDocumento._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PesPessoaDocumento.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Prestadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Prestadores.java new file mode 100644 index 00000000..f59122de --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Prestadores.java @@ -0,0 +1,1054 @@ +/* +* Prestadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Prestadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Prestadores.ID, Prestadores.ID_INDEX ); + FIELD_INDEXES.put( Prestadores.ID_FULL, Prestadores.ID_INDEX ); + FIELD_INDEXES.put( Prestadores.NOME, Prestadores.NOME_INDEX ); + FIELD_INDEXES.put( Prestadores.NOME_FULL, Prestadores.NOME_INDEX ); + FIELD_INDEXES.put( Prestadores.NOME_PLAIN, Prestadores.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( Prestadores.NOME_PLAIN_FULL, Prestadores.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( Prestadores.MORADA, Prestadores.MORADA_INDEX ); + FIELD_INDEXES.put( Prestadores.MORADA_FULL, Prestadores.MORADA_INDEX ); + FIELD_INDEXES.put( Prestadores.CODIGO_POSTAL, Prestadores.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Prestadores.CODIGO_POSTAL_FULL, Prestadores.CODIGO_POSTAL_INDEX ); + FIELD_INDEXES.put( Prestadores.LOCALIDADE, Prestadores.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Prestadores.LOCALIDADE_FULL, Prestadores.LOCALIDADE_INDEX ); + FIELD_INDEXES.put( Prestadores.LOCALIDADE_CP, Prestadores.LOCALIDADE_CP_INDEX ); + FIELD_INDEXES.put( Prestadores.LOCALIDADE_CP_FULL, Prestadores.LOCALIDADE_CP_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Prestadores.CLASS_IDENTIFIER, Prestadores.CONTACTO_ID, Prestadores.TO_CONTACTO_ID ); + FIELD_INDEXES.put( Prestadores.CONTACTO_ID, Prestadores.CONTACTO_ID_INDEX ); + FIELD_INDEXES.put( Prestadores.CONTACTO_ID_FULL, Prestadores.CONTACTO_ID_INDEX ); + FIELD_INDEXES.put( Prestadores.TO_CONTACTO_ID, Prestadores.TO_CONTACTO_ID_INDEX ); + FIELD_INDEXES.put( Prestadores.ACTIVO, Prestadores.ACTIVO_INDEX ); + FIELD_INDEXES.put( Prestadores.ACTIVO_FULL, Prestadores.ACTIVO_INDEX ); + FIELD_INDEXES.put( Prestadores.FAZ_CONSULTAS, Prestadores.FAZ_CONSULTAS_INDEX ); + FIELD_INDEXES.put( Prestadores.FAZ_CONSULTAS_FULL, Prestadores.FAZ_CONSULTAS_INDEX ); + FIELD_INDEXES.put( Prestadores.FAZ_ECDS, Prestadores.FAZ_ECDS_INDEX ); + FIELD_INDEXES.put( Prestadores.FAZ_ECDS_FULL, Prestadores.FAZ_ECDS_INDEX ); + FIELD_INDEXES.put( Prestadores.CONTRIBUINTE, Prestadores.CONTRIBUINTE_INDEX ); + FIELD_INDEXES.put( Prestadores.CONTRIBUINTE_FULL, Prestadores.CONTRIBUINTE_INDEX ); + FIELD_INDEXES.put( Prestadores.OBSERVACOES, Prestadores.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( Prestadores.OBSERVACOES_FULL, Prestadores.OBSERVACOES_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeycontacto_idTocontactos = + new com.evolute.entity.ForeignKey( Prestadores.class, Prestadores.CONTACTO_ID, db.data.siprp_local.outer.ContactosData.class, db.data.siprp_local.outer.ContactosData.ID ); + + public static final String TABLENAME = "prestadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.prestadores"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "prestadores.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "prestadores.nome"; + public static final int NOME_INDEX = 1; + public static final String NOME_PLAIN = "nome_plain"; + public static final String NOME_PLAIN_FULL = "prestadores.nome_plain"; + public static final int NOME_PLAIN_INDEX = 2; + public static final String MORADA = "morada"; + public static final String MORADA_FULL = "prestadores.morada"; + public static final int MORADA_INDEX = 3; + public static final String CODIGO_POSTAL = "codigo_postal"; + public static final String CODIGO_POSTAL_FULL = "prestadores.codigo_postal"; + public static final int CODIGO_POSTAL_INDEX = 4; + public static final String LOCALIDADE = "localidade"; + public static final String LOCALIDADE_FULL = "prestadores.localidade"; + public static final int LOCALIDADE_INDEX = 5; + public static final String LOCALIDADE_CP = "localidade_cp"; + public static final String LOCALIDADE_CP_FULL = "prestadores.localidade_cp"; + public static final int LOCALIDADE_CP_INDEX = 6; + public static final String CONTACTO_ID = "contacto_id"; + public static final String CONTACTO_ID_FULL = "prestadores.contacto_id"; + public static final int CONTACTO_ID_INDEX = 7; + public static final String TO_CONTACTO_ID = "to_contacto_id"; + public static final String TO_CONTACTO_ID_FULL = "prestadores.to_contacto_id"; + public static final int TO_CONTACTO_ID_INDEX = 8; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "prestadores.activo"; + public static final int ACTIVO_INDEX = 9; + public static final String FAZ_CONSULTAS = "faz_consultas"; + public static final String FAZ_CONSULTAS_FULL = "prestadores.faz_consultas"; + public static final int FAZ_CONSULTAS_INDEX = 10; + public static final String FAZ_ECDS = "faz_ecds"; + public static final String FAZ_ECDS_FULL = "prestadores.faz_ecds"; + public static final int FAZ_ECDS_INDEX = 11; + public static final String CONTRIBUINTE = "contribuinte"; + public static final String CONTRIBUINTE_FULL = "prestadores.contribuinte"; + public static final int CONTRIBUINTE_INDEX = 12; + public static final String OBSERVACOES = "observacoes"; + public static final String OBSERVACOES_FULL = "prestadores.observacoes"; + public static final int OBSERVACOES_INDEX = 13; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, LOCALIDADE_CP, CONTACTO_ID, + TO_CONTACTO_ID, ACTIVO, FAZ_CONSULTAS, FAZ_ECDS, CONTRIBUINTE, OBSERVACOES, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + NOME_PLAIN, TABLENAME + "." + MORADA, TABLENAME + "." + CODIGO_POSTAL, TABLENAME + "." + LOCALIDADE, TABLENAME + "." + LOCALIDADE_CP, TABLENAME + "." + CONTACTO_ID, + TABLENAME + "." + TO_CONTACTO_ID, TABLENAME + "." + ACTIVO, TABLENAME + "." + FAZ_CONSULTAS, TABLENAME + "." + FAZ_ECDS, TABLENAME + "." + CONTRIBUINTE, TABLENAME + "." + OBSERVACOES, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, LOCALIDADE_CP, CONTACTO_ID, + ACTIVO, FAZ_CONSULTAS, FAZ_ECDS, CONTRIBUINTE, OBSERVACOES, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, LOCALIDADE_CP, CONTACTO_ID, + ACTIVO, FAZ_CONSULTAS, FAZ_ECDS, CONTRIBUINTE, OBSERVACOES, }; + + private Integer id; + private String nome; + private String nome_plain; + private String morada; + private String codigo_postal; + private String localidade; + private String localidade_cp; + private Integer contacto_id; + private db.data.siprp_local.outer.ContactosData to_contacto_id; + private String activo; + private String faz_consultas; + private String faz_ecds; + private String contribuinte; + private String observacoes; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Prestadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromEstabelecimentos_prestador_consulta_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "prestador_consulta_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromEstabelecimentos_prestador_ecds_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.EstabelecimentosData.class , getPrimaryKey().getMap().get("id"), "prestador_ecds_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesTrabalhador_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesTrabalhadorData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesTrabalhadorEstados_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesTrabalhadorEstadosData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromPrestadoresGruposProtocolo_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrestadoresGruposProtocoloData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromPrtGruposProtocolo_analisador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrtGruposProtocoloData.class , getPrimaryKey().getMap().get("id"), "analisador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresConsultas_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresConsultasDatas_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcd_analisador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdData.class , getPrimaryKey().getMap().get("id"), "analisador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcdsAnalise_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsAnaliseData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcdsDatas_prestador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class , getPrimaryKey().getMap().get("id"), "prestador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcdsDatas_analisador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class , getPrimaryKey().getMap().get("id"), "analisador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getNome_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_plain; + } + + public void setNome_plain( String nome_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME_PLAIN, nome_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_plain = nome_plain; + LAZY_LOADED_OBJECTS.put( NOME_PLAIN, Boolean.TRUE ); + } + + public String getMorada() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MORADA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.morada; + } + + public void setMorada( String morada ) + { + try + { + setLockedForRefresh( true ); + preProcess( MORADA, morada ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.morada = morada; + LAZY_LOADED_OBJECTS.put( MORADA, Boolean.TRUE ); + } + + public String getCodigo_postal() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CODIGO_POSTAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.codigo_postal; + } + + public void setCodigo_postal( String codigo_postal ) + { + try + { + setLockedForRefresh( true ); + preProcess( CODIGO_POSTAL, codigo_postal ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.codigo_postal = codigo_postal; + LAZY_LOADED_OBJECTS.put( CODIGO_POSTAL, Boolean.TRUE ); + } + + public String getLocalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade; + } + + public void setLocalidade( String localidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCALIDADE, localidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade = localidade; + LAZY_LOADED_OBJECTS.put( LOCALIDADE, Boolean.TRUE ); + } + + public String getLocalidade_cp() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCALIDADE_CP ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.localidade_cp; + } + + public void setLocalidade_cp( String localidade_cp ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCALIDADE_CP, localidade_cp ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.localidade_cp = localidade_cp; + LAZY_LOADED_OBJECTS.put( LOCALIDADE_CP, Boolean.TRUE ); + } + + public Integer getContacto_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTACTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contacto_id; + } + + public void setContacto_id( Integer contacto_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTACTO_ID, contacto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contacto_id = contacto_id; + LAZY_LOADED_OBJECTS.put( CONTACTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ContactosData toContacto_id() + { + try + { + prepare( TO_CONTACTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_contacto_id; + } + + public void setToContacto_id( db.data.siprp_local.outer.ContactosData to_contacto_id ) + { + try + { + preProcess( TO_CONTACTO_ID, to_contacto_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_contacto_id = to_contacto_id; + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public String getFaz_consultas() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FAZ_CONSULTAS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.faz_consultas; + } + + public void setFaz_consultas( String faz_consultas ) + { + try + { + setLockedForRefresh( true ); + preProcess( FAZ_CONSULTAS, faz_consultas ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.faz_consultas = faz_consultas; + LAZY_LOADED_OBJECTS.put( FAZ_CONSULTAS, Boolean.TRUE ); + } + + public String getFaz_ecds() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FAZ_ECDS ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.faz_ecds; + } + + public void setFaz_ecds( String faz_ecds ) + { + try + { + setLockedForRefresh( true ); + preProcess( FAZ_ECDS, faz_ecds ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.faz_ecds = faz_ecds; + LAZY_LOADED_OBJECTS.put( FAZ_ECDS, Boolean.TRUE ); + } + + public String getContribuinte() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CONTRIBUINTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.contribuinte; + } + + public void setContribuinte( String contribuinte ) + { + try + { + setLockedForRefresh( true ); + preProcess( CONTRIBUINTE, contribuinte ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.contribuinte = contribuinte; + LAZY_LOADED_OBJECTS.put( CONTRIBUINTE, Boolean.TRUE ); + } + + public String getObservacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes; + } + + public void setObservacoes( String observacoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACOES, observacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes = observacoes; + LAZY_LOADED_OBJECTS.put( OBSERVACOES, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Prestadores.ID_INDEX: + value = getId(); + break; + case Prestadores.NOME_INDEX: + value = getNome(); + break; + case Prestadores.NOME_PLAIN_INDEX: + value = getNome_plain(); + break; + case Prestadores.MORADA_INDEX: + value = getMorada(); + break; + case Prestadores.CODIGO_POSTAL_INDEX: + value = getCodigo_postal(); + break; + case Prestadores.LOCALIDADE_INDEX: + value = getLocalidade(); + break; + case Prestadores.LOCALIDADE_CP_INDEX: + value = getLocalidade_cp(); + break; + case Prestadores.CONTACTO_ID_INDEX: + value = getContacto_id(); + break; + case Prestadores.TO_CONTACTO_ID_INDEX: + value = toContacto_id(); + break; + case Prestadores.ACTIVO_INDEX: + value = getActivo(); + break; + case Prestadores.FAZ_CONSULTAS_INDEX: + value = getFaz_consultas(); + break; + case Prestadores.FAZ_ECDS_INDEX: + value = getFaz_ecds(); + break; + case Prestadores.CONTRIBUINTE_INDEX: + value = getContribuinte(); + break; + case Prestadores.OBSERVACOES_INDEX: + value = getObservacoes(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Prestadores.ID_INDEX: + value = this.id; + break; + case Prestadores.NOME_INDEX: + value = this.nome; + break; + case Prestadores.NOME_PLAIN_INDEX: + value = this.nome_plain; + break; + case Prestadores.MORADA_INDEX: + value = this.morada; + break; + case Prestadores.CODIGO_POSTAL_INDEX: + value = this.codigo_postal; + break; + case Prestadores.LOCALIDADE_INDEX: + value = this.localidade; + break; + case Prestadores.LOCALIDADE_CP_INDEX: + value = this.localidade_cp; + break; + case Prestadores.CONTACTO_ID_INDEX: + value = this.contacto_id; + break; + case Prestadores.TO_CONTACTO_ID_INDEX: + value = this.to_contacto_id; + break; + case Prestadores.ACTIVO_INDEX: + value = this.activo; + break; + case Prestadores.FAZ_CONSULTAS_INDEX: + value = this.faz_consultas; + break; + case Prestadores.FAZ_ECDS_INDEX: + value = this.faz_ecds; + break; + case Prestadores.CONTRIBUINTE_INDEX: + value = this.contribuinte; + break; + case Prestadores.OBSERVACOES_INDEX: + value = this.observacoes; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Prestadores.ID_INDEX: + setId( ( Integer ) value ); + break; + case Prestadores.NOME_INDEX: + setNome( ( String ) value ); + break; + case Prestadores.NOME_PLAIN_INDEX: + setNome_plain( ( String ) value ); + break; + case Prestadores.MORADA_INDEX: + setMorada( ( String ) value ); + break; + case Prestadores.CODIGO_POSTAL_INDEX: + setCodigo_postal( ( String ) value ); + break; + case Prestadores.LOCALIDADE_INDEX: + setLocalidade( ( String ) value ); + break; + case Prestadores.LOCALIDADE_CP_INDEX: + setLocalidade_cp( ( String ) value ); + break; + case Prestadores.CONTACTO_ID_INDEX: + setContacto_id( ( Integer ) value ); + break; + case Prestadores.TO_CONTACTO_ID_INDEX: + setToContacto_id( ( db.data.siprp_local.outer.ContactosData ) value ); + break; + case Prestadores.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + case Prestadores.FAZ_CONSULTAS_INDEX: + setFaz_consultas( ( String ) value ); + break; + case Prestadores.FAZ_ECDS_INDEX: + setFaz_ecds( ( String ) value ); + break; + case Prestadores.CONTRIBUINTE_INDEX: + setContribuinte( ( String ) value ); + break; + case Prestadores.OBSERVACOES_INDEX: + setObservacoes( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Prestadores.ID_INDEX: + this.id = ( Integer ) value; + break; + case Prestadores.NOME_INDEX: + this.nome = ( String ) value; + break; + case Prestadores.NOME_PLAIN_INDEX: + this.nome_plain = ( String ) value; + break; + case Prestadores.MORADA_INDEX: + this.morada = ( String ) value; + break; + case Prestadores.CODIGO_POSTAL_INDEX: + this.codigo_postal = ( String ) value; + break; + case Prestadores.LOCALIDADE_INDEX: + this.localidade = ( String ) value; + break; + case Prestadores.LOCALIDADE_CP_INDEX: + this.localidade_cp = ( String ) value; + break; + case Prestadores.CONTACTO_ID_INDEX: + this.contacto_id = ( Integer ) value; + break; + case Prestadores.TO_CONTACTO_ID_INDEX: + this.to_contacto_id = ( db.data.siprp_local.outer.ContactosData ) value; + break; + case Prestadores.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + case Prestadores.FAZ_CONSULTAS_INDEX: + this.faz_consultas = ( String ) value; + break; + case Prestadores.FAZ_ECDS_INDEX: + this.faz_ecds = ( String ) value; + break; + case Prestadores.CONTRIBUINTE_INDEX: + this.contribuinte = ( String ) value; + break; + case Prestadores.OBSERVACOES_INDEX: + this.observacoes = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Prestadores.ID_INDEX: + theClass = Integer.class; + break; + case Prestadores.NOME_INDEX: + theClass = String.class; + break; + case Prestadores.NOME_PLAIN_INDEX: + theClass = String.class; + break; + case Prestadores.MORADA_INDEX: + theClass = String.class; + break; + case Prestadores.CODIGO_POSTAL_INDEX: + theClass = String.class; + break; + case Prestadores.LOCALIDADE_INDEX: + theClass = String.class; + break; + case Prestadores.LOCALIDADE_CP_INDEX: + theClass = String.class; + break; + case Prestadores.CONTACTO_ID_INDEX: + theClass = Integer.class; + break; + case Prestadores.TO_CONTACTO_ID_INDEX: + theClass = db.data.siprp_local.outer.ContactosData.class; + break; + case Prestadores.ACTIVO_INDEX: + theClass = String.class; + break; + case Prestadores.FAZ_CONSULTAS_INDEX: + theClass = String.class; + break; + case Prestadores.FAZ_ECDS_INDEX: + theClass = String.class; + break; + case Prestadores.CONTRIBUINTE_INDEX: + theClass = String.class; + break; + case Prestadores.OBSERVACOES_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Prestadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Prestadores.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrestadoresGruposProtocolo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrestadoresGruposProtocolo.java new file mode 100644 index 00000000..3d3e72d1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrestadoresGruposProtocolo.java @@ -0,0 +1,431 @@ +/* +* PrestadoresGruposProtocolo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PrestadoresGruposProtocolo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PrestadoresGruposProtocolo.ID, PrestadoresGruposProtocolo.ID_INDEX ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.ID_FULL, PrestadoresGruposProtocolo.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PrestadoresGruposProtocolo.CLASS_IDENTIFIER, PrestadoresGruposProtocolo.PRESTADOR_ID, PrestadoresGruposProtocolo.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.PRESTADOR_ID, PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.PRESTADOR_ID_FULL, PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.TO_PRESTADOR_ID, PrestadoresGruposProtocolo.TO_PRESTADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PrestadoresGruposProtocolo.CLASS_IDENTIFIER, PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID, PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID, PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_FULL, PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID, PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( PrestadoresGruposProtocolo.class, PrestadoresGruposProtocolo.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeygrupo_protocolo_idToprt_grupos_protocolo = + new com.evolute.entity.ForeignKey( PrestadoresGruposProtocolo.class, PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID, db.data.siprp_local.outer.PrtGruposProtocoloData.class, db.data.siprp_local.outer.PrtGruposProtocoloData.ID ); + + public static final String TABLENAME = "prestadores_grupos_protocolo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.prestadores_grupos_protocolo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "prestadores_grupos_protocolo.id"; + public static final int ID_INDEX = 0; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "prestadores_grupos_protocolo.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 1; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "prestadores_grupos_protocolo.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 2; + public static final String GRUPO_PROTOCOLO_ID = "grupo_protocolo_id"; + public static final String GRUPO_PROTOCOLO_ID_FULL = "prestadores_grupos_protocolo.grupo_protocolo_id"; + public static final int GRUPO_PROTOCOLO_ID_INDEX = 3; + public static final String TO_GRUPO_PROTOCOLO_ID = "to_grupo_protocolo_id"; + public static final String TO_GRUPO_PROTOCOLO_ID_FULL = "prestadores_grupos_protocolo.to_grupo_protocolo_id"; + public static final int TO_GRUPO_PROTOCOLO_ID_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + PRESTADOR_ID, TO_PRESTADOR_ID, GRUPO_PROTOCOLO_ID, TO_GRUPO_PROTOCOLO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PRESTADOR_ID, TABLENAME + "." + TO_PRESTADOR_ID, TABLENAME + "." + GRUPO_PROTOCOLO_ID, TABLENAME + "." + TO_GRUPO_PROTOCOLO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PRESTADOR_ID, GRUPO_PROTOCOLO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PRESTADOR_ID, GRUPO_PROTOCOLO_ID, }; + + private Integer id; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + private Integer grupo_protocolo_id; + private db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_protocolo_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PrestadoresGruposProtocolo() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Integer getGrupo_protocolo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( GRUPO_PROTOCOLO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.grupo_protocolo_id; + } + + public void setGrupo_protocolo_id( Integer grupo_protocolo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( GRUPO_PROTOCOLO_ID, grupo_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.grupo_protocolo_id = grupo_protocolo_id; + LAZY_LOADED_OBJECTS.put( GRUPO_PROTOCOLO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrtGruposProtocoloData toGrupo_protocolo_id() + { + try + { + prepare( TO_GRUPO_PROTOCOLO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_grupo_protocolo_id; + } + + public void setToGrupo_protocolo_id( db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_protocolo_id ) + { + try + { + preProcess( TO_GRUPO_PROTOCOLO_ID, to_grupo_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_grupo_protocolo_id = to_grupo_protocolo_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrestadoresGruposProtocolo.ID_INDEX: + value = getId(); + break; + case PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case PrestadoresGruposProtocolo.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + case PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + value = getGrupo_protocolo_id(); + break; + case PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + value = toGrupo_protocolo_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrestadoresGruposProtocolo.ID_INDEX: + value = this.id; + break; + case PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case PrestadoresGruposProtocolo.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + case PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + value = this.grupo_protocolo_id; + break; + case PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + value = this.to_grupo_protocolo_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrestadoresGruposProtocolo.ID_INDEX: + setId( ( Integer ) value ); + break; + case PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case PrestadoresGruposProtocolo.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + setGrupo_protocolo_id( ( Integer ) value ); + break; + case PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + setToGrupo_protocolo_id( ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrestadoresGruposProtocolo.ID_INDEX: + this.id = ( Integer ) value; + break; + case PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case PrestadoresGruposProtocolo.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + this.grupo_protocolo_id = ( Integer ) value; + break; + case PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + this.to_grupo_protocolo_id = ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PrestadoresGruposProtocolo.ID_INDEX: + theClass = Integer.class; + break; + case PrestadoresGruposProtocolo.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case PrestadoresGruposProtocolo.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case PrestadoresGruposProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + theClass = Integer.class; + break; + case PrestadoresGruposProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + theClass = db.data.siprp_local.outer.PrtGruposProtocoloData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PrestadoresGruposProtocolo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PrestadoresGruposProtocolo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtElementosProtocolo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtElementosProtocolo.java new file mode 100644 index 00000000..7f0afc71 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtElementosProtocolo.java @@ -0,0 +1,483 @@ +/* +* PrtElementosProtocolo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PrtElementosProtocolo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PrtElementosProtocolo.ID, PrtElementosProtocolo.ID_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.ID_FULL, PrtElementosProtocolo.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PrtElementosProtocolo.CLASS_IDENTIFIER, PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID, PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID ); + FIELD_INDEXES.put( PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID, PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_FULL, PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID, PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PrtElementosProtocolo.CLASS_IDENTIFIER, PrtElementosProtocolo.EMPRESA_ID, PrtElementosProtocolo.TO_EMPRESA_ID ); + FIELD_INDEXES.put( PrtElementosProtocolo.EMPRESA_ID, PrtElementosProtocolo.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.EMPRESA_ID_FULL, PrtElementosProtocolo.EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.TO_EMPRESA_ID, PrtElementosProtocolo.TO_EMPRESA_ID_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.NUMERO_PERFIL, PrtElementosProtocolo.NUMERO_PERFIL_INDEX ); + FIELD_INDEXES.put( PrtElementosProtocolo.NUMERO_PERFIL_FULL, PrtElementosProtocolo.NUMERO_PERFIL_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytipo_elemento_protocolo_idToprt_tipos_elementos_protocolo = + new com.evolute.entity.ForeignKey( PrtElementosProtocolo.class, PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID, db.data.siprp_local.outer.PrtTiposElementosProtocoloData.class, db.data.siprp_local.outer.PrtTiposElementosProtocoloData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyempresa_idToempresas = + new com.evolute.entity.ForeignKey( PrtElementosProtocolo.class, PrtElementosProtocolo.EMPRESA_ID, db.data.siprp_local.outer.EmpresasData.class, db.data.siprp_local.outer.EmpresasData.ID ); + + public static final String TABLENAME = "prt_elementos_protocolo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.prt_elementos_protocolo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "prt_elementos_protocolo.id"; + public static final int ID_INDEX = 0; + public static final String TIPO_ELEMENTO_PROTOCOLO_ID = "tipo_elemento_protocolo_id"; + public static final String TIPO_ELEMENTO_PROTOCOLO_ID_FULL = "prt_elementos_protocolo.tipo_elemento_protocolo_id"; + public static final int TIPO_ELEMENTO_PROTOCOLO_ID_INDEX = 1; + public static final String TO_TIPO_ELEMENTO_PROTOCOLO_ID = "to_tipo_elemento_protocolo_id"; + public static final String TO_TIPO_ELEMENTO_PROTOCOLO_ID_FULL = "prt_elementos_protocolo.to_tipo_elemento_protocolo_id"; + public static final int TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX = 2; + public static final String EMPRESA_ID = "empresa_id"; + public static final String EMPRESA_ID_FULL = "prt_elementos_protocolo.empresa_id"; + public static final int EMPRESA_ID_INDEX = 3; + public static final String TO_EMPRESA_ID = "to_empresa_id"; + public static final String TO_EMPRESA_ID_FULL = "prt_elementos_protocolo.to_empresa_id"; + public static final int TO_EMPRESA_ID_INDEX = 4; + public static final String NUMERO_PERFIL = "numero_perfil"; + public static final String NUMERO_PERFIL_FULL = "prt_elementos_protocolo.numero_perfil"; + public static final int NUMERO_PERFIL_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + TIPO_ELEMENTO_PROTOCOLO_ID, TO_TIPO_ELEMENTO_PROTOCOLO_ID, EMPRESA_ID, + TO_EMPRESA_ID, NUMERO_PERFIL, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TIPO_ELEMENTO_PROTOCOLO_ID, TABLENAME + "." + TO_TIPO_ELEMENTO_PROTOCOLO_ID, TABLENAME + "." + EMPRESA_ID, + TABLENAME + "." + TO_EMPRESA_ID, TABLENAME + "." + NUMERO_PERFIL, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TIPO_ELEMENTO_PROTOCOLO_ID, EMPRESA_ID, NUMERO_PERFIL, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TIPO_ELEMENTO_PROTOCOLO_ID, EMPRESA_ID, NUMERO_PERFIL, }; + + private Integer id; + private Integer tipo_elemento_protocolo_id; + private db.data.siprp_local.outer.PrtTiposElementosProtocoloData to_tipo_elemento_protocolo_id; + private Integer empresa_id; + private db.data.siprp_local.outer.EmpresasData to_empresa_id; + private Integer numero_perfil; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PrtElementosProtocolo() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTipo_elemento_protocolo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TIPO_ELEMENTO_PROTOCOLO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.tipo_elemento_protocolo_id; + } + + public void setTipo_elemento_protocolo_id( Integer tipo_elemento_protocolo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TIPO_ELEMENTO_PROTOCOLO_ID, tipo_elemento_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.tipo_elemento_protocolo_id = tipo_elemento_protocolo_id; + LAZY_LOADED_OBJECTS.put( TIPO_ELEMENTO_PROTOCOLO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrtTiposElementosProtocoloData toTipo_elemento_protocolo_id() + { + try + { + prepare( TO_TIPO_ELEMENTO_PROTOCOLO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_tipo_elemento_protocolo_id; + } + + public void setToTipo_elemento_protocolo_id( db.data.siprp_local.outer.PrtTiposElementosProtocoloData to_tipo_elemento_protocolo_id ) + { + try + { + preProcess( TO_TIPO_ELEMENTO_PROTOCOLO_ID, to_tipo_elemento_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_tipo_elemento_protocolo_id = to_tipo_elemento_protocolo_id; + } + + public Integer getEmpresa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EMPRESA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.empresa_id; + } + + public void setEmpresa_id( Integer empresa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EMPRESA_ID, empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.empresa_id = empresa_id; + LAZY_LOADED_OBJECTS.put( EMPRESA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EmpresasData toEmpresa_id() + { + try + { + prepare( TO_EMPRESA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_empresa_id; + } + + public void setToEmpresa_id( db.data.siprp_local.outer.EmpresasData to_empresa_id ) + { + try + { + preProcess( TO_EMPRESA_ID, to_empresa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_empresa_id = to_empresa_id; + } + + public Integer getNumero_perfil() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_PERFIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_perfil; + } + + public void setNumero_perfil( Integer numero_perfil ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_PERFIL, numero_perfil ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_perfil = numero_perfil; + LAZY_LOADED_OBJECTS.put( NUMERO_PERFIL, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtElementosProtocolo.ID_INDEX: + value = getId(); + break; + case PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + value = getTipo_elemento_protocolo_id(); + break; + case PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + value = toTipo_elemento_protocolo_id(); + break; + case PrtElementosProtocolo.EMPRESA_ID_INDEX: + value = getEmpresa_id(); + break; + case PrtElementosProtocolo.TO_EMPRESA_ID_INDEX: + value = toEmpresa_id(); + break; + case PrtElementosProtocolo.NUMERO_PERFIL_INDEX: + value = getNumero_perfil(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtElementosProtocolo.ID_INDEX: + value = this.id; + break; + case PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + value = this.tipo_elemento_protocolo_id; + break; + case PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + value = this.to_tipo_elemento_protocolo_id; + break; + case PrtElementosProtocolo.EMPRESA_ID_INDEX: + value = this.empresa_id; + break; + case PrtElementosProtocolo.TO_EMPRESA_ID_INDEX: + value = this.to_empresa_id; + break; + case PrtElementosProtocolo.NUMERO_PERFIL_INDEX: + value = this.numero_perfil; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtElementosProtocolo.ID_INDEX: + setId( ( Integer ) value ); + break; + case PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + setTipo_elemento_protocolo_id( ( Integer ) value ); + break; + case PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + setToTipo_elemento_protocolo_id( ( db.data.siprp_local.outer.PrtTiposElementosProtocoloData ) value ); + break; + case PrtElementosProtocolo.EMPRESA_ID_INDEX: + setEmpresa_id( ( Integer ) value ); + break; + case PrtElementosProtocolo.TO_EMPRESA_ID_INDEX: + setToEmpresa_id( ( db.data.siprp_local.outer.EmpresasData ) value ); + break; + case PrtElementosProtocolo.NUMERO_PERFIL_INDEX: + setNumero_perfil( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtElementosProtocolo.ID_INDEX: + this.id = ( Integer ) value; + break; + case PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + this.tipo_elemento_protocolo_id = ( Integer ) value; + break; + case PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + this.to_tipo_elemento_protocolo_id = ( db.data.siprp_local.outer.PrtTiposElementosProtocoloData ) value; + break; + case PrtElementosProtocolo.EMPRESA_ID_INDEX: + this.empresa_id = ( Integer ) value; + break; + case PrtElementosProtocolo.TO_EMPRESA_ID_INDEX: + this.to_empresa_id = ( db.data.siprp_local.outer.EmpresasData ) value; + break; + case PrtElementosProtocolo.NUMERO_PERFIL_INDEX: + this.numero_perfil = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PrtElementosProtocolo.ID_INDEX: + theClass = Integer.class; + break; + case PrtElementosProtocolo.TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + theClass = Integer.class; + break; + case PrtElementosProtocolo.TO_TIPO_ELEMENTO_PROTOCOLO_ID_INDEX: + theClass = db.data.siprp_local.outer.PrtTiposElementosProtocoloData.class; + break; + case PrtElementosProtocolo.EMPRESA_ID_INDEX: + theClass = Integer.class; + break; + case PrtElementosProtocolo.TO_EMPRESA_ID_INDEX: + theClass = db.data.siprp_local.outer.EmpresasData.class; + break; + case PrtElementosProtocolo.NUMERO_PERFIL_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PrtElementosProtocolo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PrtElementosProtocolo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtGruposProtocolo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtGruposProtocolo.java new file mode 100644 index 00000000..70b12732 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtGruposProtocolo.java @@ -0,0 +1,587 @@ +/* +* PrtGruposProtocolo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PrtGruposProtocolo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PrtGruposProtocolo.ID, PrtGruposProtocolo.ID_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.ID_FULL, PrtGruposProtocolo.ID_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.DESCRICAO, PrtGruposProtocolo.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.DESCRICAO_FULL, PrtGruposProtocolo.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.DESCRICAO_PLAIN, PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.DESCRICAO_PLAIN_FULL, PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.GRUPO_REAL, PrtGruposProtocolo.GRUPO_REAL_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.GRUPO_REAL_FULL, PrtGruposProtocolo.GRUPO_REAL_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.ORDEM, PrtGruposProtocolo.ORDEM_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.ORDEM_FULL, PrtGruposProtocolo.ORDEM_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PrtGruposProtocolo.CLASS_IDENTIFIER, PrtGruposProtocolo.ANALISADOR_ID, PrtGruposProtocolo.TO_ANALISADOR_ID ); + FIELD_INDEXES.put( PrtGruposProtocolo.ANALISADOR_ID, PrtGruposProtocolo.ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.ANALISADOR_ID_FULL, PrtGruposProtocolo.ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( PrtGruposProtocolo.TO_ANALISADOR_ID, PrtGruposProtocolo.TO_ANALISADOR_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyanalisador_idToprestadores = + new com.evolute.entity.ForeignKey( PrtGruposProtocolo.class, PrtGruposProtocolo.ANALISADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final String TABLENAME = "prt_grupos_protocolo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.prt_grupos_protocolo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "prt_grupos_protocolo.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "prt_grupos_protocolo.descricao"; + public static final int DESCRICAO_INDEX = 1; + public static final String DESCRICAO_PLAIN = "descricao_plain"; + public static final String DESCRICAO_PLAIN_FULL = "prt_grupos_protocolo.descricao_plain"; + public static final int DESCRICAO_PLAIN_INDEX = 2; + public static final String GRUPO_REAL = "grupo_real"; + public static final String GRUPO_REAL_FULL = "prt_grupos_protocolo.grupo_real"; + public static final int GRUPO_REAL_INDEX = 3; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "prt_grupos_protocolo.ordem"; + public static final int ORDEM_INDEX = 4; + public static final String ANALISADOR_ID = "analisador_id"; + public static final String ANALISADOR_ID_FULL = "prt_grupos_protocolo.analisador_id"; + public static final int ANALISADOR_ID_INDEX = 5; + public static final String TO_ANALISADOR_ID = "to_analisador_id"; + public static final String TO_ANALISADOR_ID_FULL = "prt_grupos_protocolo.to_analisador_id"; + public static final int TO_ANALISADOR_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO, DESCRICAO_PLAIN, GRUPO_REAL, ORDEM, ANALISADOR_ID, TO_ANALISADOR_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO, TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + GRUPO_REAL, TABLENAME + "." + ORDEM, TABLENAME + "." + ANALISADOR_ID, TABLENAME + "." + TO_ANALISADOR_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO, DESCRICAO_PLAIN, GRUPO_REAL, ORDEM, ANALISADOR_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO, DESCRICAO_PLAIN, GRUPO_REAL, ORDEM, ANALISADOR_ID, }; + + private Integer id; + private String descricao; + private String descricao_plain; + private String grupo_real; + private Integer ordem; + private Integer analisador_id; + private db.data.siprp_local.outer.PrestadoresData to_analisador_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PrtGruposProtocolo() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromMarcacoesGruposRealizados_grupo_protocolo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesGruposRealizadosData.class , getPrimaryKey().getMap().get("id"), "grupo_protocolo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromPrestadoresGruposProtocolo_grupo_protocolo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrestadoresGruposProtocoloData.class , getPrimaryKey().getMap().get("id"), "grupo_protocolo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromPrtTiposElementosProtocolo_grupo_protocolo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrtTiposElementosProtocoloData.class , getPrimaryKey().getMap().get("id"), "grupo_protocolo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcdsAnalise_grupo_ecds_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsAnaliseData.class , getPrimaryKey().getMap().get("id"), "grupo_ecds_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public String getDescricao_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao_plain; + } + + public void setDescricao_plain( String descricao_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO_PLAIN, descricao_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao_plain = descricao_plain; + LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, Boolean.TRUE ); + } + + public String getGrupo_real() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( GRUPO_REAL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.grupo_real; + } + + public void setGrupo_real( String grupo_real ) + { + try + { + setLockedForRefresh( true ); + preProcess( GRUPO_REAL, grupo_real ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.grupo_real = grupo_real; + LAZY_LOADED_OBJECTS.put( GRUPO_REAL, Boolean.TRUE ); + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Integer getAnalisador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analisador_id; + } + + public void setAnalisador_id( Integer analisador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ANALISADOR_ID, analisador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analisador_id = analisador_id; + LAZY_LOADED_OBJECTS.put( ANALISADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toAnalisador_id() + { + try + { + prepare( TO_ANALISADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_analisador_id; + } + + public void setToAnalisador_id( db.data.siprp_local.outer.PrestadoresData to_analisador_id ) + { + try + { + preProcess( TO_ANALISADOR_ID, to_analisador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_analisador_id = to_analisador_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtGruposProtocolo.ID_INDEX: + value = getId(); + break; + case PrtGruposProtocolo.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX: + value = getDescricao_plain(); + break; + case PrtGruposProtocolo.GRUPO_REAL_INDEX: + value = getGrupo_real(); + break; + case PrtGruposProtocolo.ORDEM_INDEX: + value = getOrdem(); + break; + case PrtGruposProtocolo.ANALISADOR_ID_INDEX: + value = getAnalisador_id(); + break; + case PrtGruposProtocolo.TO_ANALISADOR_ID_INDEX: + value = toAnalisador_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtGruposProtocolo.ID_INDEX: + value = this.id; + break; + case PrtGruposProtocolo.DESCRICAO_INDEX: + value = this.descricao; + break; + case PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX: + value = this.descricao_plain; + break; + case PrtGruposProtocolo.GRUPO_REAL_INDEX: + value = this.grupo_real; + break; + case PrtGruposProtocolo.ORDEM_INDEX: + value = this.ordem; + break; + case PrtGruposProtocolo.ANALISADOR_ID_INDEX: + value = this.analisador_id; + break; + case PrtGruposProtocolo.TO_ANALISADOR_ID_INDEX: + value = this.to_analisador_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtGruposProtocolo.ID_INDEX: + setId( ( Integer ) value ); + break; + case PrtGruposProtocolo.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX: + setDescricao_plain( ( String ) value ); + break; + case PrtGruposProtocolo.GRUPO_REAL_INDEX: + setGrupo_real( ( String ) value ); + break; + case PrtGruposProtocolo.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case PrtGruposProtocolo.ANALISADOR_ID_INDEX: + setAnalisador_id( ( Integer ) value ); + break; + case PrtGruposProtocolo.TO_ANALISADOR_ID_INDEX: + setToAnalisador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtGruposProtocolo.ID_INDEX: + this.id = ( Integer ) value; + break; + case PrtGruposProtocolo.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX: + this.descricao_plain = ( String ) value; + break; + case PrtGruposProtocolo.GRUPO_REAL_INDEX: + this.grupo_real = ( String ) value; + break; + case PrtGruposProtocolo.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case PrtGruposProtocolo.ANALISADOR_ID_INDEX: + this.analisador_id = ( Integer ) value; + break; + case PrtGruposProtocolo.TO_ANALISADOR_ID_INDEX: + this.to_analisador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PrtGruposProtocolo.ID_INDEX: + theClass = Integer.class; + break; + case PrtGruposProtocolo.DESCRICAO_INDEX: + theClass = String.class; + break; + case PrtGruposProtocolo.DESCRICAO_PLAIN_INDEX: + theClass = String.class; + break; + case PrtGruposProtocolo.GRUPO_REAL_INDEX: + theClass = String.class; + break; + case PrtGruposProtocolo.ORDEM_INDEX: + theClass = Integer.class; + break; + case PrtGruposProtocolo.ANALISADOR_ID_INDEX: + theClass = Integer.class; + break; + case PrtGruposProtocolo.TO_ANALISADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PrtGruposProtocolo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PrtGruposProtocolo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtTiposElementosProtocolo.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtTiposElementosProtocolo.java new file mode 100644 index 00000000..234d4ad0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/PrtTiposElementosProtocolo.java @@ -0,0 +1,509 @@ +/* +* PrtTiposElementosProtocolo.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class PrtTiposElementosProtocolo extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( PrtTiposElementosProtocolo.ID, PrtTiposElementosProtocolo.ID_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.ID_FULL, PrtTiposElementosProtocolo.ID_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.DESCRICAO_PLAIN, PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.DESCRICAO_PLAIN_FULL, PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.DESCRICAO, PrtTiposElementosProtocolo.DESCRICAO_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.DESCRICAO_FULL, PrtTiposElementosProtocolo.DESCRICAO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( PrtTiposElementosProtocolo.CLASS_IDENTIFIER, PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID, PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID, PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_FULL, PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID, PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.ORDEM, PrtTiposElementosProtocolo.ORDEM_INDEX ); + FIELD_INDEXES.put( PrtTiposElementosProtocolo.ORDEM_FULL, PrtTiposElementosProtocolo.ORDEM_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeygrupo_protocolo_idToprt_grupos_protocolo = + new com.evolute.entity.ForeignKey( PrtTiposElementosProtocolo.class, PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID, db.data.siprp_local.outer.PrtGruposProtocoloData.class, db.data.siprp_local.outer.PrtGruposProtocoloData.ID ); + + public static final String TABLENAME = "prt_tipos_elementos_protocolo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.prt_tipos_elementos_protocolo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "prt_tipos_elementos_protocolo.id"; + public static final int ID_INDEX = 0; + public static final String DESCRICAO_PLAIN = "descricao_plain"; + public static final String DESCRICAO_PLAIN_FULL = "prt_tipos_elementos_protocolo.descricao_plain"; + public static final int DESCRICAO_PLAIN_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "prt_tipos_elementos_protocolo.descricao"; + public static final int DESCRICAO_INDEX = 2; + public static final String GRUPO_PROTOCOLO_ID = "grupo_protocolo_id"; + public static final String GRUPO_PROTOCOLO_ID_FULL = "prt_tipos_elementos_protocolo.grupo_protocolo_id"; + public static final int GRUPO_PROTOCOLO_ID_INDEX = 3; + public static final String TO_GRUPO_PROTOCOLO_ID = "to_grupo_protocolo_id"; + public static final String TO_GRUPO_PROTOCOLO_ID_FULL = "prt_tipos_elementos_protocolo.to_grupo_protocolo_id"; + public static final int TO_GRUPO_PROTOCOLO_ID_INDEX = 4; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "prt_tipos_elementos_protocolo.ordem"; + public static final int ORDEM_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DESCRICAO_PLAIN, DESCRICAO, GRUPO_PROTOCOLO_ID, TO_GRUPO_PROTOCOLO_ID, ORDEM, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DESCRICAO_PLAIN, TABLENAME + "." + DESCRICAO, TABLENAME + "." + GRUPO_PROTOCOLO_ID, TABLENAME + "." + TO_GRUPO_PROTOCOLO_ID, TABLENAME + "." + ORDEM, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DESCRICAO_PLAIN, DESCRICAO, GRUPO_PROTOCOLO_ID, ORDEM, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DESCRICAO_PLAIN, DESCRICAO, GRUPO_PROTOCOLO_ID, ORDEM, }; + + private Integer id; + private String descricao_plain; + private String descricao; + private Integer grupo_protocolo_id; + private db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_protocolo_id; + private Integer ordem; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public PrtTiposElementosProtocolo() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromPrtElementosProtocolo_tipo_elemento_protocolo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.PrtElementosProtocoloData.class , getPrimaryKey().getMap().get("id"), "tipo_elemento_protocolo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcd_ecd_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdData.class , getPrimaryKey().getMap().get("id"), "ecd_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getDescricao_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao_plain; + } + + public void setDescricao_plain( String descricao_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO_PLAIN, descricao_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao_plain = descricao_plain; + LAZY_LOADED_OBJECTS.put( DESCRICAO_PLAIN, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Integer getGrupo_protocolo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( GRUPO_PROTOCOLO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.grupo_protocolo_id; + } + + public void setGrupo_protocolo_id( Integer grupo_protocolo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( GRUPO_PROTOCOLO_ID, grupo_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.grupo_protocolo_id = grupo_protocolo_id; + LAZY_LOADED_OBJECTS.put( GRUPO_PROTOCOLO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrtGruposProtocoloData toGrupo_protocolo_id() + { + try + { + prepare( TO_GRUPO_PROTOCOLO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_grupo_protocolo_id; + } + + public void setToGrupo_protocolo_id( db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_protocolo_id ) + { + try + { + preProcess( TO_GRUPO_PROTOCOLO_ID, to_grupo_protocolo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_grupo_protocolo_id = to_grupo_protocolo_id; + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtTiposElementosProtocolo.ID_INDEX: + value = getId(); + break; + case PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX: + value = getDescricao_plain(); + break; + case PrtTiposElementosProtocolo.DESCRICAO_INDEX: + value = getDescricao(); + break; + case PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + value = getGrupo_protocolo_id(); + break; + case PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + value = toGrupo_protocolo_id(); + break; + case PrtTiposElementosProtocolo.ORDEM_INDEX: + value = getOrdem(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtTiposElementosProtocolo.ID_INDEX: + value = this.id; + break; + case PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX: + value = this.descricao_plain; + break; + case PrtTiposElementosProtocolo.DESCRICAO_INDEX: + value = this.descricao; + break; + case PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + value = this.grupo_protocolo_id; + break; + case PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + value = this.to_grupo_protocolo_id; + break; + case PrtTiposElementosProtocolo.ORDEM_INDEX: + value = this.ordem; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtTiposElementosProtocolo.ID_INDEX: + setId( ( Integer ) value ); + break; + case PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX: + setDescricao_plain( ( String ) value ); + break; + case PrtTiposElementosProtocolo.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + case PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + setGrupo_protocolo_id( ( Integer ) value ); + break; + case PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + setToGrupo_protocolo_id( ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value ); + break; + case PrtTiposElementosProtocolo.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case PrtTiposElementosProtocolo.ID_INDEX: + this.id = ( Integer ) value; + break; + case PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX: + this.descricao_plain = ( String ) value; + break; + case PrtTiposElementosProtocolo.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + case PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + this.grupo_protocolo_id = ( Integer ) value; + break; + case PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + this.to_grupo_protocolo_id = ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value; + break; + case PrtTiposElementosProtocolo.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case PrtTiposElementosProtocolo.ID_INDEX: + theClass = Integer.class; + break; + case PrtTiposElementosProtocolo.DESCRICAO_PLAIN_INDEX: + theClass = String.class; + break; + case PrtTiposElementosProtocolo.DESCRICAO_INDEX: + theClass = String.class; + break; + case PrtTiposElementosProtocolo.GRUPO_PROTOCOLO_ID_INDEX: + theClass = Integer.class; + break; + case PrtTiposElementosProtocolo.TO_GRUPO_PROTOCOLO_ID_INDEX: + theClass = db.data.siprp_local.outer.PrtGruposProtocoloData.class; + break; + case PrtTiposElementosProtocolo.ORDEM_INDEX: + theClass = Integer.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : PrtTiposElementosProtocolo._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, PrtTiposElementosProtocolo.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TiposExamesComp.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TiposExamesComp.java new file mode 100644 index 00000000..38794c5f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TiposExamesComp.java @@ -0,0 +1,344 @@ +/* +* TiposExamesComp.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TiposExamesComp extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TiposExamesComp.ID, TiposExamesComp.ID_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.ID_FULL, TiposExamesComp.ID_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.ORDEM, TiposExamesComp.ORDEM_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.ORDEM_FULL, TiposExamesComp.ORDEM_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.DESCRICAO, TiposExamesComp.DESCRICAO_INDEX ); + FIELD_INDEXES.put( TiposExamesComp.DESCRICAO_FULL, TiposExamesComp.DESCRICAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "tipos_exames_comp"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.tipos_exames_comp"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "tipos_exames_comp.id"; + public static final int ID_INDEX = 0; + public static final String ORDEM = "ordem"; + public static final String ORDEM_FULL = "tipos_exames_comp.ordem"; + public static final int ORDEM_INDEX = 1; + public static final String DESCRICAO = "descricao"; + public static final String DESCRICAO_FULL = "tipos_exames_comp.descricao"; + public static final int DESCRICAO_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + ORDEM, DESCRICAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ORDEM, TABLENAME + "." + DESCRICAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ORDEM, DESCRICAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ORDEM, DESCRICAO, }; + + private Integer id; + private Integer ordem; + private String descricao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TiposExamesComp() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromExamesPerfis_tipo() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.ExamesPerfisData.class , getPrimaryKey().getMap().get("id"), "tipo" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getOrdem() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ORDEM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ordem; + } + + public void setOrdem( Integer ordem ) + { + try + { + setLockedForRefresh( true ); + preProcess( ORDEM, ordem ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ordem = ordem; + LAZY_LOADED_OBJECTS.put( ORDEM, Boolean.TRUE ); + } + + public String getDescricao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESCRICAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.descricao; + } + + public void setDescricao( String descricao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESCRICAO, descricao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.descricao = descricao; + LAZY_LOADED_OBJECTS.put( DESCRICAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + value = getId(); + break; + case TiposExamesComp.ORDEM_INDEX: + value = getOrdem(); + break; + case TiposExamesComp.DESCRICAO_INDEX: + value = getDescricao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + value = this.id; + break; + case TiposExamesComp.ORDEM_INDEX: + value = this.ordem; + break; + case TiposExamesComp.DESCRICAO_INDEX: + value = this.descricao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + setId( ( Integer ) value ); + break; + case TiposExamesComp.ORDEM_INDEX: + setOrdem( ( Integer ) value ); + break; + case TiposExamesComp.DESCRICAO_INDEX: + setDescricao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TiposExamesComp.ID_INDEX: + this.id = ( Integer ) value; + break; + case TiposExamesComp.ORDEM_INDEX: + this.ordem = ( Integer ) value; + break; + case TiposExamesComp.DESCRICAO_INDEX: + this.descricao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TiposExamesComp.ID_INDEX: + theClass = Integer.class; + break; + case TiposExamesComp.ORDEM_INDEX: + theClass = Integer.class; + break; + case TiposExamesComp.DESCRICAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TiposExamesComp._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TiposExamesComp.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Trabalhadores.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Trabalhadores.java new file mode 100644 index 00000000..e83c9b32 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Trabalhadores.java @@ -0,0 +1,1597 @@ +/* +* Trabalhadores.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Trabalhadores extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Trabalhadores.ID, Trabalhadores.ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ID_FULL, Trabalhadores.ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NOME, Trabalhadores.NOME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NOME_FULL, Trabalhadores.NOME_INDEX ); + FIELD_INDEXES.put( Trabalhadores.SEXO, Trabalhadores.SEXO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.SEXO_FULL, Trabalhadores.SEXO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_NASCIMENTO, Trabalhadores.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_NASCIMENTO_FULL, Trabalhadores.DATA_NASCIMENTO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NACIONALIDADE, Trabalhadores.NACIONALIDADE_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NACIONALIDADE_FULL, Trabalhadores.NACIONALIDADE_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NUMERO_MECANOGRAFICO, Trabalhadores.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NUMERO_MECANOGRAFICO_FULL, Trabalhadores.NUMERO_MECANOGRAFICO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_ADMISSAO, Trabalhadores.DATA_ADMISSAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_ADMISSAO_FULL, Trabalhadores.DATA_ADMISSAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.CATEGORIA, Trabalhadores.CATEGORIA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.CATEGORIA_FULL, Trabalhadores.CATEGORIA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.LOCAL_TRABALHO, Trabalhadores.LOCAL_TRABALHO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.LOCAL_TRABALHO_FULL, Trabalhadores.LOCAL_TRABALHO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.FUNCAO_PROPOSTA, Trabalhadores.FUNCAO_PROPOSTA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.FUNCAO_PROPOSTA_FULL, Trabalhadores.FUNCAO_PROPOSTA_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_ADMISSAO_FUNCAO, Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_ADMISSAO_FUNCAO_FULL, Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.OBSERVACOES, Trabalhadores.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( Trabalhadores.OBSERVACOES_FULL, Trabalhadores.OBSERVACOES_INDEX ); + FIELD_INDEXES.put( Trabalhadores.INACTIVO, Trabalhadores.INACTIVO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.INACTIVO_FULL, Trabalhadores.INACTIVO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Trabalhadores.CLASS_IDENTIFIER, Trabalhadores.ESTABELECIMENTO_ID, Trabalhadores.TO_ESTABELECIMENTO_ID ); + FIELD_INDEXES.put( Trabalhadores.ESTABELECIMENTO_ID, Trabalhadores.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ESTABELECIMENTO_ID_FULL, Trabalhadores.ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.TO_ESTABELECIMENTO_ID, Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_DEMISSAO, Trabalhadores.DATA_DEMISSAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.DATA_DEMISSAO_FULL, Trabalhadores.DATA_DEMISSAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.OBSERVACOES_GESTAO, Trabalhadores.OBSERVACOES_GESTAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.OBSERVACOES_GESTAO_FULL, Trabalhadores.OBSERVACOES_GESTAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PERFIL, Trabalhadores.PERFIL_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PERFIL_FULL, Trabalhadores.PERFIL_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ACTUALIZACAO, Trabalhadores.ACTUALIZACAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.ACTUALIZACAO_FULL, Trabalhadores.ACTUALIZACAO_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NOME_PLAIN, Trabalhadores.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NOME_PLAIN_FULL, Trabalhadores.NOME_PLAIN_INDEX ); + FIELD_INDEXES.put( Trabalhadores.BI, Trabalhadores.BI_INDEX ); + FIELD_INDEXES.put( Trabalhadores.BI_FULL, Trabalhadores.BI_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NIF, Trabalhadores.NIF_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NIF_FULL, Trabalhadores.NIF_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NUMERO_UTENTE, Trabalhadores.NUMERO_UTENTE_INDEX ); + FIELD_INDEXES.put( Trabalhadores.NUMERO_UTENTE_FULL, Trabalhadores.NUMERO_UTENTE_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PROCESSO_MOTIVO_ID, Trabalhadores.PROCESSO_MOTIVO_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PROCESSO_MOTIVO_ID_FULL, Trabalhadores.PROCESSO_MOTIVO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( Trabalhadores.CLASS_IDENTIFIER, Trabalhadores.PESSOA_ID, Trabalhadores.TO_PESSOA_ID ); + FIELD_INDEXES.put( Trabalhadores.PESSOA_ID, Trabalhadores.PESSOA_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.PESSOA_ID_FULL, Trabalhadores.PESSOA_ID_INDEX ); + FIELD_INDEXES.put( Trabalhadores.TO_PESSOA_ID, Trabalhadores.TO_PESSOA_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyestabelecimento_idToestabelecimentos = + new com.evolute.entity.ForeignKey( Trabalhadores.class, Trabalhadores.ESTABELECIMENTO_ID, db.data.siprp_local.outer.EstabelecimentosData.class, db.data.siprp_local.outer.EstabelecimentosData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeypessoa_idToevo_pessoa = + new com.evolute.entity.ForeignKey( Trabalhadores.class, Trabalhadores.PESSOA_ID, db.data.siprp_local.outer.EvoPessoaData.class, db.data.siprp_local.outer.EvoPessoaData.ID ); + + public static final String TABLENAME = "trabalhadores"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores.id"; + public static final int ID_INDEX = 0; + public static final String NOME = "nome"; + public static final String NOME_FULL = "trabalhadores.nome"; + public static final int NOME_INDEX = 1; + public static final String SEXO = "sexo"; + public static final String SEXO_FULL = "trabalhadores.sexo"; + public static final int SEXO_INDEX = 2; + public static final String DATA_NASCIMENTO = "data_nascimento"; + public static final String DATA_NASCIMENTO_FULL = "trabalhadores.data_nascimento"; + public static final int DATA_NASCIMENTO_INDEX = 3; + public static final String NACIONALIDADE = "nacionalidade"; + public static final String NACIONALIDADE_FULL = "trabalhadores.nacionalidade"; + public static final int NACIONALIDADE_INDEX = 4; + public static final String NUMERO_MECANOGRAFICO = "numero_mecanografico"; + public static final String NUMERO_MECANOGRAFICO_FULL = "trabalhadores.numero_mecanografico"; + public static final int NUMERO_MECANOGRAFICO_INDEX = 5; + public static final String DATA_ADMISSAO = "data_admissao"; + public static final String DATA_ADMISSAO_FULL = "trabalhadores.data_admissao"; + public static final int DATA_ADMISSAO_INDEX = 6; + public static final String CATEGORIA = "categoria"; + public static final String CATEGORIA_FULL = "trabalhadores.categoria"; + public static final int CATEGORIA_INDEX = 7; + public static final String LOCAL_TRABALHO = "local_trabalho"; + public static final String LOCAL_TRABALHO_FULL = "trabalhadores.local_trabalho"; + public static final int LOCAL_TRABALHO_INDEX = 8; + public static final String FUNCAO_PROPOSTA = "funcao_proposta"; + public static final String FUNCAO_PROPOSTA_FULL = "trabalhadores.funcao_proposta"; + public static final int FUNCAO_PROPOSTA_INDEX = 9; + public static final String DATA_ADMISSAO_FUNCAO = "data_admissao_funcao"; + public static final String DATA_ADMISSAO_FUNCAO_FULL = "trabalhadores.data_admissao_funcao"; + public static final int DATA_ADMISSAO_FUNCAO_INDEX = 10; + public static final String OBSERVACOES = "observacoes"; + public static final String OBSERVACOES_FULL = "trabalhadores.observacoes"; + public static final int OBSERVACOES_INDEX = 11; + public static final String INACTIVO = "inactivo"; + public static final String INACTIVO_FULL = "trabalhadores.inactivo"; + public static final int INACTIVO_INDEX = 12; + public static final String ESTABELECIMENTO_ID = "estabelecimento_id"; + public static final String ESTABELECIMENTO_ID_FULL = "trabalhadores.estabelecimento_id"; + public static final int ESTABELECIMENTO_ID_INDEX = 13; + public static final String TO_ESTABELECIMENTO_ID = "to_estabelecimento_id"; + public static final String TO_ESTABELECIMENTO_ID_FULL = "trabalhadores.to_estabelecimento_id"; + public static final int TO_ESTABELECIMENTO_ID_INDEX = 14; + public static final String DATA_DEMISSAO = "data_demissao"; + public static final String DATA_DEMISSAO_FULL = "trabalhadores.data_demissao"; + public static final int DATA_DEMISSAO_INDEX = 15; + public static final String OBSERVACOES_GESTAO = "observacoes_gestao"; + public static final String OBSERVACOES_GESTAO_FULL = "trabalhadores.observacoes_gestao"; + public static final int OBSERVACOES_GESTAO_INDEX = 16; + public static final String PERFIL = "perfil"; + public static final String PERFIL_FULL = "trabalhadores.perfil"; + public static final int PERFIL_INDEX = 17; + public static final String ACTUALIZACAO = "actualizacao"; + public static final String ACTUALIZACAO_FULL = "trabalhadores.actualizacao"; + public static final int ACTUALIZACAO_INDEX = 18; + public static final String NOME_PLAIN = "nome_plain"; + public static final String NOME_PLAIN_FULL = "trabalhadores.nome_plain"; + public static final int NOME_PLAIN_INDEX = 19; + public static final String BI = "bi"; + public static final String BI_FULL = "trabalhadores.bi"; + public static final int BI_INDEX = 20; + public static final String NIF = "nif"; + public static final String NIF_FULL = "trabalhadores.nif"; + public static final int NIF_INDEX = 21; + public static final String NUMERO_UTENTE = "numero_utente"; + public static final String NUMERO_UTENTE_FULL = "trabalhadores.numero_utente"; + public static final int NUMERO_UTENTE_INDEX = 22; + public static final String PROCESSO_MOTIVO_ID = "processo_motivo_id"; + public static final String PROCESSO_MOTIVO_ID_FULL = "trabalhadores.processo_motivo_id"; + public static final int PROCESSO_MOTIVO_ID_INDEX = 23; + public static final String PESSOA_ID = "pessoa_id"; + public static final String PESSOA_ID_FULL = "trabalhadores.pessoa_id"; + public static final int PESSOA_ID_INDEX = 24; + public static final String TO_PESSOA_ID = "to_pessoa_id"; + public static final String TO_PESSOA_ID_FULL = "trabalhadores.to_pessoa_id"; + public static final int TO_PESSOA_ID_INDEX = 25; + + public static final String FIELD_NAMES[] = new String[]{ + NOME, SEXO, DATA_NASCIMENTO, NACIONALIDADE, NUMERO_MECANOGRAFICO, DATA_ADMISSAO, + CATEGORIA, LOCAL_TRABALHO, FUNCAO_PROPOSTA, DATA_ADMISSAO_FUNCAO, OBSERVACOES, + INACTIVO, ESTABELECIMENTO_ID, TO_ESTABELECIMENTO_ID, DATA_DEMISSAO, + OBSERVACOES_GESTAO, PERFIL, ACTUALIZACAO, NOME_PLAIN, BI, NIF, NUMERO_UTENTE, + PROCESSO_MOTIVO_ID, PESSOA_ID, TO_PESSOA_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + NOME, TABLENAME + "." + SEXO, TABLENAME + "." + DATA_NASCIMENTO, TABLENAME + "." + NACIONALIDADE, TABLENAME + "." + NUMERO_MECANOGRAFICO, TABLENAME + "." + DATA_ADMISSAO, + TABLENAME + "." + CATEGORIA, TABLENAME + "." + LOCAL_TRABALHO, TABLENAME + "." + FUNCAO_PROPOSTA, TABLENAME + "." + DATA_ADMISSAO_FUNCAO, TABLENAME + "." + OBSERVACOES, + TABLENAME + "." + INACTIVO, TABLENAME + "." + ESTABELECIMENTO_ID, TABLENAME + "." + TO_ESTABELECIMENTO_ID, TABLENAME + "." + DATA_DEMISSAO, + TABLENAME + "." + OBSERVACOES_GESTAO, TABLENAME + "." + PERFIL, TABLENAME + "." + ACTUALIZACAO, TABLENAME + "." + NOME_PLAIN, TABLENAME + "." + BI, TABLENAME + "." + NIF, TABLENAME + "." + NUMERO_UTENTE, + TABLENAME + "." + PROCESSO_MOTIVO_ID, TABLENAME + "." + PESSOA_ID, TABLENAME + "." + TO_PESSOA_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, NOME, SEXO, DATA_NASCIMENTO, NACIONALIDADE, NUMERO_MECANOGRAFICO, + DATA_ADMISSAO, CATEGORIA, LOCAL_TRABALHO, FUNCAO_PROPOSTA, + DATA_ADMISSAO_FUNCAO, OBSERVACOES, INACTIVO, ESTABELECIMENTO_ID, DATA_DEMISSAO, + OBSERVACOES_GESTAO, PERFIL, ACTUALIZACAO, NOME_PLAIN, BI, NIF, NUMERO_UTENTE, + PROCESSO_MOTIVO_ID, PESSOA_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, NOME, SEXO, DATA_NASCIMENTO, NACIONALIDADE, NUMERO_MECANOGRAFICO, + DATA_ADMISSAO, CATEGORIA, LOCAL_TRABALHO, FUNCAO_PROPOSTA, + DATA_ADMISSAO_FUNCAO, OBSERVACOES, INACTIVO, ESTABELECIMENTO_ID, DATA_DEMISSAO, + OBSERVACOES_GESTAO, PERFIL, ACTUALIZACAO, NOME_PLAIN, BI, NIF, NUMERO_UTENTE, + PROCESSO_MOTIVO_ID, PESSOA_ID, }; + + private Integer id; + private String nome; + private String sexo; + private java.util.Date data_nascimento; + private String nacionalidade; + private String numero_mecanografico; + private java.util.Date data_admissao; + private String categoria; + private String local_trabalho; + private String funcao_proposta; + private java.util.Date data_admissao_funcao; + private String observacoes; + private String inactivo; + private Integer estabelecimento_id; + private db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id; + private java.util.Date data_demissao; + private String observacoes_gestao; + private Integer perfil; + private java.sql.Timestamp actualizacao; + private String nome_plain; + private String bi; + private String nif; + private String numero_utente; + private Integer processo_motivo_id; + private Integer pessoa_id; + private db.data.siprp_local.outer.EvoPessoaData to_pessoa_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Trabalhadores() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false, false, + false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromAvisos_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.AvisosData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromExames_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.ExamesData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromLembretes_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromMarcacoesTrabalhador_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.MarcacoesTrabalhadorData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresConsultas_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcds_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresProcesso_trabalhador_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresProcessoData.class , getPrimaryKey().getMap().get("id"), "trabalhador_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public String getNome() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome; + } + + public void setNome( String nome ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME, nome ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome = nome; + LAZY_LOADED_OBJECTS.put( NOME, Boolean.TRUE ); + } + + public String getSexo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SEXO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.sexo; + } + + public void setSexo( String sexo ) + { + try + { + setLockedForRefresh( true ); + preProcess( SEXO, sexo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.sexo = sexo; + LAZY_LOADED_OBJECTS.put( SEXO, Boolean.TRUE ); + } + + public java.util.Date getData_nascimento() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_NASCIMENTO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_nascimento; + } + + public void setData_nascimento( java.util.Date data_nascimento ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_NASCIMENTO, data_nascimento ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_nascimento = data_nascimento; + LAZY_LOADED_OBJECTS.put( DATA_NASCIMENTO, Boolean.TRUE ); + } + + public String getNacionalidade() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NACIONALIDADE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nacionalidade; + } + + public void setNacionalidade( String nacionalidade ) + { + try + { + setLockedForRefresh( true ); + preProcess( NACIONALIDADE, nacionalidade ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nacionalidade = nacionalidade; + LAZY_LOADED_OBJECTS.put( NACIONALIDADE, Boolean.TRUE ); + } + + public String getNumero_mecanografico() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_MECANOGRAFICO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_mecanografico; + } + + public void setNumero_mecanografico( String numero_mecanografico ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_MECANOGRAFICO, numero_mecanografico ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_mecanografico = numero_mecanografico; + LAZY_LOADED_OBJECTS.put( NUMERO_MECANOGRAFICO, Boolean.TRUE ); + } + + public java.util.Date getData_admissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ADMISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_admissao; + } + + public void setData_admissao( java.util.Date data_admissao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ADMISSAO, data_admissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_admissao = data_admissao; + LAZY_LOADED_OBJECTS.put( DATA_ADMISSAO, Boolean.TRUE ); + } + + public String getCategoria() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CATEGORIA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.categoria; + } + + public void setCategoria( String categoria ) + { + try + { + setLockedForRefresh( true ); + preProcess( CATEGORIA, categoria ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.categoria = categoria; + LAZY_LOADED_OBJECTS.put( CATEGORIA, Boolean.TRUE ); + } + + public String getLocal_trabalho() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( LOCAL_TRABALHO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.local_trabalho; + } + + public void setLocal_trabalho( String local_trabalho ) + { + try + { + setLockedForRefresh( true ); + preProcess( LOCAL_TRABALHO, local_trabalho ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.local_trabalho = local_trabalho; + LAZY_LOADED_OBJECTS.put( LOCAL_TRABALHO, Boolean.TRUE ); + } + + public String getFuncao_proposta() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( FUNCAO_PROPOSTA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.funcao_proposta; + } + + public void setFuncao_proposta( String funcao_proposta ) + { + try + { + setLockedForRefresh( true ); + preProcess( FUNCAO_PROPOSTA, funcao_proposta ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.funcao_proposta = funcao_proposta; + LAZY_LOADED_OBJECTS.put( FUNCAO_PROPOSTA, Boolean.TRUE ); + } + + public java.util.Date getData_admissao_funcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ADMISSAO_FUNCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_admissao_funcao; + } + + public void setData_admissao_funcao( java.util.Date data_admissao_funcao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ADMISSAO_FUNCAO, data_admissao_funcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_admissao_funcao = data_admissao_funcao; + LAZY_LOADED_OBJECTS.put( DATA_ADMISSAO_FUNCAO, Boolean.TRUE ); + } + + public String getObservacoes() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes; + } + + public void setObservacoes( String observacoes ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACOES, observacoes ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes = observacoes; + LAZY_LOADED_OBJECTS.put( OBSERVACOES, Boolean.TRUE ); + } + + public String getInactivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( INACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.inactivo; + } + + public void setInactivo( String inactivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( INACTIVO, inactivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.inactivo = inactivo; + LAZY_LOADED_OBJECTS.put( INACTIVO, Boolean.TRUE ); + } + + public Integer getEstabelecimento_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTABELECIMENTO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estabelecimento_id; + } + + public void setEstabelecimento_id( Integer estabelecimento_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTABELECIMENTO_ID, estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estabelecimento_id = estabelecimento_id; + LAZY_LOADED_OBJECTS.put( ESTABELECIMENTO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EstabelecimentosData toEstabelecimento_id() + { + try + { + prepare( TO_ESTABELECIMENTO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_estabelecimento_id; + } + + public void setToEstabelecimento_id( db.data.siprp_local.outer.EstabelecimentosData to_estabelecimento_id ) + { + try + { + preProcess( TO_ESTABELECIMENTO_ID, to_estabelecimento_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_estabelecimento_id = to_estabelecimento_id; + } + + public java.util.Date getData_demissao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_DEMISSAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_demissao; + } + + public void setData_demissao( java.util.Date data_demissao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_DEMISSAO, data_demissao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_demissao = data_demissao; + LAZY_LOADED_OBJECTS.put( DATA_DEMISSAO, Boolean.TRUE ); + } + + public String getObservacoes_gestao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACOES_GESTAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacoes_gestao; + } + + public void setObservacoes_gestao( String observacoes_gestao ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACOES_GESTAO, observacoes_gestao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacoes_gestao = observacoes_gestao; + LAZY_LOADED_OBJECTS.put( OBSERVACOES_GESTAO, Boolean.TRUE ); + } + + public Integer getPerfil() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PERFIL ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.perfil; + } + + public void setPerfil( Integer perfil ) + { + try + { + setLockedForRefresh( true ); + preProcess( PERFIL, perfil ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.perfil = perfil; + LAZY_LOADED_OBJECTS.put( PERFIL, Boolean.TRUE ); + } + + public java.sql.Timestamp getActualizacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTUALIZACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.actualizacao; + } + + public void setActualizacao( java.sql.Timestamp actualizacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTUALIZACAO, actualizacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.actualizacao = actualizacao; + LAZY_LOADED_OBJECTS.put( ACTUALIZACAO, Boolean.TRUE ); + } + + public String getNome_plain() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NOME_PLAIN ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nome_plain; + } + + public void setNome_plain( String nome_plain ) + { + try + { + setLockedForRefresh( true ); + preProcess( NOME_PLAIN, nome_plain ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nome_plain = nome_plain; + LAZY_LOADED_OBJECTS.put( NOME_PLAIN, Boolean.TRUE ); + } + + public String getBi() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( BI ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.bi; + } + + public void setBi( String bi ) + { + try + { + setLockedForRefresh( true ); + preProcess( BI, bi ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.bi = bi; + LAZY_LOADED_OBJECTS.put( BI, Boolean.TRUE ); + } + + public String getNif() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NIF ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.nif; + } + + public void setNif( String nif ) + { + try + { + setLockedForRefresh( true ); + preProcess( NIF, nif ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.nif = nif; + LAZY_LOADED_OBJECTS.put( NIF, Boolean.TRUE ); + } + + public String getNumero_utente() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( NUMERO_UTENTE ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.numero_utente; + } + + public void setNumero_utente( String numero_utente ) + { + try + { + setLockedForRefresh( true ); + preProcess( NUMERO_UTENTE, numero_utente ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.numero_utente = numero_utente; + LAZY_LOADED_OBJECTS.put( NUMERO_UTENTE, Boolean.TRUE ); + } + + public Integer getProcesso_motivo_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROCESSO_MOTIVO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.processo_motivo_id; + } + + public void setProcesso_motivo_id( Integer processo_motivo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROCESSO_MOTIVO_ID, processo_motivo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.processo_motivo_id = processo_motivo_id; + LAZY_LOADED_OBJECTS.put( PROCESSO_MOTIVO_ID, Boolean.TRUE ); + } + + public Integer getPessoa_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PESSOA_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.pessoa_id; + } + + public void setPessoa_id( Integer pessoa_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PESSOA_ID, pessoa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.pessoa_id = pessoa_id; + LAZY_LOADED_OBJECTS.put( PESSOA_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EvoPessoaData toPessoa_id() + { + try + { + prepare( TO_PESSOA_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_pessoa_id; + } + + public void setToPessoa_id( db.data.siprp_local.outer.EvoPessoaData to_pessoa_id ) + { + try + { + preProcess( TO_PESSOA_ID, to_pessoa_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_pessoa_id = to_pessoa_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + value = getId(); + break; + case Trabalhadores.NOME_INDEX: + value = getNome(); + break; + case Trabalhadores.SEXO_INDEX: + value = getSexo(); + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + value = getData_nascimento(); + break; + case Trabalhadores.NACIONALIDADE_INDEX: + value = getNacionalidade(); + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + value = getNumero_mecanografico(); + break; + case Trabalhadores.DATA_ADMISSAO_INDEX: + value = getData_admissao(); + break; + case Trabalhadores.CATEGORIA_INDEX: + value = getCategoria(); + break; + case Trabalhadores.LOCAL_TRABALHO_INDEX: + value = getLocal_trabalho(); + break; + case Trabalhadores.FUNCAO_PROPOSTA_INDEX: + value = getFuncao_proposta(); + break; + case Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX: + value = getData_admissao_funcao(); + break; + case Trabalhadores.OBSERVACOES_INDEX: + value = getObservacoes(); + break; + case Trabalhadores.INACTIVO_INDEX: + value = getInactivo(); + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + value = getEstabelecimento_id(); + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + value = toEstabelecimento_id(); + break; + case Trabalhadores.DATA_DEMISSAO_INDEX: + value = getData_demissao(); + break; + case Trabalhadores.OBSERVACOES_GESTAO_INDEX: + value = getObservacoes_gestao(); + break; + case Trabalhadores.PERFIL_INDEX: + value = getPerfil(); + break; + case Trabalhadores.ACTUALIZACAO_INDEX: + value = getActualizacao(); + break; + case Trabalhadores.NOME_PLAIN_INDEX: + value = getNome_plain(); + break; + case Trabalhadores.BI_INDEX: + value = getBi(); + break; + case Trabalhadores.NIF_INDEX: + value = getNif(); + break; + case Trabalhadores.NUMERO_UTENTE_INDEX: + value = getNumero_utente(); + break; + case Trabalhadores.PROCESSO_MOTIVO_ID_INDEX: + value = getProcesso_motivo_id(); + break; + case Trabalhadores.PESSOA_ID_INDEX: + value = getPessoa_id(); + break; + case Trabalhadores.TO_PESSOA_ID_INDEX: + value = toPessoa_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + value = this.id; + break; + case Trabalhadores.NOME_INDEX: + value = this.nome; + break; + case Trabalhadores.SEXO_INDEX: + value = this.sexo; + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + value = this.data_nascimento; + break; + case Trabalhadores.NACIONALIDADE_INDEX: + value = this.nacionalidade; + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + value = this.numero_mecanografico; + break; + case Trabalhadores.DATA_ADMISSAO_INDEX: + value = this.data_admissao; + break; + case Trabalhadores.CATEGORIA_INDEX: + value = this.categoria; + break; + case Trabalhadores.LOCAL_TRABALHO_INDEX: + value = this.local_trabalho; + break; + case Trabalhadores.FUNCAO_PROPOSTA_INDEX: + value = this.funcao_proposta; + break; + case Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX: + value = this.data_admissao_funcao; + break; + case Trabalhadores.OBSERVACOES_INDEX: + value = this.observacoes; + break; + case Trabalhadores.INACTIVO_INDEX: + value = this.inactivo; + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + value = this.estabelecimento_id; + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + value = this.to_estabelecimento_id; + break; + case Trabalhadores.DATA_DEMISSAO_INDEX: + value = this.data_demissao; + break; + case Trabalhadores.OBSERVACOES_GESTAO_INDEX: + value = this.observacoes_gestao; + break; + case Trabalhadores.PERFIL_INDEX: + value = this.perfil; + break; + case Trabalhadores.ACTUALIZACAO_INDEX: + value = this.actualizacao; + break; + case Trabalhadores.NOME_PLAIN_INDEX: + value = this.nome_plain; + break; + case Trabalhadores.BI_INDEX: + value = this.bi; + break; + case Trabalhadores.NIF_INDEX: + value = this.nif; + break; + case Trabalhadores.NUMERO_UTENTE_INDEX: + value = this.numero_utente; + break; + case Trabalhadores.PROCESSO_MOTIVO_ID_INDEX: + value = this.processo_motivo_id; + break; + case Trabalhadores.PESSOA_ID_INDEX: + value = this.pessoa_id; + break; + case Trabalhadores.TO_PESSOA_ID_INDEX: + value = this.to_pessoa_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + setId( ( Integer ) value ); + break; + case Trabalhadores.NOME_INDEX: + setNome( ( String ) value ); + break; + case Trabalhadores.SEXO_INDEX: + setSexo( ( String ) value ); + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + setData_nascimento( ( java.util.Date ) value ); + break; + case Trabalhadores.NACIONALIDADE_INDEX: + setNacionalidade( ( String ) value ); + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + setNumero_mecanografico( ( String ) value ); + break; + case Trabalhadores.DATA_ADMISSAO_INDEX: + setData_admissao( ( java.util.Date ) value ); + break; + case Trabalhadores.CATEGORIA_INDEX: + setCategoria( ( String ) value ); + break; + case Trabalhadores.LOCAL_TRABALHO_INDEX: + setLocal_trabalho( ( String ) value ); + break; + case Trabalhadores.FUNCAO_PROPOSTA_INDEX: + setFuncao_proposta( ( String ) value ); + break; + case Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX: + setData_admissao_funcao( ( java.util.Date ) value ); + break; + case Trabalhadores.OBSERVACOES_INDEX: + setObservacoes( ( String ) value ); + break; + case Trabalhadores.INACTIVO_INDEX: + setInactivo( ( String ) value ); + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + setEstabelecimento_id( ( Integer ) value ); + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + setToEstabelecimento_id( ( db.data.siprp_local.outer.EstabelecimentosData ) value ); + break; + case Trabalhadores.DATA_DEMISSAO_INDEX: + setData_demissao( ( java.util.Date ) value ); + break; + case Trabalhadores.OBSERVACOES_GESTAO_INDEX: + setObservacoes_gestao( ( String ) value ); + break; + case Trabalhadores.PERFIL_INDEX: + setPerfil( ( Integer ) value ); + break; + case Trabalhadores.ACTUALIZACAO_INDEX: + setActualizacao( ( java.sql.Timestamp ) value ); + break; + case Trabalhadores.NOME_PLAIN_INDEX: + setNome_plain( ( String ) value ); + break; + case Trabalhadores.BI_INDEX: + setBi( ( String ) value ); + break; + case Trabalhadores.NIF_INDEX: + setNif( ( String ) value ); + break; + case Trabalhadores.NUMERO_UTENTE_INDEX: + setNumero_utente( ( String ) value ); + break; + case Trabalhadores.PROCESSO_MOTIVO_ID_INDEX: + setProcesso_motivo_id( ( Integer ) value ); + break; + case Trabalhadores.PESSOA_ID_INDEX: + setPessoa_id( ( Integer ) value ); + break; + case Trabalhadores.TO_PESSOA_ID_INDEX: + setToPessoa_id( ( db.data.siprp_local.outer.EvoPessoaData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Trabalhadores.ID_INDEX: + this.id = ( Integer ) value; + break; + case Trabalhadores.NOME_INDEX: + this.nome = ( String ) value; + break; + case Trabalhadores.SEXO_INDEX: + this.sexo = ( String ) value; + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + this.data_nascimento = ( java.util.Date ) value; + break; + case Trabalhadores.NACIONALIDADE_INDEX: + this.nacionalidade = ( String ) value; + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + this.numero_mecanografico = ( String ) value; + break; + case Trabalhadores.DATA_ADMISSAO_INDEX: + this.data_admissao = ( java.util.Date ) value; + break; + case Trabalhadores.CATEGORIA_INDEX: + this.categoria = ( String ) value; + break; + case Trabalhadores.LOCAL_TRABALHO_INDEX: + this.local_trabalho = ( String ) value; + break; + case Trabalhadores.FUNCAO_PROPOSTA_INDEX: + this.funcao_proposta = ( String ) value; + break; + case Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX: + this.data_admissao_funcao = ( java.util.Date ) value; + break; + case Trabalhadores.OBSERVACOES_INDEX: + this.observacoes = ( String ) value; + break; + case Trabalhadores.INACTIVO_INDEX: + this.inactivo = ( String ) value; + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + this.estabelecimento_id = ( Integer ) value; + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + this.to_estabelecimento_id = ( db.data.siprp_local.outer.EstabelecimentosData ) value; + break; + case Trabalhadores.DATA_DEMISSAO_INDEX: + this.data_demissao = ( java.util.Date ) value; + break; + case Trabalhadores.OBSERVACOES_GESTAO_INDEX: + this.observacoes_gestao = ( String ) value; + break; + case Trabalhadores.PERFIL_INDEX: + this.perfil = ( Integer ) value; + break; + case Trabalhadores.ACTUALIZACAO_INDEX: + this.actualizacao = ( java.sql.Timestamp ) value; + break; + case Trabalhadores.NOME_PLAIN_INDEX: + this.nome_plain = ( String ) value; + break; + case Trabalhadores.BI_INDEX: + this.bi = ( String ) value; + break; + case Trabalhadores.NIF_INDEX: + this.nif = ( String ) value; + break; + case Trabalhadores.NUMERO_UTENTE_INDEX: + this.numero_utente = ( String ) value; + break; + case Trabalhadores.PROCESSO_MOTIVO_ID_INDEX: + this.processo_motivo_id = ( Integer ) value; + break; + case Trabalhadores.PESSOA_ID_INDEX: + this.pessoa_id = ( Integer ) value; + break; + case Trabalhadores.TO_PESSOA_ID_INDEX: + this.to_pessoa_id = ( db.data.siprp_local.outer.EvoPessoaData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Trabalhadores.ID_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.NOME_INDEX: + theClass = String.class; + break; + case Trabalhadores.SEXO_INDEX: + theClass = String.class; + break; + case Trabalhadores.DATA_NASCIMENTO_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.NACIONALIDADE_INDEX: + theClass = String.class; + break; + case Trabalhadores.NUMERO_MECANOGRAFICO_INDEX: + theClass = String.class; + break; + case Trabalhadores.DATA_ADMISSAO_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.CATEGORIA_INDEX: + theClass = String.class; + break; + case Trabalhadores.LOCAL_TRABALHO_INDEX: + theClass = String.class; + break; + case Trabalhadores.FUNCAO_PROPOSTA_INDEX: + theClass = String.class; + break; + case Trabalhadores.DATA_ADMISSAO_FUNCAO_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.OBSERVACOES_INDEX: + theClass = String.class; + break; + case Trabalhadores.INACTIVO_INDEX: + theClass = String.class; + break; + case Trabalhadores.ESTABELECIMENTO_ID_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.TO_ESTABELECIMENTO_ID_INDEX: + theClass = db.data.siprp_local.outer.EstabelecimentosData.class; + break; + case Trabalhadores.DATA_DEMISSAO_INDEX: + theClass = java.util.Date.class; + break; + case Trabalhadores.OBSERVACOES_GESTAO_INDEX: + theClass = String.class; + break; + case Trabalhadores.PERFIL_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.ACTUALIZACAO_INDEX: + theClass = java.sql.Timestamp.class; + break; + case Trabalhadores.NOME_PLAIN_INDEX: + theClass = String.class; + break; + case Trabalhadores.BI_INDEX: + theClass = String.class; + break; + case Trabalhadores.NIF_INDEX: + theClass = String.class; + break; + case Trabalhadores.NUMERO_UTENTE_INDEX: + theClass = String.class; + break; + case Trabalhadores.PROCESSO_MOTIVO_ID_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.PESSOA_ID_INDEX: + theClass = Integer.class; + break; + case Trabalhadores.TO_PESSOA_ID_INDEX: + theClass = db.data.siprp_local.outer.EvoPessoaData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Trabalhadores._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Trabalhadores.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultas.java new file mode 100644 index 00000000..3b0710c4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultas.java @@ -0,0 +1,647 @@ +/* +* TrabalhadoresConsultas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresConsultas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresConsultas.ID, TrabalhadoresConsultas.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.ID_FULL, TrabalhadoresConsultas.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultas.CLASS_IDENTIFIER, TrabalhadoresConsultas.TRABALHADOR_ID, TrabalhadoresConsultas.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultas.TRABALHADOR_ID, TrabalhadoresConsultas.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.TRABALHADOR_ID_FULL, TrabalhadoresConsultas.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.TO_TRABALHADOR_ID, TrabalhadoresConsultas.TO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.DATA, TrabalhadoresConsultas.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.DATA_FULL, TrabalhadoresConsultas.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.ESTADO, TrabalhadoresConsultas.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.ESTADO_FULL, TrabalhadoresConsultas.ESTADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultas.CLASS_IDENTIFIER, TrabalhadoresConsultas.PRESTADOR_ID, TrabalhadoresConsultas.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultas.PRESTADOR_ID, TrabalhadoresConsultas.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.PRESTADOR_ID_FULL, TrabalhadoresConsultas.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.TO_PRESTADOR_ID, TrabalhadoresConsultas.TO_PRESTADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultas.CLASS_IDENTIFIER, TrabalhadoresConsultas.PROCESSO_ID, TrabalhadoresConsultas.TO_PROCESSO_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultas.PROCESSO_ID, TrabalhadoresConsultas.PROCESSO_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.PROCESSO_ID_FULL, TrabalhadoresConsultas.PROCESSO_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultas.TO_PROCESSO_ID, TrabalhadoresConsultas.TO_PROCESSO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultas.class, TrabalhadoresConsultas.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultas.class, TrabalhadoresConsultas.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprocesso_idTotrabalhadores_processo = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultas.class, TrabalhadoresConsultas.PROCESSO_ID, db.data.siprp_local.outer.TrabalhadoresProcessoData.class, db.data.siprp_local.outer.TrabalhadoresProcessoData.ID ); + + public static final String TABLENAME = "trabalhadores_consultas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_consultas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_consultas.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "trabalhadores_consultas.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 1; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "trabalhadores_consultas.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 2; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_consultas.data"; + public static final int DATA_INDEX = 3; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "trabalhadores_consultas.estado"; + public static final int ESTADO_INDEX = 4; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "trabalhadores_consultas.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 5; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "trabalhadores_consultas.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 6; + public static final String PROCESSO_ID = "processo_id"; + public static final String PROCESSO_ID_FULL = "trabalhadores_consultas.processo_id"; + public static final int PROCESSO_ID_INDEX = 7; + public static final String TO_PROCESSO_ID = "to_processo_id"; + public static final String TO_PROCESSO_ID_FULL = "trabalhadores_consultas.to_processo_id"; + public static final int TO_PROCESSO_ID_INDEX = 8; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADOR_ID, TO_TRABALHADOR_ID, DATA, ESTADO, PRESTADOR_ID, TO_PRESTADOR_ID, + PROCESSO_ID, TO_PROCESSO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + DATA, TABLENAME + "." + ESTADO, TABLENAME + "." + PRESTADOR_ID, TABLENAME + "." + TO_PRESTADOR_ID, + TABLENAME + "." + PROCESSO_ID, TABLENAME + "." + TO_PROCESSO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADOR_ID, DATA, ESTADO, PRESTADOR_ID, PROCESSO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADOR_ID, DATA, ESTADO, PRESTADOR_ID, PROCESSO_ID, }; + + private Integer id; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private java.util.Date data; + private Integer estado; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + private Integer processo_id; + private db.data.siprp_local.outer.TrabalhadoresProcessoData to_processo_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresConsultas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromTrabalhadoresConsultasDatas_trabalhadores_consultas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_consultas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Integer getProcesso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROCESSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.processo_id; + } + + public void setProcesso_id( Integer processo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROCESSO_ID, processo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.processo_id = processo_id; + LAZY_LOADED_OBJECTS.put( PROCESSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresProcessoData toProcesso_id() + { + try + { + prepare( TO_PROCESSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_processo_id; + } + + public void setToProcesso_id( db.data.siprp_local.outer.TrabalhadoresProcessoData to_processo_id ) + { + try + { + preProcess( TO_PROCESSO_ID, to_processo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_processo_id = to_processo_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultas.ID_INDEX: + value = getId(); + break; + case TrabalhadoresConsultas.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case TrabalhadoresConsultas.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case TrabalhadoresConsultas.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresConsultas.ESTADO_INDEX: + value = getEstado(); + break; + case TrabalhadoresConsultas.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case TrabalhadoresConsultas.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + case TrabalhadoresConsultas.PROCESSO_ID_INDEX: + value = getProcesso_id(); + break; + case TrabalhadoresConsultas.TO_PROCESSO_ID_INDEX: + value = toProcesso_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultas.ID_INDEX: + value = this.id; + break; + case TrabalhadoresConsultas.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case TrabalhadoresConsultas.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case TrabalhadoresConsultas.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresConsultas.ESTADO_INDEX: + value = this.estado; + break; + case TrabalhadoresConsultas.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case TrabalhadoresConsultas.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + case TrabalhadoresConsultas.PROCESSO_ID_INDEX: + value = this.processo_id; + break; + case TrabalhadoresConsultas.TO_PROCESSO_ID_INDEX: + value = this.to_processo_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultas.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresConsultas.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case TrabalhadoresConsultas.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case TrabalhadoresConsultas.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresConsultas.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case TrabalhadoresConsultas.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case TrabalhadoresConsultas.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case TrabalhadoresConsultas.PROCESSO_ID_INDEX: + setProcesso_id( ( Integer ) value ); + break; + case TrabalhadoresConsultas.TO_PROCESSO_ID_INDEX: + setToProcesso_id( ( db.data.siprp_local.outer.TrabalhadoresProcessoData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultas.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresConsultas.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case TrabalhadoresConsultas.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case TrabalhadoresConsultas.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresConsultas.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case TrabalhadoresConsultas.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case TrabalhadoresConsultas.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case TrabalhadoresConsultas.PROCESSO_ID_INDEX: + this.processo_id = ( Integer ) value; + break; + case TrabalhadoresConsultas.TO_PROCESSO_ID_INDEX: + this.to_processo_id = ( db.data.siprp_local.outer.TrabalhadoresProcessoData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresConsultas.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultas.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultas.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case TrabalhadoresConsultas.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresConsultas.ESTADO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultas.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultas.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case TrabalhadoresConsultas.PROCESSO_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultas.TO_PROCESSO_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresProcessoData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresConsultas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresConsultas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatas.java new file mode 100644 index 00000000..1436e5b5 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatas.java @@ -0,0 +1,575 @@ +/* +* TrabalhadoresConsultasDatas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresConsultasDatas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.ID, TrabalhadoresConsultasDatas.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.ID_FULL, TrabalhadoresConsultasDatas.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.DATA, TrabalhadoresConsultasDatas.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.DATA_FULL, TrabalhadoresConsultasDatas.DATA_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultasDatas.CLASS_IDENTIFIER, TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID, TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID, TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_FULL, TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID, TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.ESTADO, TrabalhadoresConsultasDatas.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.ESTADO_FULL, TrabalhadoresConsultasDatas.ESTADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultasDatas.CLASS_IDENTIFIER, TrabalhadoresConsultasDatas.PRESTADOR_ID, TrabalhadoresConsultasDatas.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.PRESTADOR_ID, TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.PRESTADOR_ID_FULL, TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatas.TO_PRESTADOR_ID, TrabalhadoresConsultasDatas.TO_PRESTADOR_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_consultas_idTotrabalhadores_consultas = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultasDatas.class, TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID, db.data.siprp_local.outer.TrabalhadoresConsultasData.class, db.data.siprp_local.outer.TrabalhadoresConsultasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultasDatas.class, TrabalhadoresConsultasDatas.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final String TABLENAME = "trabalhadores_consultas_datas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_consultas_datas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_consultas_datas.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_consultas_datas.data"; + public static final int DATA_INDEX = 1; + public static final String TRABALHADORES_CONSULTAS_ID = "trabalhadores_consultas_id"; + public static final String TRABALHADORES_CONSULTAS_ID_FULL = "trabalhadores_consultas_datas.trabalhadores_consultas_id"; + public static final int TRABALHADORES_CONSULTAS_ID_INDEX = 2; + public static final String TO_TRABALHADORES_CONSULTAS_ID = "to_trabalhadores_consultas_id"; + public static final String TO_TRABALHADORES_CONSULTAS_ID_FULL = "trabalhadores_consultas_datas.to_trabalhadores_consultas_id"; + public static final int TO_TRABALHADORES_CONSULTAS_ID_INDEX = 3; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "trabalhadores_consultas_datas.estado"; + public static final int ESTADO_INDEX = 4; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "trabalhadores_consultas_datas.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 5; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "trabalhadores_consultas_datas.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, TRABALHADORES_CONSULTAS_ID, TO_TRABALHADORES_CONSULTAS_ID, ESTADO, + PRESTADOR_ID, TO_PRESTADOR_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + TRABALHADORES_CONSULTAS_ID, TABLENAME + "." + TO_TRABALHADORES_CONSULTAS_ID, TABLENAME + "." + ESTADO, + TABLENAME + "." + PRESTADOR_ID, TABLENAME + "." + TO_PRESTADOR_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, TRABALHADORES_CONSULTAS_ID, ESTADO, PRESTADOR_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, TRABALHADORES_CONSULTAS_ID, ESTADO, PRESTADOR_ID, }; + + private Integer id; + private java.util.Date data; + private Integer trabalhadores_consultas_id; + private db.data.siprp_local.outer.TrabalhadoresConsultasData to_trabalhadores_consultas_id; + private Integer estado; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresConsultasDatas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromLembretes_trabalhadores_consultas_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_consultas_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresConsultasDatasEmails_trabalhadores_consultas_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasDatasEmailsData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_consultas_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresConsultasDatasObservacoes_trabalhadores_consultas_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasDatasObservacoesData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_consultas_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getTrabalhadores_consultas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_CONSULTAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_consultas_id; + } + + public void setTrabalhadores_consultas_id( Integer trabalhadores_consultas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_CONSULTAS_ID, trabalhadores_consultas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_consultas_id = trabalhadores_consultas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_CONSULTAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresConsultasData toTrabalhadores_consultas_id() + { + try + { + prepare( TO_TRABALHADORES_CONSULTAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_consultas_id; + } + + public void setToTrabalhadores_consultas_id( db.data.siprp_local.outer.TrabalhadoresConsultasData to_trabalhadores_consultas_id ) + { + try + { + preProcess( TO_TRABALHADORES_CONSULTAS_ID, to_trabalhadores_consultas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_consultas_id = to_trabalhadores_consultas_id; + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatas.ID_INDEX: + value = getId(); + break; + case TrabalhadoresConsultasDatas.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX: + value = getTrabalhadores_consultas_id(); + break; + case TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID_INDEX: + value = toTrabalhadores_consultas_id(); + break; + case TrabalhadoresConsultasDatas.ESTADO_INDEX: + value = getEstado(); + break; + case TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case TrabalhadoresConsultasDatas.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatas.ID_INDEX: + value = this.id; + break; + case TrabalhadoresConsultasDatas.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX: + value = this.trabalhadores_consultas_id; + break; + case TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID_INDEX: + value = this.to_trabalhadores_consultas_id; + break; + case TrabalhadoresConsultasDatas.ESTADO_INDEX: + value = this.estado; + break; + case TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case TrabalhadoresConsultasDatas.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatas.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatas.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX: + setTrabalhadores_consultas_id( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID_INDEX: + setToTrabalhadores_consultas_id( ( db.data.siprp_local.outer.TrabalhadoresConsultasData ) value ); + break; + case TrabalhadoresConsultasDatas.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatas.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatas.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatas.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX: + this.trabalhadores_consultas_id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID_INDEX: + this.to_trabalhadores_consultas_id = ( db.data.siprp_local.outer.TrabalhadoresConsultasData ) value; + break; + case TrabalhadoresConsultasDatas.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatas.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresConsultasDatas.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatas.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresConsultasDatas.TRABALHADORES_CONSULTAS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatas.TO_TRABALHADORES_CONSULTAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresConsultasData.class; + break; + case TrabalhadoresConsultasDatas.ESTADO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatas.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatas.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresConsultasDatas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresConsultasDatas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatasEmails.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatasEmails.java new file mode 100644 index 00000000..1460608b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatasEmails.java @@ -0,0 +1,533 @@ +/* +* TrabalhadoresConsultasDatasEmails.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresConsultasDatasEmails extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.ID, TrabalhadoresConsultasDatasEmails.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.ID_FULL, TrabalhadoresConsultasDatasEmails.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultasDatasEmails.CLASS_IDENTIFIER, TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID, TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID, TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_FULL, TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID, TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.DESTINATION, TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.DESTINATION_FULL, TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.DATA, TrabalhadoresConsultasDatasEmails.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.DATA_FULL, TrabalhadoresConsultasDatasEmails.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.SUBJECT, TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.SUBJECT_FULL, TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.BODY, TrabalhadoresConsultasDatasEmails.BODY_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasEmails.BODY_FULL, TrabalhadoresConsultasDatasEmails.BODY_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_consultas_datas_idTotrabalhadores_consultas_datas = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultasDatasEmails.class, TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class, db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.ID ); + + public static final String TABLENAME = "trabalhadores_consultas_datas_emails"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_consultas_datas_emails"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_consultas_datas_emails.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADORES_CONSULTAS_DATAS_ID = "trabalhadores_consultas_datas_id"; + public static final String TRABALHADORES_CONSULTAS_DATAS_ID_FULL = "trabalhadores_consultas_datas_emails.trabalhadores_consultas_datas_id"; + public static final int TRABALHADORES_CONSULTAS_DATAS_ID_INDEX = 1; + public static final String TO_TRABALHADORES_CONSULTAS_DATAS_ID = "to_trabalhadores_consultas_datas_id"; + public static final String TO_TRABALHADORES_CONSULTAS_DATAS_ID_FULL = "trabalhadores_consultas_datas_emails.to_trabalhadores_consultas_datas_id"; + public static final int TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX = 2; + public static final String DESTINATION = "destination"; + public static final String DESTINATION_FULL = "trabalhadores_consultas_datas_emails.destination"; + public static final int DESTINATION_INDEX = 3; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_consultas_datas_emails.data"; + public static final int DATA_INDEX = 4; + public static final String SUBJECT = "subject"; + public static final String SUBJECT_FULL = "trabalhadores_consultas_datas_emails.subject"; + public static final int SUBJECT_INDEX = 5; + public static final String BODY = "body"; + public static final String BODY_FULL = "trabalhadores_consultas_datas_emails.body"; + public static final int BODY_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADORES_CONSULTAS_DATAS_ID, TO_TRABALHADORES_CONSULTAS_DATAS_ID, + DESTINATION, DATA, SUBJECT, BODY, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADORES_CONSULTAS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_CONSULTAS_DATAS_ID, + TABLENAME + "." + DESTINATION, TABLENAME + "." + DATA, TABLENAME + "." + SUBJECT, TABLENAME + "." + BODY, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADORES_CONSULTAS_DATAS_ID, DESTINATION, DATA, SUBJECT, BODY, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADORES_CONSULTAS_DATAS_ID, DESTINATION, DATA, SUBJECT, BODY, }; + + private Integer id; + private Integer trabalhadores_consultas_datas_id; + private db.data.siprp_local.outer.TrabalhadoresConsultasDatasData to_trabalhadores_consultas_datas_id; + private String destination; + private java.util.Date data; + private String subject; + private String body; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresConsultasDatasEmails() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTrabalhadores_consultas_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_CONSULTAS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_consultas_datas_id; + } + + public void setTrabalhadores_consultas_datas_id( Integer trabalhadores_consultas_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_CONSULTAS_DATAS_ID, trabalhadores_consultas_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_consultas_datas_id = trabalhadores_consultas_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_CONSULTAS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresConsultasDatasData toTrabalhadores_consultas_datas_id() + { + try + { + prepare( TO_TRABALHADORES_CONSULTAS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_consultas_datas_id; + } + + public void setToTrabalhadores_consultas_datas_id( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData to_trabalhadores_consultas_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_CONSULTAS_DATAS_ID, to_trabalhadores_consultas_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_consultas_datas_id = to_trabalhadores_consultas_datas_id; + } + + public String getDestination() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESTINATION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.destination; + } + + public void setDestination( String destination ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESTINATION, destination ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.destination = destination; + LAZY_LOADED_OBJECTS.put( DESTINATION, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getSubject() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SUBJECT ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.subject; + } + + public void setSubject( String subject ) + { + try + { + setLockedForRefresh( true ); + preProcess( SUBJECT, subject ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.subject = subject; + LAZY_LOADED_OBJECTS.put( SUBJECT, Boolean.TRUE ); + } + + public String getBody() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( BODY ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.body; + } + + public void setBody( String body ) + { + try + { + setLockedForRefresh( true ); + preProcess( BODY, body ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.body = body; + LAZY_LOADED_OBJECTS.put( BODY, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasEmails.ID_INDEX: + value = getId(); + break; + case TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = getTrabalhadores_consultas_datas_id(); + break; + case TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = toTrabalhadores_consultas_datas_id(); + break; + case TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX: + value = getDestination(); + break; + case TrabalhadoresConsultasDatasEmails.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX: + value = getSubject(); + break; + case TrabalhadoresConsultasDatasEmails.BODY_INDEX: + value = getBody(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasEmails.ID_INDEX: + value = this.id; + break; + case TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = this.trabalhadores_consultas_datas_id; + break; + case TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = this.to_trabalhadores_consultas_datas_id; + break; + case TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX: + value = this.destination; + break; + case TrabalhadoresConsultasDatasEmails.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX: + value = this.subject; + break; + case TrabalhadoresConsultasDatasEmails.BODY_INDEX: + value = this.body; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasEmails.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + setTrabalhadores_consultas_datas_id( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + setToTrabalhadores_consultas_datas_id( ( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData ) value ); + break; + case TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX: + setDestination( ( String ) value ); + break; + case TrabalhadoresConsultasDatasEmails.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX: + setSubject( ( String ) value ); + break; + case TrabalhadoresConsultasDatasEmails.BODY_INDEX: + setBody( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasEmails.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + this.trabalhadores_consultas_datas_id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + this.to_trabalhadores_consultas_datas_id = ( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData ) value; + break; + case TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX: + this.destination = ( String ) value; + break; + case TrabalhadoresConsultasDatasEmails.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX: + this.subject = ( String ) value; + break; + case TrabalhadoresConsultasDatasEmails.BODY_INDEX: + this.body = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresConsultasDatasEmails.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatasEmails.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatasEmails.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class; + break; + case TrabalhadoresConsultasDatasEmails.DESTINATION_INDEX: + theClass = String.class; + break; + case TrabalhadoresConsultasDatasEmails.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresConsultasDatasEmails.SUBJECT_INDEX: + theClass = String.class; + break; + case TrabalhadoresConsultasDatasEmails.BODY_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresConsultasDatasEmails._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresConsultasDatasEmails.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatasObservacoes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatasObservacoes.java new file mode 100644 index 00000000..ad09fb94 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresConsultasDatasObservacoes.java @@ -0,0 +1,383 @@ +/* +* TrabalhadoresConsultasDatasObservacoes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresConsultasDatasObservacoes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.ID, TrabalhadoresConsultasDatasObservacoes.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.ID_FULL, TrabalhadoresConsultasDatasObservacoes.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresConsultasDatasObservacoes.CLASS_IDENTIFIER, TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID, TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID, TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_FULL, TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID, TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.OBSERVACAO, TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_FULL, TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_consultas_datas_idTotrabalhadores_consultas_datas = + new com.evolute.entity.ForeignKey( TrabalhadoresConsultasDatasObservacoes.class, TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class, db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.ID ); + + public static final String TABLENAME = "trabalhadores_consultas_datas_observacoes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_consultas_datas_observacoes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_consultas_datas_observacoes.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADORES_CONSULTAS_DATAS_ID = "trabalhadores_consultas_datas_id"; + public static final String TRABALHADORES_CONSULTAS_DATAS_ID_FULL = "trabalhadores_consultas_datas_observacoes.trabalhadores_consultas_datas_id"; + public static final int TRABALHADORES_CONSULTAS_DATAS_ID_INDEX = 1; + public static final String TO_TRABALHADORES_CONSULTAS_DATAS_ID = "to_trabalhadores_consultas_datas_id"; + public static final String TO_TRABALHADORES_CONSULTAS_DATAS_ID_FULL = "trabalhadores_consultas_datas_observacoes.to_trabalhadores_consultas_datas_id"; + public static final int TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX = 2; + public static final String OBSERVACAO = "observacao"; + public static final String OBSERVACAO_FULL = "trabalhadores_consultas_datas_observacoes.observacao"; + public static final int OBSERVACAO_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADORES_CONSULTAS_DATAS_ID, TO_TRABALHADORES_CONSULTAS_DATAS_ID, + OBSERVACAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADORES_CONSULTAS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_CONSULTAS_DATAS_ID, + TABLENAME + "." + OBSERVACAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADORES_CONSULTAS_DATAS_ID, OBSERVACAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADORES_CONSULTAS_DATAS_ID, OBSERVACAO, }; + + private Integer id; + private Integer trabalhadores_consultas_datas_id; + private db.data.siprp_local.outer.TrabalhadoresConsultasDatasData to_trabalhadores_consultas_datas_id; + private String observacao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresConsultasDatasObservacoes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTrabalhadores_consultas_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_CONSULTAS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_consultas_datas_id; + } + + public void setTrabalhadores_consultas_datas_id( Integer trabalhadores_consultas_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_CONSULTAS_DATAS_ID, trabalhadores_consultas_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_consultas_datas_id = trabalhadores_consultas_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_CONSULTAS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresConsultasDatasData toTrabalhadores_consultas_datas_id() + { + try + { + prepare( TO_TRABALHADORES_CONSULTAS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_consultas_datas_id; + } + + public void setToTrabalhadores_consultas_datas_id( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData to_trabalhadores_consultas_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_CONSULTAS_DATAS_ID, to_trabalhadores_consultas_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_consultas_datas_id = to_trabalhadores_consultas_datas_id; + } + + public String getObservacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacao; + } + + public void setObservacao( String observacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACAO, observacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacao = observacao; + LAZY_LOADED_OBJECTS.put( OBSERVACAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasObservacoes.ID_INDEX: + value = getId(); + break; + case TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = getTrabalhadores_consultas_datas_id(); + break; + case TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = toTrabalhadores_consultas_datas_id(); + break; + case TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX: + value = getObservacao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasObservacoes.ID_INDEX: + value = this.id; + break; + case TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = this.trabalhadores_consultas_datas_id; + break; + case TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + value = this.to_trabalhadores_consultas_datas_id; + break; + case TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX: + value = this.observacao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasObservacoes.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + setTrabalhadores_consultas_datas_id( ( Integer ) value ); + break; + case TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + setToTrabalhadores_consultas_datas_id( ( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData ) value ); + break; + case TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX: + setObservacao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresConsultasDatasObservacoes.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + this.trabalhadores_consultas_datas_id = ( Integer ) value; + break; + case TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + this.to_trabalhadores_consultas_datas_id = ( db.data.siprp_local.outer.TrabalhadoresConsultasDatasData ) value; + break; + case TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX: + this.observacao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresConsultasDatasObservacoes.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatasObservacoes.TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresConsultasDatasObservacoes.TO_TRABALHADORES_CONSULTAS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresConsultasDatasData.class; + break; + case TrabalhadoresConsultasDatasObservacoes.OBSERVACAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresConsultasDatasObservacoes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresConsultasDatasObservacoes.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcd.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcd.java new file mode 100644 index 00000000..3db97f83 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcd.java @@ -0,0 +1,838 @@ +/* +* TrabalhadoresEcd.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresEcd extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresEcd.ID, TrabalhadoresEcd.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ID_FULL, TrabalhadoresEcd.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcd.CLASS_IDENTIFIER, TrabalhadoresEcd.ECD_ID, TrabalhadoresEcd.TO_ECD_ID ); + FIELD_INDEXES.put( TrabalhadoresEcd.ECD_ID, TrabalhadoresEcd.ECD_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ECD_ID_FULL, TrabalhadoresEcd.ECD_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.TO_ECD_ID, TrabalhadoresEcd.TO_ECD_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcd.CLASS_IDENTIFIER, TrabalhadoresEcd.ECD_OFICIAL_ID, TrabalhadoresEcd.TO_ECD_OFICIAL_ID ); + FIELD_INDEXES.put( TrabalhadoresEcd.ECD_OFICIAL_ID, TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ECD_OFICIAL_ID_FULL, TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.TO_ECD_OFICIAL_ID, TrabalhadoresEcd.TO_ECD_OFICIAL_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ESTADO, TrabalhadoresEcd.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ESTADO_FULL, TrabalhadoresEcd.ESTADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcd.CLASS_IDENTIFIER, TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID ); + FIELD_INDEXES.put( TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_FULL, TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ENVIADO, TrabalhadoresEcd.ENVIADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ENVIADO_FULL, TrabalhadoresEcd.ENVIADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcd.CLASS_IDENTIFIER, TrabalhadoresEcd.ANALISADOR_ID, TrabalhadoresEcd.TO_ANALISADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresEcd.ANALISADOR_ID, TrabalhadoresEcd.ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.ANALISADOR_ID_FULL, TrabalhadoresEcd.ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.TO_ANALISADOR_ID, TrabalhadoresEcd.TO_ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.DATA_ENVIO, TrabalhadoresEcd.DATA_ENVIO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.DATA_ENVIO_FULL, TrabalhadoresEcd.DATA_ENVIO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.DATA_RECEPCAO, TrabalhadoresEcd.DATA_RECEPCAO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcd.DATA_RECEPCAO_FULL, TrabalhadoresEcd.DATA_RECEPCAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyecd_idToprt_tipos_elementos_protocolo = + new com.evolute.entity.ForeignKey( TrabalhadoresEcd.class, TrabalhadoresEcd.ECD_ID, db.data.siprp_local.outer.PrtTiposElementosProtocoloData.class, db.data.siprp_local.outer.PrtTiposElementosProtocoloData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyecd_oficial_idToecd_oficial = + new com.evolute.entity.ForeignKey( TrabalhadoresEcd.class, TrabalhadoresEcd.ECD_OFICIAL_ID, db.data.siprp_local.outer.EcdOficialData.class, db.data.siprp_local.outer.EcdOficialData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_ecds_datas_idTotrabalhadores_ecds_datas = + new com.evolute.entity.ForeignKey( TrabalhadoresEcd.class, TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyanalisador_idToprestadores = + new com.evolute.entity.ForeignKey( TrabalhadoresEcd.class, TrabalhadoresEcd.ANALISADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final String TABLENAME = "trabalhadores_ecd"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_ecd"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_ecd.id"; + public static final int ID_INDEX = 0; + public static final String ECD_ID = "ecd_id"; + public static final String ECD_ID_FULL = "trabalhadores_ecd.ecd_id"; + public static final int ECD_ID_INDEX = 1; + public static final String TO_ECD_ID = "to_ecd_id"; + public static final String TO_ECD_ID_FULL = "trabalhadores_ecd.to_ecd_id"; + public static final int TO_ECD_ID_INDEX = 2; + public static final String ECD_OFICIAL_ID = "ecd_oficial_id"; + public static final String ECD_OFICIAL_ID_FULL = "trabalhadores_ecd.ecd_oficial_id"; + public static final int ECD_OFICIAL_ID_INDEX = 3; + public static final String TO_ECD_OFICIAL_ID = "to_ecd_oficial_id"; + public static final String TO_ECD_OFICIAL_ID_FULL = "trabalhadores_ecd.to_ecd_oficial_id"; + public static final int TO_ECD_OFICIAL_ID_INDEX = 4; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "trabalhadores_ecd.estado"; + public static final int ESTADO_INDEX = 5; + public static final String TRABALHADORES_ECDS_DATAS_ID = "trabalhadores_ecds_datas_id"; + public static final String TRABALHADORES_ECDS_DATAS_ID_FULL = "trabalhadores_ecd.trabalhadores_ecds_datas_id"; + public static final int TRABALHADORES_ECDS_DATAS_ID_INDEX = 6; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID = "to_trabalhadores_ecds_datas_id"; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID_FULL = "trabalhadores_ecd.to_trabalhadores_ecds_datas_id"; + public static final int TO_TRABALHADORES_ECDS_DATAS_ID_INDEX = 7; + public static final String ENVIADO = "enviado"; + public static final String ENVIADO_FULL = "trabalhadores_ecd.enviado"; + public static final int ENVIADO_INDEX = 8; + public static final String ANALISADOR_ID = "analisador_id"; + public static final String ANALISADOR_ID_FULL = "trabalhadores_ecd.analisador_id"; + public static final int ANALISADOR_ID_INDEX = 9; + public static final String TO_ANALISADOR_ID = "to_analisador_id"; + public static final String TO_ANALISADOR_ID_FULL = "trabalhadores_ecd.to_analisador_id"; + public static final int TO_ANALISADOR_ID_INDEX = 10; + public static final String DATA_ENVIO = "data_envio"; + public static final String DATA_ENVIO_FULL = "trabalhadores_ecd.data_envio"; + public static final int DATA_ENVIO_INDEX = 11; + public static final String DATA_RECEPCAO = "data_recepcao"; + public static final String DATA_RECEPCAO_FULL = "trabalhadores_ecd.data_recepcao"; + public static final int DATA_RECEPCAO_INDEX = 12; + + public static final String FIELD_NAMES[] = new String[]{ + ECD_ID, TO_ECD_ID, ECD_OFICIAL_ID, TO_ECD_OFICIAL_ID, ESTADO, + TRABALHADORES_ECDS_DATAS_ID, TO_TRABALHADORES_ECDS_DATAS_ID, ENVIADO, + ANALISADOR_ID, TO_ANALISADOR_ID, DATA_ENVIO, DATA_RECEPCAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + ECD_ID, TABLENAME + "." + TO_ECD_ID, TABLENAME + "." + ECD_OFICIAL_ID, TABLENAME + "." + TO_ECD_OFICIAL_ID, TABLENAME + "." + ESTADO, + TABLENAME + "." + TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + ENVIADO, + TABLENAME + "." + ANALISADOR_ID, TABLENAME + "." + TO_ANALISADOR_ID, TABLENAME + "." + DATA_ENVIO, TABLENAME + "." + DATA_RECEPCAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, ECD_ID, ECD_OFICIAL_ID, ESTADO, TRABALHADORES_ECDS_DATAS_ID, ENVIADO, + ANALISADOR_ID, DATA_ENVIO, DATA_RECEPCAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, ECD_ID, ECD_OFICIAL_ID, ESTADO, TRABALHADORES_ECDS_DATAS_ID, ENVIADO, + ANALISADOR_ID, DATA_ENVIO, DATA_RECEPCAO, }; + + private Integer id; + private Integer ecd_id; + private db.data.siprp_local.outer.PrtTiposElementosProtocoloData to_ecd_id; + private Integer ecd_oficial_id; + private db.data.siprp_local.outer.EcdOficialData to_ecd_oficial_id; + private Integer estado; + private Integer trabalhadores_ecds_datas_id; + private db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id; + private String enviado; + private Integer analisador_id; + private db.data.siprp_local.outer.PrestadoresData to_analisador_id; + private java.util.Date data_envio; + private java.util.Date data_recepcao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresEcd() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getEcd_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ECD_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ecd_id; + } + + public void setEcd_id( Integer ecd_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ECD_ID, ecd_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ecd_id = ecd_id; + LAZY_LOADED_OBJECTS.put( ECD_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrtTiposElementosProtocoloData toEcd_id() + { + try + { + prepare( TO_ECD_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_ecd_id; + } + + public void setToEcd_id( db.data.siprp_local.outer.PrtTiposElementosProtocoloData to_ecd_id ) + { + try + { + preProcess( TO_ECD_ID, to_ecd_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_ecd_id = to_ecd_id; + } + + public Integer getEcd_oficial_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ECD_OFICIAL_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.ecd_oficial_id; + } + + public void setEcd_oficial_id( Integer ecd_oficial_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ECD_OFICIAL_ID, ecd_oficial_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.ecd_oficial_id = ecd_oficial_id; + LAZY_LOADED_OBJECTS.put( ECD_OFICIAL_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.EcdOficialData toEcd_oficial_id() + { + try + { + prepare( TO_ECD_OFICIAL_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_ecd_oficial_id; + } + + public void setToEcd_oficial_id( db.data.siprp_local.outer.EcdOficialData to_ecd_oficial_id ) + { + try + { + preProcess( TO_ECD_OFICIAL_ID, to_ecd_oficial_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_ecd_oficial_id = to_ecd_oficial_id; + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getTrabalhadores_ecds_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_ECDS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_ecds_datas_id; + } + + public void setTrabalhadores_ecds_datas_id( Integer trabalhadores_ecds_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_ECDS_DATAS_ID, trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_ecds_datas_id = trabalhadores_ecds_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_ECDS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresEcdsDatasData toTrabalhadores_ecds_datas_id() + { + try + { + prepare( TO_TRABALHADORES_ECDS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_ecds_datas_id; + } + + public void setToTrabalhadores_ecds_datas_id( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_ECDS_DATAS_ID, to_trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_ecds_datas_id = to_trabalhadores_ecds_datas_id; + } + + public String getEnviado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ENVIADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.enviado; + } + + public void setEnviado( String enviado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ENVIADO, enviado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.enviado = enviado; + LAZY_LOADED_OBJECTS.put( ENVIADO, Boolean.TRUE ); + } + + public Integer getAnalisador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analisador_id; + } + + public void setAnalisador_id( Integer analisador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ANALISADOR_ID, analisador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analisador_id = analisador_id; + LAZY_LOADED_OBJECTS.put( ANALISADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toAnalisador_id() + { + try + { + prepare( TO_ANALISADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_analisador_id; + } + + public void setToAnalisador_id( db.data.siprp_local.outer.PrestadoresData to_analisador_id ) + { + try + { + preProcess( TO_ANALISADOR_ID, to_analisador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_analisador_id = to_analisador_id; + } + + public java.util.Date getData_envio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ENVIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_envio; + } + + public void setData_envio( java.util.Date data_envio ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ENVIO, data_envio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_envio = data_envio; + LAZY_LOADED_OBJECTS.put( DATA_ENVIO, Boolean.TRUE ); + } + + public java.util.Date getData_recepcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RECEPCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_recepcao; + } + + public void setData_recepcao( java.util.Date data_recepcao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_RECEPCAO, data_recepcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_recepcao = data_recepcao; + LAZY_LOADED_OBJECTS.put( DATA_RECEPCAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcd.ID_INDEX: + value = getId(); + break; + case TrabalhadoresEcd.ECD_ID_INDEX: + value = getEcd_id(); + break; + case TrabalhadoresEcd.TO_ECD_ID_INDEX: + value = toEcd_id(); + break; + case TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX: + value = getEcd_oficial_id(); + break; + case TrabalhadoresEcd.TO_ECD_OFICIAL_ID_INDEX: + value = toEcd_oficial_id(); + break; + case TrabalhadoresEcd.ESTADO_INDEX: + value = getEstado(); + break; + case TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = getTrabalhadores_ecds_datas_id(); + break; + case TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = toTrabalhadores_ecds_datas_id(); + break; + case TrabalhadoresEcd.ENVIADO_INDEX: + value = getEnviado(); + break; + case TrabalhadoresEcd.ANALISADOR_ID_INDEX: + value = getAnalisador_id(); + break; + case TrabalhadoresEcd.TO_ANALISADOR_ID_INDEX: + value = toAnalisador_id(); + break; + case TrabalhadoresEcd.DATA_ENVIO_INDEX: + value = getData_envio(); + break; + case TrabalhadoresEcd.DATA_RECEPCAO_INDEX: + value = getData_recepcao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcd.ID_INDEX: + value = this.id; + break; + case TrabalhadoresEcd.ECD_ID_INDEX: + value = this.ecd_id; + break; + case TrabalhadoresEcd.TO_ECD_ID_INDEX: + value = this.to_ecd_id; + break; + case TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX: + value = this.ecd_oficial_id; + break; + case TrabalhadoresEcd.TO_ECD_OFICIAL_ID_INDEX: + value = this.to_ecd_oficial_id; + break; + case TrabalhadoresEcd.ESTADO_INDEX: + value = this.estado; + break; + case TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.trabalhadores_ecds_datas_id; + break; + case TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.to_trabalhadores_ecds_datas_id; + break; + case TrabalhadoresEcd.ENVIADO_INDEX: + value = this.enviado; + break; + case TrabalhadoresEcd.ANALISADOR_ID_INDEX: + value = this.analisador_id; + break; + case TrabalhadoresEcd.TO_ANALISADOR_ID_INDEX: + value = this.to_analisador_id; + break; + case TrabalhadoresEcd.DATA_ENVIO_INDEX: + value = this.data_envio; + break; + case TrabalhadoresEcd.DATA_RECEPCAO_INDEX: + value = this.data_recepcao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcd.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresEcd.ECD_ID_INDEX: + setEcd_id( ( Integer ) value ); + break; + case TrabalhadoresEcd.TO_ECD_ID_INDEX: + setToEcd_id( ( db.data.siprp_local.outer.PrtTiposElementosProtocoloData ) value ); + break; + case TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX: + setEcd_oficial_id( ( Integer ) value ); + break; + case TrabalhadoresEcd.TO_ECD_OFICIAL_ID_INDEX: + setToEcd_oficial_id( ( db.data.siprp_local.outer.EcdOficialData ) value ); + break; + case TrabalhadoresEcd.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX: + setTrabalhadores_ecds_datas_id( ( Integer ) value ); + break; + case TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + setToTrabalhadores_ecds_datas_id( ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value ); + break; + case TrabalhadoresEcd.ENVIADO_INDEX: + setEnviado( ( String ) value ); + break; + case TrabalhadoresEcd.ANALISADOR_ID_INDEX: + setAnalisador_id( ( Integer ) value ); + break; + case TrabalhadoresEcd.TO_ANALISADOR_ID_INDEX: + setToAnalisador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case TrabalhadoresEcd.DATA_ENVIO_INDEX: + setData_envio( ( java.util.Date ) value ); + break; + case TrabalhadoresEcd.DATA_RECEPCAO_INDEX: + setData_recepcao( ( java.util.Date ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcd.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresEcd.ECD_ID_INDEX: + this.ecd_id = ( Integer ) value; + break; + case TrabalhadoresEcd.TO_ECD_ID_INDEX: + this.to_ecd_id = ( db.data.siprp_local.outer.PrtTiposElementosProtocoloData ) value; + break; + case TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX: + this.ecd_oficial_id = ( Integer ) value; + break; + case TrabalhadoresEcd.TO_ECD_OFICIAL_ID_INDEX: + this.to_ecd_oficial_id = ( db.data.siprp_local.outer.EcdOficialData ) value; + break; + case TrabalhadoresEcd.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.trabalhadores_ecds_datas_id = ( Integer ) value; + break; + case TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.to_trabalhadores_ecds_datas_id = ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value; + break; + case TrabalhadoresEcd.ENVIADO_INDEX: + this.enviado = ( String ) value; + break; + case TrabalhadoresEcd.ANALISADOR_ID_INDEX: + this.analisador_id = ( Integer ) value; + break; + case TrabalhadoresEcd.TO_ANALISADOR_ID_INDEX: + this.to_analisador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case TrabalhadoresEcd.DATA_ENVIO_INDEX: + this.data_envio = ( java.util.Date ) value; + break; + case TrabalhadoresEcd.DATA_RECEPCAO_INDEX: + this.data_recepcao = ( java.util.Date ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresEcd.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcd.ECD_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcd.TO_ECD_ID_INDEX: + theClass = db.data.siprp_local.outer.PrtTiposElementosProtocoloData.class; + break; + case TrabalhadoresEcd.ECD_OFICIAL_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcd.TO_ECD_OFICIAL_ID_INDEX: + theClass = db.data.siprp_local.outer.EcdOficialData.class; + break; + case TrabalhadoresEcd.ESTADO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcd.TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcd.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class; + break; + case TrabalhadoresEcd.ENVIADO_INDEX: + theClass = String.class; + break; + case TrabalhadoresEcd.ANALISADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcd.TO_ANALISADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case TrabalhadoresEcd.DATA_ENVIO_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresEcd.DATA_RECEPCAO_INDEX: + theClass = java.util.Date.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresEcd._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresEcd.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcds.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcds.java new file mode 100644 index 00000000..650c3f88 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcds.java @@ -0,0 +1,545 @@ +/* +* TrabalhadoresEcds.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresEcds extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresEcds.ID, TrabalhadoresEcds.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.ID_FULL, TrabalhadoresEcds.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcds.CLASS_IDENTIFIER, TrabalhadoresEcds.TRABALHADOR_ID, TrabalhadoresEcds.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresEcds.TRABALHADOR_ID, TrabalhadoresEcds.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.TRABALHADOR_ID_FULL, TrabalhadoresEcds.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.TO_TRABALHADOR_ID, TrabalhadoresEcds.TO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.ESTADO, TrabalhadoresEcds.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.ESTADO_FULL, TrabalhadoresEcds.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.DATA, TrabalhadoresEcds.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.DATA_FULL, TrabalhadoresEcds.DATA_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcds.CLASS_IDENTIFIER, TrabalhadoresEcds.PROCESSO_ID, TrabalhadoresEcds.TO_PROCESSO_ID ); + FIELD_INDEXES.put( TrabalhadoresEcds.PROCESSO_ID, TrabalhadoresEcds.PROCESSO_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.PROCESSO_ID_FULL, TrabalhadoresEcds.PROCESSO_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcds.TO_PROCESSO_ID, TrabalhadoresEcds.TO_PROCESSO_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( TrabalhadoresEcds.class, TrabalhadoresEcds.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprocesso_idTotrabalhadores_processo = + new com.evolute.entity.ForeignKey( TrabalhadoresEcds.class, TrabalhadoresEcds.PROCESSO_ID, db.data.siprp_local.outer.TrabalhadoresProcessoData.class, db.data.siprp_local.outer.TrabalhadoresProcessoData.ID ); + + public static final String TABLENAME = "trabalhadores_ecds"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_ecds"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_ecds.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "trabalhadores_ecds.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 1; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "trabalhadores_ecds.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 2; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "trabalhadores_ecds.estado"; + public static final int ESTADO_INDEX = 3; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_ecds.data"; + public static final int DATA_INDEX = 4; + public static final String PROCESSO_ID = "processo_id"; + public static final String PROCESSO_ID_FULL = "trabalhadores_ecds.processo_id"; + public static final int PROCESSO_ID_INDEX = 5; + public static final String TO_PROCESSO_ID = "to_processo_id"; + public static final String TO_PROCESSO_ID_FULL = "trabalhadores_ecds.to_processo_id"; + public static final int TO_PROCESSO_ID_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADOR_ID, TO_TRABALHADOR_ID, ESTADO, DATA, PROCESSO_ID, TO_PROCESSO_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + ESTADO, TABLENAME + "." + DATA, TABLENAME + "." + PROCESSO_ID, TABLENAME + "." + TO_PROCESSO_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADOR_ID, ESTADO, DATA, PROCESSO_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADOR_ID, ESTADO, DATA, PROCESSO_ID, }; + + private Integer id; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private Integer estado; + private java.util.Date data; + private Integer processo_id; + private db.data.siprp_local.outer.TrabalhadoresProcessoData to_processo_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresEcds() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromTrabalhadoresEcdsDatas_trabalhadores_ecds_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_ecds_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getProcesso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROCESSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.processo_id; + } + + public void setProcesso_id( Integer processo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROCESSO_ID, processo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.processo_id = processo_id; + LAZY_LOADED_OBJECTS.put( PROCESSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresProcessoData toProcesso_id() + { + try + { + prepare( TO_PROCESSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_processo_id; + } + + public void setToProcesso_id( db.data.siprp_local.outer.TrabalhadoresProcessoData to_processo_id ) + { + try + { + preProcess( TO_PROCESSO_ID, to_processo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_processo_id = to_processo_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcds.ID_INDEX: + value = getId(); + break; + case TrabalhadoresEcds.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case TrabalhadoresEcds.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case TrabalhadoresEcds.ESTADO_INDEX: + value = getEstado(); + break; + case TrabalhadoresEcds.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresEcds.PROCESSO_ID_INDEX: + value = getProcesso_id(); + break; + case TrabalhadoresEcds.TO_PROCESSO_ID_INDEX: + value = toProcesso_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcds.ID_INDEX: + value = this.id; + break; + case TrabalhadoresEcds.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case TrabalhadoresEcds.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case TrabalhadoresEcds.ESTADO_INDEX: + value = this.estado; + break; + case TrabalhadoresEcds.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresEcds.PROCESSO_ID_INDEX: + value = this.processo_id; + break; + case TrabalhadoresEcds.TO_PROCESSO_ID_INDEX: + value = this.to_processo_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcds.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresEcds.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case TrabalhadoresEcds.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case TrabalhadoresEcds.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case TrabalhadoresEcds.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresEcds.PROCESSO_ID_INDEX: + setProcesso_id( ( Integer ) value ); + break; + case TrabalhadoresEcds.TO_PROCESSO_ID_INDEX: + setToProcesso_id( ( db.data.siprp_local.outer.TrabalhadoresProcessoData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcds.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresEcds.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case TrabalhadoresEcds.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case TrabalhadoresEcds.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case TrabalhadoresEcds.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresEcds.PROCESSO_ID_INDEX: + this.processo_id = ( Integer ) value; + break; + case TrabalhadoresEcds.TO_PROCESSO_ID_INDEX: + this.to_processo_id = ( db.data.siprp_local.outer.TrabalhadoresProcessoData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresEcds.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcds.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcds.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case TrabalhadoresEcds.ESTADO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcds.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresEcds.PROCESSO_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcds.TO_PROCESSO_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresProcessoData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresEcds._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresEcds.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsAnalise.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsAnalise.java new file mode 100644 index 00000000..e92c4ea1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsAnalise.java @@ -0,0 +1,481 @@ +/* +* TrabalhadoresEcdsAnalise.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresEcdsAnalise extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.ID, TrabalhadoresEcdsAnalise.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.ID_FULL, TrabalhadoresEcdsAnalise.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.DATA, TrabalhadoresEcdsAnalise.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.DATA_FULL, TrabalhadoresEcdsAnalise.DATA_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsAnalise.CLASS_IDENTIFIER, TrabalhadoresEcdsAnalise.PRESTADOR_ID, TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.PRESTADOR_ID, TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.PRESTADOR_ID_FULL, TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID, TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsAnalise.CLASS_IDENTIFIER, TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID, TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID, TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_FULL, TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID, TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsAnalise.class, TrabalhadoresEcdsAnalise.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeygrupo_ecds_idToprt_grupos_protocolo = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsAnalise.class, TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID, db.data.siprp_local.outer.PrtGruposProtocoloData.class, db.data.siprp_local.outer.PrtGruposProtocoloData.ID ); + + public static final String TABLENAME = "trabalhadores_ecds_analise"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_ecds_analise"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_ecds_analise.id"; + public static final int ID_INDEX = 0; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_ecds_analise.data"; + public static final int DATA_INDEX = 1; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "trabalhadores_ecds_analise.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 2; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "trabalhadores_ecds_analise.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 3; + public static final String GRUPO_ECDS_ID = "grupo_ecds_id"; + public static final String GRUPO_ECDS_ID_FULL = "trabalhadores_ecds_analise.grupo_ecds_id"; + public static final int GRUPO_ECDS_ID_INDEX = 4; + public static final String TO_GRUPO_ECDS_ID = "to_grupo_ecds_id"; + public static final String TO_GRUPO_ECDS_ID_FULL = "trabalhadores_ecds_analise.to_grupo_ecds_id"; + public static final int TO_GRUPO_ECDS_ID_INDEX = 5; + + public static final String FIELD_NAMES[] = new String[]{ + DATA, PRESTADOR_ID, TO_PRESTADOR_ID, GRUPO_ECDS_ID, TO_GRUPO_ECDS_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + DATA, TABLENAME + "." + PRESTADOR_ID, TABLENAME + "." + TO_PRESTADOR_ID, TABLENAME + "." + GRUPO_ECDS_ID, TABLENAME + "." + TO_GRUPO_ECDS_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, DATA, PRESTADOR_ID, GRUPO_ECDS_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, DATA, PRESTADOR_ID, GRUPO_ECDS_ID, }; + + private Integer id; + private java.util.Date data; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + private Integer grupo_ecds_id; + private db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_ecds_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresEcdsAnalise() + { + super(); + dirtyProperties = new boolean[]{ false, false, false + , false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Integer getGrupo_ecds_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( GRUPO_ECDS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.grupo_ecds_id; + } + + public void setGrupo_ecds_id( Integer grupo_ecds_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( GRUPO_ECDS_ID, grupo_ecds_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.grupo_ecds_id = grupo_ecds_id; + LAZY_LOADED_OBJECTS.put( GRUPO_ECDS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrtGruposProtocoloData toGrupo_ecds_id() + { + try + { + prepare( TO_GRUPO_ECDS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_grupo_ecds_id; + } + + public void setToGrupo_ecds_id( db.data.siprp_local.outer.PrtGruposProtocoloData to_grupo_ecds_id ) + { + try + { + preProcess( TO_GRUPO_ECDS_ID, to_grupo_ecds_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_grupo_ecds_id = to_grupo_ecds_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsAnalise.ID_INDEX: + value = getId(); + break; + case TrabalhadoresEcdsAnalise.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + case TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX: + value = getGrupo_ecds_id(); + break; + case TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID_INDEX: + value = toGrupo_ecds_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsAnalise.ID_INDEX: + value = this.id; + break; + case TrabalhadoresEcdsAnalise.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + case TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX: + value = this.grupo_ecds_id; + break; + case TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID_INDEX: + value = this.to_grupo_ecds_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsAnalise.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresEcdsAnalise.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX: + setGrupo_ecds_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID_INDEX: + setToGrupo_ecds_id( ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsAnalise.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresEcdsAnalise.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX: + this.grupo_ecds_id = ( Integer ) value; + break; + case TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID_INDEX: + this.to_grupo_ecds_id = ( db.data.siprp_local.outer.PrtGruposProtocoloData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresEcdsAnalise.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsAnalise.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresEcdsAnalise.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsAnalise.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case TrabalhadoresEcdsAnalise.GRUPO_ECDS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsAnalise.TO_GRUPO_ECDS_ID_INDEX: + theClass = db.data.siprp_local.outer.PrtGruposProtocoloData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresEcdsAnalise._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresEcdsAnalise.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatas.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatas.java new file mode 100644 index 00000000..4964fe95 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatas.java @@ -0,0 +1,791 @@ +/* +* TrabalhadoresEcdsDatas.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresEcdsDatas extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.ID, TrabalhadoresEcdsDatas.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.ID_FULL, TrabalhadoresEcdsDatas.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsDatas.CLASS_IDENTIFIER, TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID, TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID, TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_FULL, TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID, TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.DATA, TrabalhadoresEcdsDatas.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.DATA_FULL, TrabalhadoresEcdsDatas.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.ESTADO, TrabalhadoresEcdsDatas.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.ESTADO_FULL, TrabalhadoresEcdsDatas.ESTADO_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsDatas.CLASS_IDENTIFIER, TrabalhadoresEcdsDatas.PRESTADOR_ID, TrabalhadoresEcdsDatas.TO_PRESTADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.PRESTADOR_ID, TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.PRESTADOR_ID_FULL, TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.TO_PRESTADOR_ID, TrabalhadoresEcdsDatas.TO_PRESTADOR_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsDatas.CLASS_IDENTIFIER, TrabalhadoresEcdsDatas.ANALISADOR_ID, TrabalhadoresEcdsDatas.TO_ANALISADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.ANALISADOR_ID, TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.ANALISADOR_ID_FULL, TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.TO_ANALISADOR_ID, TrabalhadoresEcdsDatas.TO_ANALISADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.DATA_ENVIO, TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.DATA_ENVIO_FULL, TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.DATA_RECEPCAO, TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatas.DATA_RECEPCAO_FULL, TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_ecds_idTotrabalhadores_ecds = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsDatas.class, TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID, db.data.siprp_local.outer.TrabalhadoresEcdsData.class, db.data.siprp_local.outer.TrabalhadoresEcdsData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyprestador_idToprestadores = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsDatas.class, TrabalhadoresEcdsDatas.PRESTADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyanalisador_idToprestadores = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsDatas.class, TrabalhadoresEcdsDatas.ANALISADOR_ID, db.data.siprp_local.outer.PrestadoresData.class, db.data.siprp_local.outer.PrestadoresData.ID ); + + public static final String TABLENAME = "trabalhadores_ecds_datas"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_ecds_datas"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_ecds_datas.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADORES_ECDS_ID = "trabalhadores_ecds_id"; + public static final String TRABALHADORES_ECDS_ID_FULL = "trabalhadores_ecds_datas.trabalhadores_ecds_id"; + public static final int TRABALHADORES_ECDS_ID_INDEX = 1; + public static final String TO_TRABALHADORES_ECDS_ID = "to_trabalhadores_ecds_id"; + public static final String TO_TRABALHADORES_ECDS_ID_FULL = "trabalhadores_ecds_datas.to_trabalhadores_ecds_id"; + public static final int TO_TRABALHADORES_ECDS_ID_INDEX = 2; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_ecds_datas.data"; + public static final int DATA_INDEX = 3; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "trabalhadores_ecds_datas.estado"; + public static final int ESTADO_INDEX = 4; + public static final String PRESTADOR_ID = "prestador_id"; + public static final String PRESTADOR_ID_FULL = "trabalhadores_ecds_datas.prestador_id"; + public static final int PRESTADOR_ID_INDEX = 5; + public static final String TO_PRESTADOR_ID = "to_prestador_id"; + public static final String TO_PRESTADOR_ID_FULL = "trabalhadores_ecds_datas.to_prestador_id"; + public static final int TO_PRESTADOR_ID_INDEX = 6; + public static final String ANALISADOR_ID = "analisador_id"; + public static final String ANALISADOR_ID_FULL = "trabalhadores_ecds_datas.analisador_id"; + public static final int ANALISADOR_ID_INDEX = 7; + public static final String TO_ANALISADOR_ID = "to_analisador_id"; + public static final String TO_ANALISADOR_ID_FULL = "trabalhadores_ecds_datas.to_analisador_id"; + public static final int TO_ANALISADOR_ID_INDEX = 8; + public static final String DATA_ENVIO = "data_envio"; + public static final String DATA_ENVIO_FULL = "trabalhadores_ecds_datas.data_envio"; + public static final int DATA_ENVIO_INDEX = 9; + public static final String DATA_RECEPCAO = "data_recepcao"; + public static final String DATA_RECEPCAO_FULL = "trabalhadores_ecds_datas.data_recepcao"; + public static final int DATA_RECEPCAO_INDEX = 10; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADORES_ECDS_ID, TO_TRABALHADORES_ECDS_ID, DATA, ESTADO, PRESTADOR_ID, + TO_PRESTADOR_ID, ANALISADOR_ID, TO_ANALISADOR_ID, DATA_ENVIO, DATA_RECEPCAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADORES_ECDS_ID, TABLENAME + "." + TO_TRABALHADORES_ECDS_ID, TABLENAME + "." + DATA, TABLENAME + "." + ESTADO, TABLENAME + "." + PRESTADOR_ID, + TABLENAME + "." + TO_PRESTADOR_ID, TABLENAME + "." + ANALISADOR_ID, TABLENAME + "." + TO_ANALISADOR_ID, TABLENAME + "." + DATA_ENVIO, TABLENAME + "." + DATA_RECEPCAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADORES_ECDS_ID, DATA, ESTADO, PRESTADOR_ID, ANALISADOR_ID, DATA_ENVIO, + DATA_RECEPCAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADORES_ECDS_ID, DATA, ESTADO, PRESTADOR_ID, ANALISADOR_ID, DATA_ENVIO, + DATA_RECEPCAO, }; + + private Integer id; + private Integer trabalhadores_ecds_id; + private db.data.siprp_local.outer.TrabalhadoresEcdsData to_trabalhadores_ecds_id; + private java.util.Date data; + private Integer estado; + private Integer prestador_id; + private db.data.siprp_local.outer.PrestadoresData to_prestador_id; + private Integer analisador_id; + private db.data.siprp_local.outer.PrestadoresData to_analisador_id; + private java.util.Date data_envio; + private java.util.Date data_recepcao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresEcdsDatas() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromLembretes_trabalhadores_ecds_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.LembretesData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_ecds_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcd_trabalhadores_ecds_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_ecds_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcdsDatasEmails_trabalhadores_ecds_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsDatasEmailsData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_ecds_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcdsDatasObservacoes_trabalhadores_ecds_datas_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsDatasObservacoesData.class , getPrimaryKey().getMap().get("id"), "trabalhadores_ecds_datas_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getTrabalhadores_ecds_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_ECDS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_ecds_id; + } + + public void setTrabalhadores_ecds_id( Integer trabalhadores_ecds_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_ECDS_ID, trabalhadores_ecds_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_ecds_id = trabalhadores_ecds_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_ECDS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresEcdsData toTrabalhadores_ecds_id() + { + try + { + prepare( TO_TRABALHADORES_ECDS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_ecds_id; + } + + public void setToTrabalhadores_ecds_id( db.data.siprp_local.outer.TrabalhadoresEcdsData to_trabalhadores_ecds_id ) + { + try + { + preProcess( TO_TRABALHADORES_ECDS_ID, to_trabalhadores_ecds_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_ecds_id = to_trabalhadores_ecds_id; + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public Integer getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( Integer estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public Integer getPrestador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PRESTADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.prestador_id; + } + + public void setPrestador_id( Integer prestador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PRESTADOR_ID, prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.prestador_id = prestador_id; + LAZY_LOADED_OBJECTS.put( PRESTADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toPrestador_id() + { + try + { + prepare( TO_PRESTADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_prestador_id; + } + + public void setToPrestador_id( db.data.siprp_local.outer.PrestadoresData to_prestador_id ) + { + try + { + preProcess( TO_PRESTADOR_ID, to_prestador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_prestador_id = to_prestador_id; + } + + public Integer getAnalisador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ANALISADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.analisador_id; + } + + public void setAnalisador_id( Integer analisador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ANALISADOR_ID, analisador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.analisador_id = analisador_id; + LAZY_LOADED_OBJECTS.put( ANALISADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.PrestadoresData toAnalisador_id() + { + try + { + prepare( TO_ANALISADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_analisador_id; + } + + public void setToAnalisador_id( db.data.siprp_local.outer.PrestadoresData to_analisador_id ) + { + try + { + preProcess( TO_ANALISADOR_ID, to_analisador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_analisador_id = to_analisador_id; + } + + public java.util.Date getData_envio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_ENVIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_envio; + } + + public void setData_envio( java.util.Date data_envio ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_ENVIO, data_envio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_envio = data_envio; + LAZY_LOADED_OBJECTS.put( DATA_ENVIO, Boolean.TRUE ); + } + + public java.util.Date getData_recepcao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_RECEPCAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_recepcao; + } + + public void setData_recepcao( java.util.Date data_recepcao ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_RECEPCAO, data_recepcao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_recepcao = data_recepcao; + LAZY_LOADED_OBJECTS.put( DATA_RECEPCAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatas.ID_INDEX: + value = getId(); + break; + case TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX: + value = getTrabalhadores_ecds_id(); + break; + case TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID_INDEX: + value = toTrabalhadores_ecds_id(); + break; + case TrabalhadoresEcdsDatas.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresEcdsDatas.ESTADO_INDEX: + value = getEstado(); + break; + case TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX: + value = getPrestador_id(); + break; + case TrabalhadoresEcdsDatas.TO_PRESTADOR_ID_INDEX: + value = toPrestador_id(); + break; + case TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX: + value = getAnalisador_id(); + break; + case TrabalhadoresEcdsDatas.TO_ANALISADOR_ID_INDEX: + value = toAnalisador_id(); + break; + case TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX: + value = getData_envio(); + break; + case TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX: + value = getData_recepcao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatas.ID_INDEX: + value = this.id; + break; + case TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX: + value = this.trabalhadores_ecds_id; + break; + case TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID_INDEX: + value = this.to_trabalhadores_ecds_id; + break; + case TrabalhadoresEcdsDatas.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresEcdsDatas.ESTADO_INDEX: + value = this.estado; + break; + case TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX: + value = this.prestador_id; + break; + case TrabalhadoresEcdsDatas.TO_PRESTADOR_ID_INDEX: + value = this.to_prestador_id; + break; + case TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX: + value = this.analisador_id; + break; + case TrabalhadoresEcdsDatas.TO_ANALISADOR_ID_INDEX: + value = this.to_analisador_id; + break; + case TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX: + value = this.data_envio; + break; + case TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX: + value = this.data_recepcao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatas.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX: + setTrabalhadores_ecds_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID_INDEX: + setToTrabalhadores_ecds_id( ( db.data.siprp_local.outer.TrabalhadoresEcdsData ) value ); + break; + case TrabalhadoresEcdsDatas.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresEcdsDatas.ESTADO_INDEX: + setEstado( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX: + setPrestador_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatas.TO_PRESTADOR_ID_INDEX: + setToPrestador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX: + setAnalisador_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatas.TO_ANALISADOR_ID_INDEX: + setToAnalisador_id( ( db.data.siprp_local.outer.PrestadoresData ) value ); + break; + case TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX: + setData_envio( ( java.util.Date ) value ); + break; + case TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX: + setData_recepcao( ( java.util.Date ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatas.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX: + this.trabalhadores_ecds_id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID_INDEX: + this.to_trabalhadores_ecds_id = ( db.data.siprp_local.outer.TrabalhadoresEcdsData ) value; + break; + case TrabalhadoresEcdsDatas.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresEcdsDatas.ESTADO_INDEX: + this.estado = ( Integer ) value; + break; + case TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX: + this.prestador_id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatas.TO_PRESTADOR_ID_INDEX: + this.to_prestador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX: + this.analisador_id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatas.TO_ANALISADOR_ID_INDEX: + this.to_analisador_id = ( db.data.siprp_local.outer.PrestadoresData ) value; + break; + case TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX: + this.data_envio = ( java.util.Date ) value; + break; + case TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX: + this.data_recepcao = ( java.util.Date ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresEcdsDatas.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatas.TRABALHADORES_ECDS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatas.TO_TRABALHADORES_ECDS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresEcdsData.class; + break; + case TrabalhadoresEcdsDatas.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresEcdsDatas.ESTADO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatas.PRESTADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatas.TO_PRESTADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case TrabalhadoresEcdsDatas.ANALISADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatas.TO_ANALISADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.PrestadoresData.class; + break; + case TrabalhadoresEcdsDatas.DATA_ENVIO_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresEcdsDatas.DATA_RECEPCAO_INDEX: + theClass = java.util.Date.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresEcdsDatas._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresEcdsDatas.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatasEmails.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatasEmails.java new file mode 100644 index 00000000..94d63e48 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatasEmails.java @@ -0,0 +1,533 @@ +/* +* TrabalhadoresEcdsDatasEmails.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresEcdsDatasEmails extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.ID, TrabalhadoresEcdsDatasEmails.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.ID_FULL, TrabalhadoresEcdsDatasEmails.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsDatasEmails.CLASS_IDENTIFIER, TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_FULL, TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.DESTINATION, TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.DESTINATION_FULL, TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.DATA, TrabalhadoresEcdsDatasEmails.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.DATA_FULL, TrabalhadoresEcdsDatasEmails.DATA_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.SUBJECT, TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.SUBJECT_FULL, TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.BODY, TrabalhadoresEcdsDatasEmails.BODY_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasEmails.BODY_FULL, TrabalhadoresEcdsDatasEmails.BODY_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_ecds_datas_idTotrabalhadores_ecds_datas = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsDatasEmails.class, TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.ID ); + + public static final String TABLENAME = "trabalhadores_ecds_datas_emails"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_ecds_datas_emails"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_ecds_datas_emails.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADORES_ECDS_DATAS_ID = "trabalhadores_ecds_datas_id"; + public static final String TRABALHADORES_ECDS_DATAS_ID_FULL = "trabalhadores_ecds_datas_emails.trabalhadores_ecds_datas_id"; + public static final int TRABALHADORES_ECDS_DATAS_ID_INDEX = 1; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID = "to_trabalhadores_ecds_datas_id"; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID_FULL = "trabalhadores_ecds_datas_emails.to_trabalhadores_ecds_datas_id"; + public static final int TO_TRABALHADORES_ECDS_DATAS_ID_INDEX = 2; + public static final String DESTINATION = "destination"; + public static final String DESTINATION_FULL = "trabalhadores_ecds_datas_emails.destination"; + public static final int DESTINATION_INDEX = 3; + public static final String DATA = "data"; + public static final String DATA_FULL = "trabalhadores_ecds_datas_emails.data"; + public static final int DATA_INDEX = 4; + public static final String SUBJECT = "subject"; + public static final String SUBJECT_FULL = "trabalhadores_ecds_datas_emails.subject"; + public static final int SUBJECT_INDEX = 5; + public static final String BODY = "body"; + public static final String BODY_FULL = "trabalhadores_ecds_datas_emails.body"; + public static final int BODY_INDEX = 6; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADORES_ECDS_DATAS_ID, TO_TRABALHADORES_ECDS_DATAS_ID, DESTINATION, + DATA, SUBJECT, BODY, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + DESTINATION, + TABLENAME + "." + DATA, TABLENAME + "." + SUBJECT, TABLENAME + "." + BODY, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADORES_ECDS_DATAS_ID, DESTINATION, DATA, SUBJECT, BODY, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADORES_ECDS_DATAS_ID, DESTINATION, DATA, SUBJECT, BODY, }; + + private Integer id; + private Integer trabalhadores_ecds_datas_id; + private db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id; + private String destination; + private java.util.Date data; + private String subject; + private String body; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresEcdsDatasEmails() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTrabalhadores_ecds_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_ECDS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_ecds_datas_id; + } + + public void setTrabalhadores_ecds_datas_id( Integer trabalhadores_ecds_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_ECDS_DATAS_ID, trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_ecds_datas_id = trabalhadores_ecds_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_ECDS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresEcdsDatasData toTrabalhadores_ecds_datas_id() + { + try + { + prepare( TO_TRABALHADORES_ECDS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_ecds_datas_id; + } + + public void setToTrabalhadores_ecds_datas_id( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_ECDS_DATAS_ID, to_trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_ecds_datas_id = to_trabalhadores_ecds_datas_id; + } + + public String getDestination() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DESTINATION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.destination; + } + + public void setDestination( String destination ) + { + try + { + setLockedForRefresh( true ); + preProcess( DESTINATION, destination ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.destination = destination; + LAZY_LOADED_OBJECTS.put( DESTINATION, Boolean.TRUE ); + } + + public java.util.Date getData() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data; + } + + public void setData( java.util.Date data ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA, data ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data = data; + LAZY_LOADED_OBJECTS.put( DATA, Boolean.TRUE ); + } + + public String getSubject() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SUBJECT ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.subject; + } + + public void setSubject( String subject ) + { + try + { + setLockedForRefresh( true ); + preProcess( SUBJECT, subject ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.subject = subject; + LAZY_LOADED_OBJECTS.put( SUBJECT, Boolean.TRUE ); + } + + public String getBody() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( BODY ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.body; + } + + public void setBody( String body ) + { + try + { + setLockedForRefresh( true ); + preProcess( BODY, body ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.body = body; + LAZY_LOADED_OBJECTS.put( BODY, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasEmails.ID_INDEX: + value = getId(); + break; + case TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = getTrabalhadores_ecds_datas_id(); + break; + case TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = toTrabalhadores_ecds_datas_id(); + break; + case TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX: + value = getDestination(); + break; + case TrabalhadoresEcdsDatasEmails.DATA_INDEX: + value = getData(); + break; + case TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX: + value = getSubject(); + break; + case TrabalhadoresEcdsDatasEmails.BODY_INDEX: + value = getBody(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasEmails.ID_INDEX: + value = this.id; + break; + case TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.trabalhadores_ecds_datas_id; + break; + case TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.to_trabalhadores_ecds_datas_id; + break; + case TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX: + value = this.destination; + break; + case TrabalhadoresEcdsDatasEmails.DATA_INDEX: + value = this.data; + break; + case TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX: + value = this.subject; + break; + case TrabalhadoresEcdsDatasEmails.BODY_INDEX: + value = this.body; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasEmails.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX: + setTrabalhadores_ecds_datas_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + setToTrabalhadores_ecds_datas_id( ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value ); + break; + case TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX: + setDestination( ( String ) value ); + break; + case TrabalhadoresEcdsDatasEmails.DATA_INDEX: + setData( ( java.util.Date ) value ); + break; + case TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX: + setSubject( ( String ) value ); + break; + case TrabalhadoresEcdsDatasEmails.BODY_INDEX: + setBody( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasEmails.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.trabalhadores_ecds_datas_id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.to_trabalhadores_ecds_datas_id = ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value; + break; + case TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX: + this.destination = ( String ) value; + break; + case TrabalhadoresEcdsDatasEmails.DATA_INDEX: + this.data = ( java.util.Date ) value; + break; + case TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX: + this.subject = ( String ) value; + break; + case TrabalhadoresEcdsDatasEmails.BODY_INDEX: + this.body = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresEcdsDatasEmails.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatasEmails.TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatasEmails.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class; + break; + case TrabalhadoresEcdsDatasEmails.DESTINATION_INDEX: + theClass = String.class; + break; + case TrabalhadoresEcdsDatasEmails.DATA_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresEcdsDatasEmails.SUBJECT_INDEX: + theClass = String.class; + break; + case TrabalhadoresEcdsDatasEmails.BODY_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresEcdsDatasEmails._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresEcdsDatasEmails.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatasObservacoes.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatasObservacoes.java new file mode 100644 index 00000000..aac5d0cb --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresEcdsDatasObservacoes.java @@ -0,0 +1,381 @@ +/* +* TrabalhadoresEcdsDatasObservacoes.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresEcdsDatasObservacoes extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.ID, TrabalhadoresEcdsDatasObservacoes.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.ID_FULL, TrabalhadoresEcdsDatasObservacoes.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresEcdsDatasObservacoes.CLASS_IDENTIFIER, TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_FULL, TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID, TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.OBSERVACAO, TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_FULL, TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhadores_ecds_datas_idTotrabalhadores_ecds_datas = + new com.evolute.entity.ForeignKey( TrabalhadoresEcdsDatasObservacoes.class, TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class, db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.ID ); + + public static final String TABLENAME = "trabalhadores_ecds_datas_observacoes"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_ecds_datas_observacoes"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_ecds_datas_observacoes.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADORES_ECDS_DATAS_ID = "trabalhadores_ecds_datas_id"; + public static final String TRABALHADORES_ECDS_DATAS_ID_FULL = "trabalhadores_ecds_datas_observacoes.trabalhadores_ecds_datas_id"; + public static final int TRABALHADORES_ECDS_DATAS_ID_INDEX = 1; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID = "to_trabalhadores_ecds_datas_id"; + public static final String TO_TRABALHADORES_ECDS_DATAS_ID_FULL = "trabalhadores_ecds_datas_observacoes.to_trabalhadores_ecds_datas_id"; + public static final int TO_TRABALHADORES_ECDS_DATAS_ID_INDEX = 2; + public static final String OBSERVACAO = "observacao"; + public static final String OBSERVACAO_FULL = "trabalhadores_ecds_datas_observacoes.observacao"; + public static final int OBSERVACAO_INDEX = 3; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADORES_ECDS_DATAS_ID, TO_TRABALHADORES_ECDS_DATAS_ID, OBSERVACAO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + TO_TRABALHADORES_ECDS_DATAS_ID, TABLENAME + "." + OBSERVACAO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADORES_ECDS_DATAS_ID, OBSERVACAO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADORES_ECDS_DATAS_ID, OBSERVACAO, }; + + private Integer id; + private Integer trabalhadores_ecds_datas_id; + private db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id; + private String observacao; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresEcdsDatasObservacoes() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getTrabalhadores_ecds_datas_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADORES_ECDS_DATAS_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhadores_ecds_datas_id; + } + + public void setTrabalhadores_ecds_datas_id( Integer trabalhadores_ecds_datas_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADORES_ECDS_DATAS_ID, trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhadores_ecds_datas_id = trabalhadores_ecds_datas_id; + LAZY_LOADED_OBJECTS.put( TRABALHADORES_ECDS_DATAS_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresEcdsDatasData toTrabalhadores_ecds_datas_id() + { + try + { + prepare( TO_TRABALHADORES_ECDS_DATAS_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhadores_ecds_datas_id; + } + + public void setToTrabalhadores_ecds_datas_id( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData to_trabalhadores_ecds_datas_id ) + { + try + { + preProcess( TO_TRABALHADORES_ECDS_DATAS_ID, to_trabalhadores_ecds_datas_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhadores_ecds_datas_id = to_trabalhadores_ecds_datas_id; + } + + public String getObservacao() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( OBSERVACAO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.observacao; + } + + public void setObservacao( String observacao ) + { + try + { + setLockedForRefresh( true ); + preProcess( OBSERVACAO, observacao ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.observacao = observacao; + LAZY_LOADED_OBJECTS.put( OBSERVACAO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasObservacoes.ID_INDEX: + value = getId(); + break; + case TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = getTrabalhadores_ecds_datas_id(); + break; + case TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = toTrabalhadores_ecds_datas_id(); + break; + case TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX: + value = getObservacao(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasObservacoes.ID_INDEX: + value = this.id; + break; + case TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.trabalhadores_ecds_datas_id; + break; + case TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + value = this.to_trabalhadores_ecds_datas_id; + break; + case TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX: + value = this.observacao; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasObservacoes.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + setTrabalhadores_ecds_datas_id( ( Integer ) value ); + break; + case TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + setToTrabalhadores_ecds_datas_id( ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value ); + break; + case TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX: + setObservacao( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresEcdsDatasObservacoes.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.trabalhadores_ecds_datas_id = ( Integer ) value; + break; + case TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + this.to_trabalhadores_ecds_datas_id = ( db.data.siprp_local.outer.TrabalhadoresEcdsDatasData ) value; + break; + case TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX: + this.observacao = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresEcdsDatasObservacoes.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatasObservacoes.TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresEcdsDatasObservacoes.TO_TRABALHADORES_ECDS_DATAS_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresEcdsDatasData.class; + break; + case TrabalhadoresEcdsDatasObservacoes.OBSERVACAO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresEcdsDatasObservacoes._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresEcdsDatasObservacoes.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresFichasAptidao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresFichasAptidao.java new file mode 100644 index 00000000..c9080499 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresFichasAptidao.java @@ -0,0 +1,431 @@ +/* +* TrabalhadoresFichasAptidao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresFichasAptidao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.ID, TrabalhadoresFichasAptidao.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.ID_FULL, TrabalhadoresFichasAptidao.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresFichasAptidao.CLASS_IDENTIFIER, TrabalhadoresFichasAptidao.PROCESSO_ID, TrabalhadoresFichasAptidao.TO_PROCESSO_ID ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.PROCESSO_ID, TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.PROCESSO_ID_FULL, TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.TO_PROCESSO_ID, TrabalhadoresFichasAptidao.TO_PROCESSO_ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresFichasAptidao.CLASS_IDENTIFIER, TrabalhadoresFichasAptidao.EXAME_ID, TrabalhadoresFichasAptidao.TO_EXAME_ID ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.EXAME_ID, TrabalhadoresFichasAptidao.EXAME_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.EXAME_ID_FULL, TrabalhadoresFichasAptidao.EXAME_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresFichasAptidao.TO_EXAME_ID, TrabalhadoresFichasAptidao.TO_EXAME_ID_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeyprocesso_idTotrabalhadores_processo = + new com.evolute.entity.ForeignKey( TrabalhadoresFichasAptidao.class, TrabalhadoresFichasAptidao.PROCESSO_ID, db.data.siprp_local.outer.TrabalhadoresProcessoData.class, db.data.siprp_local.outer.TrabalhadoresProcessoData.ID ); + + public static final com.evolute.entity.ForeignKey ForeignKeyexame_idToexames = + new com.evolute.entity.ForeignKey( TrabalhadoresFichasAptidao.class, TrabalhadoresFichasAptidao.EXAME_ID, db.data.siprp_local.outer.ExamesData.class, db.data.siprp_local.outer.ExamesData.ID ); + + public static final String TABLENAME = "trabalhadores_fichas_aptidao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_fichas_aptidao"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_fichas_aptidao.id"; + public static final int ID_INDEX = 0; + public static final String PROCESSO_ID = "processo_id"; + public static final String PROCESSO_ID_FULL = "trabalhadores_fichas_aptidao.processo_id"; + public static final int PROCESSO_ID_INDEX = 1; + public static final String TO_PROCESSO_ID = "to_processo_id"; + public static final String TO_PROCESSO_ID_FULL = "trabalhadores_fichas_aptidao.to_processo_id"; + public static final int TO_PROCESSO_ID_INDEX = 2; + public static final String EXAME_ID = "exame_id"; + public static final String EXAME_ID_FULL = "trabalhadores_fichas_aptidao.exame_id"; + public static final int EXAME_ID_INDEX = 3; + public static final String TO_EXAME_ID = "to_exame_id"; + public static final String TO_EXAME_ID_FULL = "trabalhadores_fichas_aptidao.to_exame_id"; + public static final int TO_EXAME_ID_INDEX = 4; + + public static final String FIELD_NAMES[] = new String[]{ + PROCESSO_ID, TO_PROCESSO_ID, EXAME_ID, TO_EXAME_ID, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + PROCESSO_ID, TABLENAME + "." + TO_PROCESSO_ID, TABLENAME + "." + EXAME_ID, TABLENAME + "." + TO_EXAME_ID, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, PROCESSO_ID, EXAME_ID, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, PROCESSO_ID, EXAME_ID, }; + + private Integer id; + private Integer processo_id; + private db.data.siprp_local.outer.TrabalhadoresProcessoData to_processo_id; + private Integer exame_id; + private db.data.siprp_local.outer.ExamesData to_exame_id; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresFichasAptidao() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public Integer getProcesso_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( PROCESSO_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.processo_id; + } + + public void setProcesso_id( Integer processo_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( PROCESSO_ID, processo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.processo_id = processo_id; + LAZY_LOADED_OBJECTS.put( PROCESSO_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresProcessoData toProcesso_id() + { + try + { + prepare( TO_PROCESSO_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_processo_id; + } + + public void setToProcesso_id( db.data.siprp_local.outer.TrabalhadoresProcessoData to_processo_id ) + { + try + { + preProcess( TO_PROCESSO_ID, to_processo_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_processo_id = to_processo_id; + } + + public Integer getExame_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( EXAME_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.exame_id; + } + + public void setExame_id( Integer exame_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( EXAME_ID, exame_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.exame_id = exame_id; + LAZY_LOADED_OBJECTS.put( EXAME_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.ExamesData toExame_id() + { + try + { + prepare( TO_EXAME_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_exame_id; + } + + public void setToExame_id( db.data.siprp_local.outer.ExamesData to_exame_id ) + { + try + { + preProcess( TO_EXAME_ID, to_exame_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_exame_id = to_exame_id; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresFichasAptidao.ID_INDEX: + value = getId(); + break; + case TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX: + value = getProcesso_id(); + break; + case TrabalhadoresFichasAptidao.TO_PROCESSO_ID_INDEX: + value = toProcesso_id(); + break; + case TrabalhadoresFichasAptidao.EXAME_ID_INDEX: + value = getExame_id(); + break; + case TrabalhadoresFichasAptidao.TO_EXAME_ID_INDEX: + value = toExame_id(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresFichasAptidao.ID_INDEX: + value = this.id; + break; + case TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX: + value = this.processo_id; + break; + case TrabalhadoresFichasAptidao.TO_PROCESSO_ID_INDEX: + value = this.to_processo_id; + break; + case TrabalhadoresFichasAptidao.EXAME_ID_INDEX: + value = this.exame_id; + break; + case TrabalhadoresFichasAptidao.TO_EXAME_ID_INDEX: + value = this.to_exame_id; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresFichasAptidao.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX: + setProcesso_id( ( Integer ) value ); + break; + case TrabalhadoresFichasAptidao.TO_PROCESSO_ID_INDEX: + setToProcesso_id( ( db.data.siprp_local.outer.TrabalhadoresProcessoData ) value ); + break; + case TrabalhadoresFichasAptidao.EXAME_ID_INDEX: + setExame_id( ( Integer ) value ); + break; + case TrabalhadoresFichasAptidao.TO_EXAME_ID_INDEX: + setToExame_id( ( db.data.siprp_local.outer.ExamesData ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresFichasAptidao.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX: + this.processo_id = ( Integer ) value; + break; + case TrabalhadoresFichasAptidao.TO_PROCESSO_ID_INDEX: + this.to_processo_id = ( db.data.siprp_local.outer.TrabalhadoresProcessoData ) value; + break; + case TrabalhadoresFichasAptidao.EXAME_ID_INDEX: + this.exame_id = ( Integer ) value; + break; + case TrabalhadoresFichasAptidao.TO_EXAME_ID_INDEX: + this.to_exame_id = ( db.data.siprp_local.outer.ExamesData ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresFichasAptidao.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresFichasAptidao.PROCESSO_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresFichasAptidao.TO_PROCESSO_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresProcessoData.class; + break; + case TrabalhadoresFichasAptidao.EXAME_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresFichasAptidao.TO_EXAME_ID_INDEX: + theClass = db.data.siprp_local.outer.ExamesData.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresFichasAptidao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresFichasAptidao.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresProcesso.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresProcesso.java new file mode 100644 index 00000000..87236b9f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/TrabalhadoresProcesso.java @@ -0,0 +1,675 @@ +/* +* TrabalhadoresProcesso.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class TrabalhadoresProcesso extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( TrabalhadoresProcesso.ID, TrabalhadoresProcesso.ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.ID_FULL, TrabalhadoresProcesso.ID_INDEX ); + com.evolute.entity.evo.EvoDataObject.register( TrabalhadoresProcesso.CLASS_IDENTIFIER, TrabalhadoresProcesso.TRABALHADOR_ID, TrabalhadoresProcesso.TO_TRABALHADOR_ID ); + FIELD_INDEXES.put( TrabalhadoresProcesso.TRABALHADOR_ID, TrabalhadoresProcesso.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.TRABALHADOR_ID_FULL, TrabalhadoresProcesso.TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.TO_TRABALHADOR_ID, TrabalhadoresProcesso.TO_TRABALHADOR_ID_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.ESTADO, TrabalhadoresProcesso.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.ESTADO_FULL, TrabalhadoresProcesso.ESTADO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.DATA_INICIO, TrabalhadoresProcesso.DATA_INICIO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.DATA_INICIO_FULL, TrabalhadoresProcesso.DATA_INICIO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.DATA_FIM, TrabalhadoresProcesso.DATA_FIM_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.DATA_FIM_FULL, TrabalhadoresProcesso.DATA_FIM_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.MOTIVO, TrabalhadoresProcesso.MOTIVO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.MOTIVO_FULL, TrabalhadoresProcesso.MOTIVO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.SUB_MOTIVO, TrabalhadoresProcesso.SUB_MOTIVO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.SUB_MOTIVO_FULL, TrabalhadoresProcesso.SUB_MOTIVO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.ACTIVO, TrabalhadoresProcesso.ACTIVO_INDEX ); + FIELD_INDEXES.put( TrabalhadoresProcesso.ACTIVO_FULL, TrabalhadoresProcesso.ACTIVO_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final com.evolute.entity.ForeignKey ForeignKeytrabalhador_idTotrabalhadores = + new com.evolute.entity.ForeignKey( TrabalhadoresProcesso.class, TrabalhadoresProcesso.TRABALHADOR_ID, db.data.siprp_local.outer.TrabalhadoresData.class, db.data.siprp_local.outer.TrabalhadoresData.ID ); + + public static final String TABLENAME = "trabalhadores_processo"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.trabalhadores_processo"; + + public static final int _INVALID__INDEX = -1; + public static final String ID = "id"; + public static final String ID_FULL = "trabalhadores_processo.id"; + public static final int ID_INDEX = 0; + public static final String TRABALHADOR_ID = "trabalhador_id"; + public static final String TRABALHADOR_ID_FULL = "trabalhadores_processo.trabalhador_id"; + public static final int TRABALHADOR_ID_INDEX = 1; + public static final String TO_TRABALHADOR_ID = "to_trabalhador_id"; + public static final String TO_TRABALHADOR_ID_FULL = "trabalhadores_processo.to_trabalhador_id"; + public static final int TO_TRABALHADOR_ID_INDEX = 2; + public static final String ESTADO = "estado"; + public static final String ESTADO_FULL = "trabalhadores_processo.estado"; + public static final int ESTADO_INDEX = 3; + public static final String DATA_INICIO = "data_inicio"; + public static final String DATA_INICIO_FULL = "trabalhadores_processo.data_inicio"; + public static final int DATA_INICIO_INDEX = 4; + public static final String DATA_FIM = "data_fim"; + public static final String DATA_FIM_FULL = "trabalhadores_processo.data_fim"; + public static final int DATA_FIM_INDEX = 5; + public static final String MOTIVO = "motivo"; + public static final String MOTIVO_FULL = "trabalhadores_processo.motivo"; + public static final int MOTIVO_INDEX = 6; + public static final String SUB_MOTIVO = "sub_motivo"; + public static final String SUB_MOTIVO_FULL = "trabalhadores_processo.sub_motivo"; + public static final int SUB_MOTIVO_INDEX = 7; + public static final String ACTIVO = "activo"; + public static final String ACTIVO_FULL = "trabalhadores_processo.activo"; + public static final int ACTIVO_INDEX = 8; + + public static final String FIELD_NAMES[] = new String[]{ + TRABALHADOR_ID, TO_TRABALHADOR_ID, ESTADO, DATA_INICIO, DATA_FIM, MOTIVO, + SUB_MOTIVO, ACTIVO, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + TRABALHADOR_ID, TABLENAME + "." + TO_TRABALHADOR_ID, TABLENAME + "." + ESTADO, TABLENAME + "." + DATA_INICIO, TABLENAME + "." + DATA_FIM, TABLENAME + "." + MOTIVO, + TABLENAME + "." + SUB_MOTIVO, TABLENAME + "." + ACTIVO, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + ID, TRABALHADOR_ID, ESTADO, DATA_INICIO, DATA_FIM, MOTIVO, SUB_MOTIVO, ACTIVO, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + ID, TRABALHADOR_ID, ESTADO, DATA_INICIO, DATA_FIM, MOTIVO, SUB_MOTIVO, ACTIVO, }; + + private Integer id; + private Integer trabalhador_id; + private db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id; + private String estado; + private java.util.Date data_inicio; + private java.util.Date data_fim; + private Integer motivo; + private Integer sub_motivo; + private String activo; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public TrabalhadoresProcesso() + { + super(); + dirtyProperties = new boolean[]{ false, false, false, + false, false, false, false, false, false }; + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public java.util.ListfromTrabalhadoresConsultas_processo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresConsultasData.class , getPrimaryKey().getMap().get("id"), "processo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresEcds_processo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresEcdsData.class , getPrimaryKey().getMap().get("id"), "processo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public java.util.ListfromTrabalhadoresFichasAptidao_processo_id() + { + java.util.List result = null; + try + { + result = fromReference( db.data.siprp_local.outer.TrabalhadoresFichasAptidaoData.class , getPrimaryKey().getMap().get("id"), "processo_id" ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return result; + } + + public Integer getTrabalhador_id() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( TRABALHADOR_ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.trabalhador_id; + } + + public void setTrabalhador_id( Integer trabalhador_id ) + { + try + { + setLockedForRefresh( true ); + preProcess( TRABALHADOR_ID, trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.trabalhador_id = trabalhador_id; + LAZY_LOADED_OBJECTS.put( TRABALHADOR_ID, Boolean.TRUE ); + } + + public db.data.siprp_local.outer.TrabalhadoresData toTrabalhador_id() + { + try + { + prepare( TO_TRABALHADOR_ID ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + return this.to_trabalhador_id; + } + + public void setToTrabalhador_id( db.data.siprp_local.outer.TrabalhadoresData to_trabalhador_id ) + { + try + { + preProcess( TO_TRABALHADOR_ID, to_trabalhador_id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.to_trabalhador_id = to_trabalhador_id; + } + + public String getEstado() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ESTADO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.estado; + } + + public void setEstado( String estado ) + { + try + { + setLockedForRefresh( true ); + preProcess( ESTADO, estado ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.estado = estado; + LAZY_LOADED_OBJECTS.put( ESTADO, Boolean.TRUE ); + } + + public java.util.Date getData_inicio() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_INICIO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_inicio; + } + + public void setData_inicio( java.util.Date data_inicio ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_INICIO, data_inicio ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_inicio = data_inicio; + LAZY_LOADED_OBJECTS.put( DATA_INICIO, Boolean.TRUE ); + } + + public java.util.Date getData_fim() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( DATA_FIM ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.data_fim; + } + + public void setData_fim( java.util.Date data_fim ) + { + try + { + setLockedForRefresh( true ); + preProcess( DATA_FIM, data_fim ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.data_fim = data_fim; + LAZY_LOADED_OBJECTS.put( DATA_FIM, Boolean.TRUE ); + } + + public Integer getMotivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MOTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.motivo; + } + + public void setMotivo( Integer motivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( MOTIVO, motivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.motivo = motivo; + LAZY_LOADED_OBJECTS.put( MOTIVO, Boolean.TRUE ); + } + + public Integer getSub_motivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( SUB_MOTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.sub_motivo; + } + + public void setSub_motivo( Integer sub_motivo ) + { + try + { + setLockedForRefresh( true ); + preProcess( SUB_MOTIVO, sub_motivo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.sub_motivo = sub_motivo; + LAZY_LOADED_OBJECTS.put( SUB_MOTIVO, Boolean.TRUE ); + } + + public String getActivo() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ACTIVO ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.activo; + } + + public void setActivo( String activo ) + { + try + { + setLockedForRefresh( true ); + preProcess( ACTIVO, activo ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.activo = activo; + LAZY_LOADED_OBJECTS.put( ACTIVO, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresProcesso.ID_INDEX: + value = getId(); + break; + case TrabalhadoresProcesso.TRABALHADOR_ID_INDEX: + value = getTrabalhador_id(); + break; + case TrabalhadoresProcesso.TO_TRABALHADOR_ID_INDEX: + value = toTrabalhador_id(); + break; + case TrabalhadoresProcesso.ESTADO_INDEX: + value = getEstado(); + break; + case TrabalhadoresProcesso.DATA_INICIO_INDEX: + value = getData_inicio(); + break; + case TrabalhadoresProcesso.DATA_FIM_INDEX: + value = getData_fim(); + break; + case TrabalhadoresProcesso.MOTIVO_INDEX: + value = getMotivo(); + break; + case TrabalhadoresProcesso.SUB_MOTIVO_INDEX: + value = getSub_motivo(); + break; + case TrabalhadoresProcesso.ACTIVO_INDEX: + value = getActivo(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresProcesso.ID_INDEX: + value = this.id; + break; + case TrabalhadoresProcesso.TRABALHADOR_ID_INDEX: + value = this.trabalhador_id; + break; + case TrabalhadoresProcesso.TO_TRABALHADOR_ID_INDEX: + value = this.to_trabalhador_id; + break; + case TrabalhadoresProcesso.ESTADO_INDEX: + value = this.estado; + break; + case TrabalhadoresProcesso.DATA_INICIO_INDEX: + value = this.data_inicio; + break; + case TrabalhadoresProcesso.DATA_FIM_INDEX: + value = this.data_fim; + break; + case TrabalhadoresProcesso.MOTIVO_INDEX: + value = this.motivo; + break; + case TrabalhadoresProcesso.SUB_MOTIVO_INDEX: + value = this.sub_motivo; + break; + case TrabalhadoresProcesso.ACTIVO_INDEX: + value = this.activo; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresProcesso.ID_INDEX: + setId( ( Integer ) value ); + break; + case TrabalhadoresProcesso.TRABALHADOR_ID_INDEX: + setTrabalhador_id( ( Integer ) value ); + break; + case TrabalhadoresProcesso.TO_TRABALHADOR_ID_INDEX: + setToTrabalhador_id( ( db.data.siprp_local.outer.TrabalhadoresData ) value ); + break; + case TrabalhadoresProcesso.ESTADO_INDEX: + setEstado( ( String ) value ); + break; + case TrabalhadoresProcesso.DATA_INICIO_INDEX: + setData_inicio( ( java.util.Date ) value ); + break; + case TrabalhadoresProcesso.DATA_FIM_INDEX: + setData_fim( ( java.util.Date ) value ); + break; + case TrabalhadoresProcesso.MOTIVO_INDEX: + setMotivo( ( Integer ) value ); + break; + case TrabalhadoresProcesso.SUB_MOTIVO_INDEX: + setSub_motivo( ( Integer ) value ); + break; + case TrabalhadoresProcesso.ACTIVO_INDEX: + setActivo( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case TrabalhadoresProcesso.ID_INDEX: + this.id = ( Integer ) value; + break; + case TrabalhadoresProcesso.TRABALHADOR_ID_INDEX: + this.trabalhador_id = ( Integer ) value; + break; + case TrabalhadoresProcesso.TO_TRABALHADOR_ID_INDEX: + this.to_trabalhador_id = ( db.data.siprp_local.outer.TrabalhadoresData ) value; + break; + case TrabalhadoresProcesso.ESTADO_INDEX: + this.estado = ( String ) value; + break; + case TrabalhadoresProcesso.DATA_INICIO_INDEX: + this.data_inicio = ( java.util.Date ) value; + break; + case TrabalhadoresProcesso.DATA_FIM_INDEX: + this.data_fim = ( java.util.Date ) value; + break; + case TrabalhadoresProcesso.MOTIVO_INDEX: + this.motivo = ( Integer ) value; + break; + case TrabalhadoresProcesso.SUB_MOTIVO_INDEX: + this.sub_motivo = ( Integer ) value; + break; + case TrabalhadoresProcesso.ACTIVO_INDEX: + this.activo = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case TrabalhadoresProcesso.ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresProcesso.TRABALHADOR_ID_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresProcesso.TO_TRABALHADOR_ID_INDEX: + theClass = db.data.siprp_local.outer.TrabalhadoresData.class; + break; + case TrabalhadoresProcesso.ESTADO_INDEX: + theClass = String.class; + break; + case TrabalhadoresProcesso.DATA_INICIO_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresProcesso.DATA_FIM_INDEX: + theClass = java.util.Date.class; + break; + case TrabalhadoresProcesso.MOTIVO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresProcesso.SUB_MOTIVO_INDEX: + theClass = Integer.class; + break; + case TrabalhadoresProcesso.ACTIVO_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : TrabalhadoresProcesso._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, TrabalhadoresProcesso.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Versao.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Versao.java new file mode 100644 index 00000000..37bb6d94 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Versao.java @@ -0,0 +1,178 @@ +/* +* Versao.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Versao extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "versao"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.versao"; + + public static final int _INVALID__INDEX = -1; + + public static final String FIELD_NAMES[] = new String[]{ + }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + }; + + + protected com.evolute.entity.utils.ObjectPrimaryKey primaryKey; + + public Versao() + { + super(); + dirtyProperties = new boolean[]{ }; + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + throw new RuntimeException( "getPrimaryKeyName on Versao is invalid" ); + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Versao._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.ObjectPrimaryKey( TABLENAME, Versao.PK_FIELD_NAMES ); + } + } + + @Override + public com.evolute.entity.utils.ObjectPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Version.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Version.java new file mode 100644 index 00000000..5c74c9d0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/Version.java @@ -0,0 +1,330 @@ +/* +* Version.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Use but DON'T TOUCH +* -> (can't touch this) +*/ +package db.data.siprp_local.inner; + + +public class Version extends com.evolute.entity.evo.EvoDataObject +{ + private static final java.util.HashMap FIELD_INDEXES = new java.util.HashMap(); + + static + { + FIELD_INDEXES.put( Version.CURRENT_VERSION, Version.CURRENT_VERSION_INDEX ); + FIELD_INDEXES.put( Version.CURRENT_VERSION_FULL, Version.CURRENT_VERSION_INDEX ); + FIELD_INDEXES.put( Version.ID, Version.ID_INDEX ); + FIELD_INDEXES.put( Version.ID_FULL, Version.ID_INDEX ); + FIELD_INDEXES.put( Version.MODULE_NAME, Version.MODULE_NAME_INDEX ); + FIELD_INDEXES.put( Version.MODULE_NAME_FULL, Version.MODULE_NAME_INDEX ); + } + + private final java.util.HashMap< String, Boolean > LAZY_LOADED_OBJECTS = new java.util.HashMap< String, Boolean >(); + + + public static final String TABLENAME = "version"; + + + public static final String CLASS_IDENTIFIER = "db.data.siprp_local.inner.version"; + + public static final int _INVALID__INDEX = -1; + public static final String CURRENT_VERSION = "current_version"; + public static final String CURRENT_VERSION_FULL = "version.current_version"; + public static final int CURRENT_VERSION_INDEX = 0; + public static final String ID = "id"; + public static final String ID_FULL = "version.id"; + public static final int ID_INDEX = 1; + public static final String MODULE_NAME = "module_name"; + public static final String MODULE_NAME_FULL = "version.module_name"; + public static final int MODULE_NAME_INDEX = 2; + + public static final String FIELD_NAMES[] = new String[]{ + CURRENT_VERSION, MODULE_NAME, }; + + public static final String FIELD_NAMES_FULL[] = new String[]{ + TABLENAME + "." + CURRENT_VERSION, TABLENAME + "." + MODULE_NAME, }; + + protected static final String DB_FIELD_NAMES[] = new String[]{ + CURRENT_VERSION, ID, MODULE_NAME, }; + + + protected static final String PK_FIELD_NAMES[] = new String[]{ + ID, }; + + + public static final String DEFAULT_LOAD_SET[] = new String[] { + CURRENT_VERSION, ID, MODULE_NAME, }; + + private Double current_version; + private Integer id; + private String module_name; + + protected com.evolute.entity.utils.IntegerPrimaryKey primaryKey; + + public Version() + { + super(); + dirtyProperties = new boolean[]{ false, false, false }; + } + + public Double getCurrent_version() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( CURRENT_VERSION ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.current_version; + } + + public void setCurrent_version( Double current_version ) + { + try + { + setLockedForRefresh( true ); + preProcess( CURRENT_VERSION, current_version ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.current_version = current_version; + LAZY_LOADED_OBJECTS.put( CURRENT_VERSION, Boolean.TRUE ); + } + + public Integer getId() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( ID ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.id; + } + + public void setId( Integer id ) + { + try + { + setLockedForRefresh( true ); + preProcess( ID, id ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.id = id; + LAZY_LOADED_OBJECTS.put( ID, Boolean.TRUE ); + } + + public String getModule_name() + { + try + { + setLastAccess( System.currentTimeMillis() ); + prepare( MODULE_NAME ); + } + catch( java.lang.Exception ex ) + { + throw new RuntimeException( ex ); + } + return this.module_name; + } + + public void setModule_name( String module_name ) + { + try + { + setLockedForRefresh( true ); + preProcess( MODULE_NAME, module_name ); + } + catch( com.evolute.entity.evo.EvoDataException edex ) + { + throw new RuntimeException( edex ); + } + this.module_name = module_name; + LAZY_LOADED_OBJECTS.put( MODULE_NAME, Boolean.TRUE ); + } + + public Object get( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + value = getCurrent_version(); + break; + case Version.ID_INDEX: + value = getId(); + break; + case Version.MODULE_NAME_INDEX: + value = getModule_name(); + break; + } + return value; + } + + public Object rawGet( String fieldName ) + { + Object value = null; + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + value = this.current_version; + break; + case Version.ID_INDEX: + value = this.id; + break; + case Version.MODULE_NAME_INDEX: + value = this.module_name; + break; + } + return value; + } + + public void set( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + setCurrent_version( ( Double ) value ); + break; + case Version.ID_INDEX: + setId( ( Integer ) value ); + break; + case Version.MODULE_NAME_INDEX: + setModule_name( ( String ) value ); + break; + } + } + + public void rawSet( String fieldName, Object value ) + { + Integer index = getFieldIndex( fieldName ); + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + this.current_version = ( Double ) value; + break; + case Version.ID_INDEX: + this.id = ( Integer ) value; + break; + case Version.MODULE_NAME_INDEX: + this.module_name = ( String ) value; + break; + } + } + + public String []getFieldNames() + { + return FIELD_NAMES; + } + + public String []getFieldNamesFull() + { + return FIELD_NAMES_FULL; + } + + public String []getDBFieldNames() + { + return DB_FIELD_NAMES; + } + + public String []getPrimaryKeyNames() + { + return PK_FIELD_NAMES; + } + + public String []getDefaultLoadSet() + { + return DEFAULT_LOAD_SET; + } + + public String getPrimaryKeyName() + { + return PK_FIELD_NAMES[ 0 ]; + } + + public Class getFieldClass( String fieldName ) + { + Integer index = getFieldIndex( fieldName ); + Class theClass = null; + switch( index ) + { + case Version.CURRENT_VERSION_INDEX: + theClass = Double.class; + break; + case Version.ID_INDEX: + theClass = Integer.class; + break; + case Version.MODULE_NAME_INDEX: + theClass = String.class; + break; + } + return theClass; + } + + public Integer getFieldIndex( String fieldName ) + { + Integer index = FIELD_INDEXES.get( fieldName ); + return index != null ? index : Version._INVALID__INDEX; + } + + public String getTableName() + { + return TABLENAME; + } + + public String getClassIdentifier() + { + return CLASS_IDENTIFIER; + } + + @Override + protected void setPrimaryKeyFromVirtual2DArray( com.evolute.utils.arrays.Virtual2DArray array, int row, int col ) + { + if( primaryKey == null ) + { + primaryKey = new com.evolute.entity.utils.IntegerPrimaryKey( TABLENAME, Version.PK_FIELD_NAMES ); + primaryKey.set( 0, ( Integer ) array.get( row, col + 0 ) ); + } + setId( ( Integer ) array.get( row, col + 0 ) ); + } + + @Override + public com.evolute.entity.utils.IntegerPrimaryKey getPrimaryKey() + { + return primaryKey; + } + + public void initLazyLoadFields() + { + } + + public boolean isPropertyLoaded( String fieldName ) + { + if ( LAZY_LOADED_OBJECTS.get( fieldName ) == null ) + { + return true; + } + else + { + return LAZY_LOADED_OBJECTS.get( fieldName ); + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/package.xml b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/package.xml new file mode 100644 index 00000000..b4c99ea6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/inner/package.xml @@ -0,0 +1,3341 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ActualizacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ActualizacaoData.java new file mode 100644 index 00000000..0c20f558 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ActualizacaoData.java @@ -0,0 +1,18 @@ +/* +* ActualizacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ActualizacaoData extends db.data.siprp_local.inner.Actualizacao +{ + + public ActualizacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptAppointmentData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptAppointmentData.java new file mode 100644 index 00000000..29449f4a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptAppointmentData.java @@ -0,0 +1,18 @@ +/* +* AptAppointmentData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class AptAppointmentData extends db.data.siprp_local.inner.AptAppointment +{ + + public AptAppointmentData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptSegurancaAlimentarData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptSegurancaAlimentarData.java new file mode 100644 index 00000000..56f9d6f3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptSegurancaAlimentarData.java @@ -0,0 +1,18 @@ +/* +* AptSegurancaAlimentarData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class AptSegurancaAlimentarData extends db.data.siprp_local.inner.AptSegurancaAlimentar +{ + + public AptSegurancaAlimentarData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptStateData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptStateData.java new file mode 100644 index 00000000..5a80373c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AptStateData.java @@ -0,0 +1,18 @@ +/* +* AptStateData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class AptStateData extends db.data.siprp_local.inner.AptState +{ + + public AptStateData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AvisosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AvisosData.java new file mode 100644 index 00000000..be35e00d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/AvisosData.java @@ -0,0 +1,18 @@ +/* +* AvisosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class AvisosData extends db.data.siprp_local.inner.Avisos +{ + + public AvisosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ContactosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ContactosData.java new file mode 100644 index 00000000..dcf0758f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ContactosData.java @@ -0,0 +1,18 @@ +/* +* ContactosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ContactosData extends db.data.siprp_local.inner.Contactos +{ + + public ContactosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurArsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurArsData.java new file mode 100644 index 00000000..7c4caa4e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurArsData.java @@ -0,0 +1,18 @@ +/* +* CurArsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurArsData extends db.data.siprp_local.inner.CurArs +{ + + public CurArsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurAulasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurAulasData.java new file mode 100644 index 00000000..27442b59 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurAulasData.java @@ -0,0 +1,18 @@ +/* +* CurAulasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurAulasData extends db.data.siprp_local.inner.CurAulas +{ + + public CurAulasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurAulasFormadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurAulasFormadoresData.java new file mode 100644 index 00000000..e5a75b70 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurAulasFormadoresData.java @@ -0,0 +1,18 @@ +/* +* CurAulasFormadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurAulasFormadoresData extends db.data.siprp_local.inner.CurAulasFormadores +{ + + public CurAulasFormadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurCursosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurCursosData.java new file mode 100644 index 00000000..0c8a4328 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurCursosData.java @@ -0,0 +1,18 @@ +/* +* CurCursosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurCursosData extends db.data.siprp_local.inner.CurCursos +{ + + public CurCursosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurDiasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurDiasData.java new file mode 100644 index 00000000..cffa22c6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurDiasData.java @@ -0,0 +1,18 @@ +/* +* CurDiasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurDiasData extends db.data.siprp_local.inner.CurDias +{ + + public CurDiasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormadoresCursosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormadoresCursosData.java new file mode 100644 index 00000000..68fa9681 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormadoresCursosData.java @@ -0,0 +1,18 @@ +/* +* CurFormadoresCursosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurFormadoresCursosData extends db.data.siprp_local.inner.CurFormadoresCursos +{ + + public CurFormadoresCursosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormadoresData.java new file mode 100644 index 00000000..f4179b43 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormadoresData.java @@ -0,0 +1,18 @@ +/* +* CurFormadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurFormadoresData extends db.data.siprp_local.inner.CurFormadores +{ + + public CurFormadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormandosCursosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormandosCursosData.java new file mode 100644 index 00000000..404428ba --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormandosCursosData.java @@ -0,0 +1,18 @@ +/* +* CurFormandosCursosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurFormandosCursosData extends db.data.siprp_local.inner.CurFormandosCursos +{ + + public CurFormandosCursosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormandosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormandosData.java new file mode 100644 index 00000000..513befc5 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurFormandosData.java @@ -0,0 +1,18 @@ +/* +* CurFormandosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurFormandosData extends db.data.siprp_local.inner.CurFormandos +{ + + public CurFormandosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurHospitaisData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurHospitaisData.java new file mode 100644 index 00000000..d241c7f3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurHospitaisData.java @@ -0,0 +1,18 @@ +/* +* CurHospitaisData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurHospitaisData extends db.data.siprp_local.inner.CurHospitais +{ + + public CurHospitaisData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurNumeroCertificadoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurNumeroCertificadoData.java new file mode 100644 index 00000000..5562388b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurNumeroCertificadoData.java @@ -0,0 +1,18 @@ +/* +* CurNumeroCertificadoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurNumeroCertificadoData extends db.data.siprp_local.inner.CurNumeroCertificado +{ + + public CurNumeroCertificadoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurNumeroCertificadoFormadorData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurNumeroCertificadoFormadorData.java new file mode 100644 index 00000000..2449c28f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurNumeroCertificadoFormadorData.java @@ -0,0 +1,18 @@ +/* +* CurNumeroCertificadoFormadorData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurNumeroCertificadoFormadorData extends db.data.siprp_local.inner.CurNumeroCertificadoFormador +{ + + public CurNumeroCertificadoFormadorData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPagamentosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPagamentosData.java new file mode 100644 index 00000000..ce2a1f96 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPagamentosData.java @@ -0,0 +1,18 @@ +/* +* CurPagamentosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurPagamentosData extends db.data.siprp_local.inner.CurPagamentos +{ + + public CurPagamentosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPagamentosTiposData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPagamentosTiposData.java new file mode 100644 index 00000000..c29b5d0d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPagamentosTiposData.java @@ -0,0 +1,18 @@ +/* +* CurPagamentosTiposData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurPagamentosTiposData extends db.data.siprp_local.inner.CurPagamentosTipos +{ + + public CurPagamentosTiposData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPresencasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPresencasData.java new file mode 100644 index 00000000..40b63317 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurPresencasData.java @@ -0,0 +1,18 @@ +/* +* CurPresencasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurPresencasData extends db.data.siprp_local.inner.CurPresencas +{ + + public CurPresencasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurTopicosAulasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurTopicosAulasData.java new file mode 100644 index 00000000..966ad307 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurTopicosAulasData.java @@ -0,0 +1,18 @@ +/* +* CurTopicosAulasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurTopicosAulasData extends db.data.siprp_local.inner.CurTopicosAulas +{ + + public CurTopicosAulasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurTopicosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurTopicosData.java new file mode 100644 index 00000000..7f565b61 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/CurTopicosData.java @@ -0,0 +1,18 @@ +/* +* CurTopicosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class CurTopicosData extends db.data.siprp_local.inner.CurTopicos +{ + + public CurTopicosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EcdOficialData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EcdOficialData.java new file mode 100644 index 00000000..69291a55 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EcdOficialData.java @@ -0,0 +1,18 @@ +/* +* EcdOficialData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EcdOficialData extends db.data.siprp_local.inner.EcdOficial +{ + + public EcdOficialData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmailPlanoDeActuacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmailPlanoDeActuacaoData.java new file mode 100644 index 00000000..e251a8bd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmailPlanoDeActuacaoData.java @@ -0,0 +1,18 @@ +/* +* EmailPlanoDeActuacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EmailPlanoDeActuacaoData extends db.data.siprp_local.inner.EmailPlanoDeActuacao +{ + + public EmailPlanoDeActuacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoPeriodicidadeTipoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoPeriodicidadeTipoData.java new file mode 100644 index 00000000..57479c87 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoPeriodicidadeTipoData.java @@ -0,0 +1,18 @@ +/* +* EmpresaPrecoPeriodicidadeTipoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EmpresaPrecoPeriodicidadeTipoData extends db.data.siprp_local.inner.EmpresaPrecoPeriodicidadeTipo +{ + + public EmpresaPrecoPeriodicidadeTipoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoServicoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoServicoData.java new file mode 100644 index 00000000..1392ad33 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoServicoData.java @@ -0,0 +1,18 @@ +/* +* EmpresaPrecoServicoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EmpresaPrecoServicoData extends db.data.siprp_local.inner.EmpresaPrecoServico +{ + + public EmpresaPrecoServicoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoServicoTipoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoServicoTipoData.java new file mode 100644 index 00000000..dc8d6935 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresaPrecoServicoTipoData.java @@ -0,0 +1,18 @@ +/* +* EmpresaPrecoServicoTipoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EmpresaPrecoServicoTipoData extends db.data.siprp_local.inner.EmpresaPrecoServicoTipo +{ + + public EmpresaPrecoServicoTipoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresasData.java new file mode 100644 index 00000000..4ca2924a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EmpresasData.java @@ -0,0 +1,18 @@ +/* +* EmpresasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EmpresasData extends db.data.siprp_local.inner.Empresas +{ + + public EmpresasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ErrorsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ErrorsData.java new file mode 100644 index 00000000..001f926d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ErrorsData.java @@ -0,0 +1,18 @@ +/* +* ErrorsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ErrorsData extends db.data.siprp_local.inner.Errors +{ + + public ErrorsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EstabelecimentosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EstabelecimentosData.java new file mode 100644 index 00000000..0c2ef031 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EstabelecimentosData.java @@ -0,0 +1,18 @@ +/* +* EstabelecimentosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EstabelecimentosData extends db.data.siprp_local.inner.Estabelecimentos +{ + + public EstabelecimentosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EtiquetasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EtiquetasData.java new file mode 100644 index 00000000..f5cc4335 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EtiquetasData.java @@ -0,0 +1,18 @@ +/* +* EtiquetasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EtiquetasData extends db.data.siprp_local.inner.Etiquetas +{ + + public EtiquetasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoPessoaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoPessoaData.java new file mode 100644 index 00000000..c8ace64c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoPessoaData.java @@ -0,0 +1,18 @@ +/* +* EvoPessoaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoPessoaData extends db.data.siprp_local.inner.EvoPessoa +{ + + public EvoPessoaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUpdateData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUpdateData.java new file mode 100644 index 00000000..2549cd82 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUpdateData.java @@ -0,0 +1,18 @@ +/* +* EvoUpdateData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoUpdateData extends db.data.siprp_local.inner.EvoUpdate +{ + + public EvoUpdateData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrPermissionData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrPermissionData.java new file mode 100644 index 00000000..0a773f45 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrPermissionData.java @@ -0,0 +1,18 @@ +/* +* EvoUsrPermissionData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoUsrPermissionData extends db.data.siprp_local.inner.EvoUsrPermission +{ + + public EvoUsrPermissionData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrRoleData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrRoleData.java new file mode 100644 index 00000000..afa56c6d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrRoleData.java @@ -0,0 +1,18 @@ +/* +* EvoUsrRoleData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoUsrRoleData extends db.data.siprp_local.inner.EvoUsrRole +{ + + public EvoUsrRoleData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrRolesPermissionsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrRolesPermissionsData.java new file mode 100644 index 00000000..a2d78b95 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrRolesPermissionsData.java @@ -0,0 +1,18 @@ +/* +* EvoUsrRolesPermissionsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoUsrRolesPermissionsData extends db.data.siprp_local.inner.EvoUsrRolesPermissions +{ + + public EvoUsrRolesPermissionsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrUserData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrUserData.java new file mode 100644 index 00000000..262fde8a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrUserData.java @@ -0,0 +1,18 @@ +/* +* EvoUsrUserData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoUsrUserData extends db.data.siprp_local.inner.EvoUsrUser +{ + + public EvoUsrUserData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrUsersRolesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrUsersRolesData.java new file mode 100644 index 00000000..d0842712 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/EvoUsrUsersRolesData.java @@ -0,0 +1,18 @@ +/* +* EvoUsrUsersRolesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class EvoUsrUsersRolesData extends db.data.siprp_local.inner.EvoUsrUsersRoles +{ + + public EvoUsrUsersRolesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesData.java new file mode 100644 index 00000000..fb4cf9b9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesData.java @@ -0,0 +1,18 @@ +/* +* ExamesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ExamesData extends db.data.siprp_local.inner.Exames +{ + + public ExamesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesPerfisData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesPerfisData.java new file mode 100644 index 00000000..cf9aabc9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesPerfisData.java @@ -0,0 +1,18 @@ +/* +* ExamesPerfisData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ExamesPerfisData extends db.data.siprp_local.inner.ExamesPerfis +{ + + public ExamesPerfisData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesPortariaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesPortariaData.java new file mode 100644 index 00000000..ade72d19 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ExamesPortariaData.java @@ -0,0 +1,18 @@ +/* +* ExamesPortariaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ExamesPortariaData extends db.data.siprp_local.inner.ExamesPortaria +{ + + public ExamesPortariaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/FilFileAppointmentData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/FilFileAppointmentData.java new file mode 100644 index 00000000..4ec472cf --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/FilFileAppointmentData.java @@ -0,0 +1,18 @@ +/* +* FilFileAppointmentData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class FilFileAppointmentData extends db.data.siprp_local.inner.FilFileAppointment +{ + + public FilFileAppointmentData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/FilFileData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/FilFileData.java new file mode 100644 index 00000000..40fefdcf --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/FilFileData.java @@ -0,0 +1,18 @@ +/* +* FilFileData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class FilFileData extends db.data.siprp_local.inner.FilFile +{ + + public FilFileData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HistoricoEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HistoricoEstabelecimentoData.java new file mode 100644 index 00000000..34a8e0b7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HistoricoEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* HistoricoEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HistoricoEstabelecimentoData extends db.data.siprp_local.inner.HistoricoEstabelecimento +{ + + public HistoricoEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsAreaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsAreaData.java new file mode 100644 index 00000000..d096fdfd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsAreaData.java @@ -0,0 +1,18 @@ +/* +* HsAreaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsAreaData extends db.data.siprp_local.inner.HsArea +{ + + public HsAreaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailData.java new file mode 100644 index 00000000..8ca79d85 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailData.java @@ -0,0 +1,18 @@ +/* +* HsEmailData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsEmailData extends db.data.siprp_local.inner.HsEmail +{ + + public HsEmailData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailEmpresaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailEmpresaData.java new file mode 100644 index 00000000..8e1489ee --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailEmpresaData.java @@ -0,0 +1,18 @@ +/* +* HsEmailEmpresaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsEmailEmpresaData extends db.data.siprp_local.inner.HsEmailEmpresa +{ + + public HsEmailEmpresaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailEstabelecimentoData.java new file mode 100644 index 00000000..67b053a9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEmailEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* HsEmailEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsEmailEstabelecimentoData extends db.data.siprp_local.inner.HsEmailEstabelecimento +{ + + public HsEmailEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEquipamentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEquipamentoData.java new file mode 100644 index 00000000..fc253f7f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsEquipamentoData.java @@ -0,0 +1,18 @@ +/* +* HsEquipamentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsEquipamentoData extends db.data.siprp_local.inner.HsEquipamento +{ + + public HsEquipamentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoCategoriaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoCategoriaData.java new file mode 100644 index 00000000..50fc7216 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoCategoriaData.java @@ -0,0 +1,18 @@ +/* +* HsLegislacaoCategoriaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsLegislacaoCategoriaData extends db.data.siprp_local.inner.HsLegislacaoCategoria +{ + + public HsLegislacaoCategoriaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoData.java new file mode 100644 index 00000000..d67e3767 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoData.java @@ -0,0 +1,18 @@ +/* +* HsLegislacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsLegislacaoData extends db.data.siprp_local.inner.HsLegislacao +{ + + public HsLegislacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoEmpresaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoEmpresaData.java new file mode 100644 index 00000000..f4318e06 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoEmpresaData.java @@ -0,0 +1,18 @@ +/* +* HsLegislacaoEmpresaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsLegislacaoEmpresaData extends db.data.siprp_local.inner.HsLegislacaoEmpresa +{ + + public HsLegislacaoEmpresaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoEstabelecimentoData.java new file mode 100644 index 00000000..d9564909 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsLegislacaoEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* HsLegislacaoEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsLegislacaoEstabelecimentoData extends db.data.siprp_local.inner.HsLegislacaoEstabelecimento +{ + + public HsLegislacaoEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsMedidaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsMedidaData.java new file mode 100644 index 00000000..4b15e2bd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsMedidaData.java @@ -0,0 +1,18 @@ +/* +* HsMedidaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsMedidaData extends db.data.siprp_local.inner.HsMedida +{ + + public HsMedidaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoData.java new file mode 100644 index 00000000..32beaebd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoData.java @@ -0,0 +1,18 @@ +/* +* HsNormalizacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsNormalizacaoData extends db.data.siprp_local.inner.HsNormalizacao +{ + + public HsNormalizacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoEmpresaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoEmpresaData.java new file mode 100644 index 00000000..b67fc3c1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoEmpresaData.java @@ -0,0 +1,18 @@ +/* +* HsNormalizacaoEmpresaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsNormalizacaoEmpresaData extends db.data.siprp_local.inner.HsNormalizacaoEmpresa +{ + + public HsNormalizacaoEmpresaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoEstabelecimentoData.java new file mode 100644 index 00000000..7b7ab0d6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsNormalizacaoEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* HsNormalizacaoEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsNormalizacaoEstabelecimentoData extends db.data.siprp_local.inner.HsNormalizacaoEstabelecimento +{ + + public HsNormalizacaoEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoData.java new file mode 100644 index 00000000..492a2a3b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoData.java @@ -0,0 +1,18 @@ +/* +* HsPostoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsPostoData extends db.data.siprp_local.inner.HsPosto +{ + + public HsPostoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoEstabelecimentoData.java new file mode 100644 index 00000000..153c1971 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* HsPostoEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsPostoEstabelecimentoData extends db.data.siprp_local.inner.HsPostoEstabelecimento +{ + + public HsPostoEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoMedidaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoMedidaData.java new file mode 100644 index 00000000..82c7505e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoMedidaData.java @@ -0,0 +1,18 @@ +/* +* HsPostoMedidaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsPostoMedidaData extends db.data.siprp_local.inner.HsPostoMedida +{ + + public HsPostoMedidaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoRiscoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoRiscoData.java new file mode 100644 index 00000000..20a3ed92 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsPostoRiscoData.java @@ -0,0 +1,18 @@ +/* +* HsPostoRiscoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsPostoRiscoData extends db.data.siprp_local.inner.HsPostoRisco +{ + + public HsPostoRiscoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioAreaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioAreaData.java new file mode 100644 index 00000000..c0be2955 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioAreaData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioAreaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioAreaData extends db.data.siprp_local.inner.HsRelatorioArea +{ + + public HsRelatorioAreaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioData.java new file mode 100644 index 00000000..16aba4b9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioData extends db.data.siprp_local.inner.HsRelatorio +{ + + public HsRelatorioData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioEquipamentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioEquipamentoData.java new file mode 100644 index 00000000..8e1a7fdd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioEquipamentoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioEquipamentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioEquipamentoData extends db.data.siprp_local.inner.HsRelatorioEquipamento +{ + + public HsRelatorioEquipamentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioLegislacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioLegislacaoData.java new file mode 100644 index 00000000..34580b9d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioLegislacaoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioLegislacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioLegislacaoData extends db.data.siprp_local.inner.HsRelatorioLegislacao +{ + + public HsRelatorioLegislacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioMedidaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioMedidaData.java new file mode 100644 index 00000000..fb3ebf35 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioMedidaData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioMedidaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioMedidaData extends db.data.siprp_local.inner.HsRelatorioMedida +{ + + public HsRelatorioMedidaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioNormalizacaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioNormalizacaoData.java new file mode 100644 index 00000000..b8a07e57 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioNormalizacaoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioNormalizacaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioNormalizacaoData extends db.data.siprp_local.inner.HsRelatorioNormalizacao +{ + + public HsRelatorioNormalizacaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoData.java new file mode 100644 index 00000000..00e1d30d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioPostoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioPostoData extends db.data.siprp_local.inner.HsRelatorioPosto +{ + + public HsRelatorioPostoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoMedidaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoMedidaData.java new file mode 100644 index 00000000..23a9c63c --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoMedidaData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioPostoMedidaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioPostoMedidaData extends db.data.siprp_local.inner.HsRelatorioPostoMedida +{ + + public HsRelatorioPostoMedidaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoRiscoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoRiscoData.java new file mode 100644 index 00000000..7fe89842 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioPostoRiscoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioPostoRiscoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioPostoRiscoData extends db.data.siprp_local.inner.HsRelatorioPostoRisco +{ + + public HsRelatorioPostoRiscoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioRiscoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioRiscoData.java new file mode 100644 index 00000000..5742674d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioRiscoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioRiscoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioRiscoData extends db.data.siprp_local.inner.HsRelatorioRisco +{ + + public HsRelatorioRiscoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioRiscoValorQualitativoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioRiscoValorQualitativoData.java new file mode 100644 index 00000000..43866573 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRelatorioRiscoValorQualitativoData.java @@ -0,0 +1,18 @@ +/* +* HsRelatorioRiscoValorQualitativoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRelatorioRiscoValorQualitativoData extends db.data.siprp_local.inner.HsRelatorioRiscoValorQualitativo +{ + + public HsRelatorioRiscoValorQualitativoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoData.java new file mode 100644 index 00000000..77292c22 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoData.java @@ -0,0 +1,18 @@ +/* +* HsRiscoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRiscoData extends db.data.siprp_local.inner.HsRisco +{ + + public HsRiscoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoEmpresaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoEmpresaData.java new file mode 100644 index 00000000..c379a4d7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoEmpresaData.java @@ -0,0 +1,18 @@ +/* +* HsRiscoEmpresaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRiscoEmpresaData extends db.data.siprp_local.inner.HsRiscoEmpresa +{ + + public HsRiscoEmpresaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoMedidaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoMedidaData.java new file mode 100644 index 00000000..8c2f14f8 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoMedidaData.java @@ -0,0 +1,18 @@ +/* +* HsRiscoMedidaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRiscoMedidaData extends db.data.siprp_local.inner.HsRiscoMedida +{ + + public HsRiscoMedidaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoTemaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoTemaData.java new file mode 100644 index 00000000..7c0c1468 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/HsRiscoTemaData.java @@ -0,0 +1,18 @@ +/* +* HsRiscoTemaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class HsRiscoTemaData extends db.data.siprp_local.inner.HsRiscoTema +{ + + public HsRiscoTemaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/IdsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/IdsData.java new file mode 100644 index 00000000..41b23b07 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/IdsData.java @@ -0,0 +1,18 @@ +/* +* IdsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class IdsData extends db.data.siprp_local.inner.Ids +{ + + public IdsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ImageData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ImageData.java new file mode 100644 index 00000000..55daf68b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/ImageData.java @@ -0,0 +1,18 @@ +/* +* ImageData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class ImageData extends db.data.siprp_local.inner.Image +{ + + public ImageData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/LembretesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/LembretesData.java new file mode 100644 index 00000000..35b41584 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/LembretesData.java @@ -0,0 +1,18 @@ +/* +* LembretesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class LembretesData extends db.data.siprp_local.inner.Lembretes +{ + + public LembretesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/LembretesTiposData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/LembretesTiposData.java new file mode 100644 index 00000000..a88f1f75 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/LembretesTiposData.java @@ -0,0 +1,18 @@ +/* +* LembretesTiposData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class LembretesTiposData extends db.data.siprp_local.inner.LembretesTipos +{ + + public LembretesTiposData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesEmpresaData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesEmpresaData.java new file mode 100644 index 00000000..b4833a64 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesEmpresaData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesEmpresaData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MarcacoesEmpresaData extends db.data.siprp_local.inner.MarcacoesEmpresa +{ + + public MarcacoesEmpresaData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesEstabelecimentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesEstabelecimentoData.java new file mode 100644 index 00000000..7082c58f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesEstabelecimentoData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesEstabelecimentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MarcacoesEstabelecimentoData extends db.data.siprp_local.inner.MarcacoesEstabelecimento +{ + + public MarcacoesEstabelecimentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesGruposRealizadosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesGruposRealizadosData.java new file mode 100644 index 00000000..d4f509be --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesGruposRealizadosData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesGruposRealizadosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MarcacoesGruposRealizadosData extends db.data.siprp_local.inner.MarcacoesGruposRealizados +{ + + public MarcacoesGruposRealizadosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTecnicosHstData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTecnicosHstData.java new file mode 100644 index 00000000..52776b28 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTecnicosHstData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesTecnicosHstData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MarcacoesTecnicosHstData extends db.data.siprp_local.inner.MarcacoesTecnicosHst +{ + + public MarcacoesTecnicosHstData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTrabalhadorData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTrabalhadorData.java new file mode 100644 index 00000000..347d6683 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTrabalhadorData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesTrabalhadorData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MarcacoesTrabalhadorData extends db.data.siprp_local.inner.MarcacoesTrabalhador +{ + + public MarcacoesTrabalhadorData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTrabalhadorEstadosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTrabalhadorEstadosData.java new file mode 100644 index 00000000..4ec3e0d1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MarcacoesTrabalhadorEstadosData.java @@ -0,0 +1,18 @@ +/* +* MarcacoesTrabalhadorEstadosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MarcacoesTrabalhadorEstadosData extends db.data.siprp_local.inner.MarcacoesTrabalhadorEstados +{ + + public MarcacoesTrabalhadorEstadosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MedicosData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MedicosData.java new file mode 100644 index 00000000..01e45d62 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/MedicosData.java @@ -0,0 +1,18 @@ +/* +* MedicosData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class MedicosData extends db.data.siprp_local.inner.Medicos +{ + + public MedicosData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PaisesContinentesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PaisesContinentesData.java new file mode 100644 index 00000000..b08e4856 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PaisesContinentesData.java @@ -0,0 +1,18 @@ +/* +* PaisesContinentesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PaisesContinentesData extends db.data.siprp_local.inner.PaisesContinentes +{ + + public PaisesContinentesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PaisesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PaisesData.java new file mode 100644 index 00000000..9c381def --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PaisesData.java @@ -0,0 +1,18 @@ +/* +* PaisesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PaisesData extends db.data.siprp_local.inner.Paises +{ + + public PaisesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesDocumentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesDocumentoData.java new file mode 100644 index 00000000..5ff276bf --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesDocumentoData.java @@ -0,0 +1,18 @@ +/* +* PesDocumentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PesDocumentoData extends db.data.siprp_local.inner.PesDocumento +{ + + public PesDocumentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesDocumentoTipoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesDocumentoTipoData.java new file mode 100644 index 00000000..6a60e193 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesDocumentoTipoData.java @@ -0,0 +1,18 @@ +/* +* PesDocumentoTipoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PesDocumentoTipoData extends db.data.siprp_local.inner.PesDocumentoTipo +{ + + public PesDocumentoTipoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesPessoaDocumentoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesPessoaDocumentoData.java new file mode 100644 index 00000000..c693287e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PesPessoaDocumentoData.java @@ -0,0 +1,18 @@ +/* +* PesPessoaDocumentoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PesPessoaDocumentoData extends db.data.siprp_local.inner.PesPessoaDocumento +{ + + public PesPessoaDocumentoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrestadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrestadoresData.java new file mode 100644 index 00000000..7d855c68 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrestadoresData.java @@ -0,0 +1,18 @@ +/* +* PrestadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PrestadoresData extends db.data.siprp_local.inner.Prestadores +{ + + public PrestadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrestadoresGruposProtocoloData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrestadoresGruposProtocoloData.java new file mode 100644 index 00000000..46ad4cd2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrestadoresGruposProtocoloData.java @@ -0,0 +1,18 @@ +/* +* PrestadoresGruposProtocoloData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PrestadoresGruposProtocoloData extends db.data.siprp_local.inner.PrestadoresGruposProtocolo +{ + + public PrestadoresGruposProtocoloData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtElementosProtocoloData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtElementosProtocoloData.java new file mode 100644 index 00000000..a90aba18 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtElementosProtocoloData.java @@ -0,0 +1,18 @@ +/* +* PrtElementosProtocoloData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PrtElementosProtocoloData extends db.data.siprp_local.inner.PrtElementosProtocolo +{ + + public PrtElementosProtocoloData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtGruposProtocoloData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtGruposProtocoloData.java new file mode 100644 index 00000000..0789d2c4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtGruposProtocoloData.java @@ -0,0 +1,18 @@ +/* +* PrtGruposProtocoloData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PrtGruposProtocoloData extends db.data.siprp_local.inner.PrtGruposProtocolo +{ + + public PrtGruposProtocoloData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtTiposElementosProtocoloData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtTiposElementosProtocoloData.java new file mode 100644 index 00000000..b44b7da1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/PrtTiposElementosProtocoloData.java @@ -0,0 +1,18 @@ +/* +* PrtTiposElementosProtocoloData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class PrtTiposElementosProtocoloData extends db.data.siprp_local.inner.PrtTiposElementosProtocolo +{ + + public PrtTiposElementosProtocoloData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TiposExamesCompData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TiposExamesCompData.java new file mode 100644 index 00000000..bcfd5279 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TiposExamesCompData.java @@ -0,0 +1,18 @@ +/* +* TiposExamesCompData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TiposExamesCompData extends db.data.siprp_local.inner.TiposExamesComp +{ + + public TiposExamesCompData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasData.java new file mode 100644 index 00000000..698423e0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresConsultasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresConsultasData extends db.data.siprp_local.inner.TrabalhadoresConsultas +{ + + public TrabalhadoresConsultasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasData.java new file mode 100644 index 00000000..126abd92 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresConsultasDatasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresConsultasDatasData extends db.data.siprp_local.inner.TrabalhadoresConsultasDatas +{ + + public TrabalhadoresConsultasDatasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasEmailsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasEmailsData.java new file mode 100644 index 00000000..1dd76cfb --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasEmailsData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresConsultasDatasEmailsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresConsultasDatasEmailsData extends db.data.siprp_local.inner.TrabalhadoresConsultasDatasEmails +{ + + public TrabalhadoresConsultasDatasEmailsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasObservacoesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasObservacoesData.java new file mode 100644 index 00000000..56272c70 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresConsultasDatasObservacoesData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresConsultasDatasObservacoesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresConsultasDatasObservacoesData extends db.data.siprp_local.inner.TrabalhadoresConsultasDatasObservacoes +{ + + public TrabalhadoresConsultasDatasObservacoesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresData.java new file mode 100644 index 00000000..5abfcdb3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresData extends db.data.siprp_local.inner.Trabalhadores +{ + + public TrabalhadoresData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdData.java new file mode 100644 index 00000000..3096b8ed --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresEcdData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresEcdData extends db.data.siprp_local.inner.TrabalhadoresEcd +{ + + public TrabalhadoresEcdData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsAnaliseData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsAnaliseData.java new file mode 100644 index 00000000..ebe19019 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsAnaliseData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresEcdsAnaliseData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresEcdsAnaliseData extends db.data.siprp_local.inner.TrabalhadoresEcdsAnalise +{ + + public TrabalhadoresEcdsAnaliseData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsData.java new file mode 100644 index 00000000..1e37f77b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresEcdsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresEcdsData extends db.data.siprp_local.inner.TrabalhadoresEcds +{ + + public TrabalhadoresEcdsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasData.java new file mode 100644 index 00000000..dca02f91 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresEcdsDatasData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresEcdsDatasData extends db.data.siprp_local.inner.TrabalhadoresEcdsDatas +{ + + public TrabalhadoresEcdsDatasData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasEmailsData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasEmailsData.java new file mode 100644 index 00000000..b5e99d45 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasEmailsData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresEcdsDatasEmailsData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresEcdsDatasEmailsData extends db.data.siprp_local.inner.TrabalhadoresEcdsDatasEmails +{ + + public TrabalhadoresEcdsDatasEmailsData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasObservacoesData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasObservacoesData.java new file mode 100644 index 00000000..d7262b35 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresEcdsDatasObservacoesData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresEcdsDatasObservacoesData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresEcdsDatasObservacoesData extends db.data.siprp_local.inner.TrabalhadoresEcdsDatasObservacoes +{ + + public TrabalhadoresEcdsDatasObservacoesData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresFichasAptidaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresFichasAptidaoData.java new file mode 100644 index 00000000..54b190dd --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresFichasAptidaoData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresFichasAptidaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresFichasAptidaoData extends db.data.siprp_local.inner.TrabalhadoresFichasAptidao +{ + + public TrabalhadoresFichasAptidaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresProcessoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresProcessoData.java new file mode 100644 index 00000000..3defc1fe --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/TrabalhadoresProcessoData.java @@ -0,0 +1,18 @@ +/* +* TrabalhadoresProcessoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class TrabalhadoresProcessoData extends db.data.siprp_local.inner.TrabalhadoresProcesso +{ + + public TrabalhadoresProcessoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/VersaoData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/VersaoData.java new file mode 100644 index 00000000..5966e58b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/VersaoData.java @@ -0,0 +1,18 @@ +/* +* VersaoData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class VersaoData extends db.data.siprp_local.inner.Versao +{ + + public VersaoData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/VersionData.java b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/VersionData.java new file mode 100644 index 00000000..80068f97 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/data/siprp_local/outer/VersionData.java @@ -0,0 +1,18 @@ +/* +* VersionData.java +* +* Generated by com.evutils.codegen.EntityObjectGenerator +* +* Edit at will +*/ +package db.data.siprp_local.outer; + + +public final class VersionData extends db.data.siprp_local.inner.Version +{ + + public VersionData() + { + super(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesActualDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesActualDataProvider.java new file mode 100644 index 00000000..9128c883 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesActualDataProvider.java @@ -0,0 +1,24 @@ +/* + * AnalisesActualDataProvider.java + * + * Created on September 20, 2007, 1:41 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class AnalisesActualDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of AnalisesActualDataProvider */ + public AnalisesActualDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesConcluidasDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesConcluidasDataProvider.java new file mode 100644 index 00000000..77701e56 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesConcluidasDataProvider.java @@ -0,0 +1,24 @@ +/* + * AnalisesConcluidasDataProvider.java + * + * Created on September 20, 2007, 1:43 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class AnalisesConcluidasDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of AnalisesConcluidasDataProvider */ + public AnalisesConcluidasDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesDataProvider.java new file mode 100644 index 00000000..8af44d6d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesDataProvider.java @@ -0,0 +1,3466 @@ +/* + * AnalisesDataProvider.java + * + * Created on September 20, 2007, 1:44 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ +package db.providers; + +import beans.Acidentado; +import beans.AnaliseAcidente; +import beans.Causa; +import beans.Controle; +import beans.Correcao; +import beans.Departamento; +import beans.Estabelecimento; +import beans.Medico; +import beans.Medida; +import beans.Recomendacao; +import beans.Seccao; +import beans.TecnicoSaude; +import beans.TipoUtilizador; +import beans.Trabalhador; +import com.evolute.entity.evo.EvoDataProvider; +import com.evolute.utils.arrays.Virtual2DArray; +import com.evolute.utils.sql.Expression; +import com.evolute.utils.sql.Field; +import com.evolute.utils.sql.Select; +import com.evolute.utils.sql.Select2; +import com.evolute.utils.strings.StringPlainer; +import com.sun.rave.web.ui.model.Option; +import db.data.siprp.outer.AcidentadosData; +import db.data.siprp.outer.AnalisesAcidentesData; +import db.data.siprp.outer.CausasData; +import db.data.siprp.outer.ControleData; +import db.data.siprp.outer.MedidasData; +import db.data.siprp.outer.RecomendacoesData; +import db.data.siprp_local.outer.EstabelecimentosData; +import db.data.siprp_local.outer.TrabalhadoresData; +import global.Global; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.Statement; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.StringTokenizer; +import utils.Strings; +import utils.Utils; + +/** + * + * @author lluis + */ +public class AnalisesDataProvider extends GenericDataProvider +{ + + private static AnalisesDataProvider INSTANCE = null; + + private AnalisesDataProvider() throws Exception + { + super(); + ( ( EvoDataProvider ) getProvider() ).setIsUsingCache( false ); + } + + public static synchronized AnalisesDataProvider getInstance() throws Exception + { + if ( INSTANCE == null ) + { + INSTANCE = new AnalisesDataProvider(); + } + return INSTANCE; + } + + public Controle getControle() throws Exception + { + ControleData controle = getProvider().load( ControleData.class, 1 ); +// Statement st = createStatement(); +// String sql = "SELECT * FROM controle WHERE id = 1"; +// ResultSet rs = st.executeQuery( sql ); +// rs.first(); +// Controle c = new Controle(); +// c.setId( new Integer( rs.getInt( "id" ) ) ); +// c.setAnalise_year( new Integer( rs.getInt( "analise_year" ) ) ); +// c.setLast_analise_nr( new Integer( rs.getInt( "last_analise_nr" ) ) ); +// return c; + return toControleBean( controle ); + } + + public Controle getControloByAno( Integer ano ) throws Exception + { + List controles = getProvider().listLoad( ControleData.class, new Object[]{ ano }, + new String[]{ ControleData.ANALISE_YEAR_FULL }, new String[]{ ControleData.ID_FULL } ); +// Controle c = null; +// Statement st = createStatement(); +// String sql = "SELECT * FROM controle WHERE analise_year = " + ano; +// ResultSet rs = st.executeQuery( sql ); +// +// if ( rs.isBeforeFirst() ) +// { +// rs.first(); +// c = new Controle(); +// c.setId( new Integer( rs.getInt( "id" ) ) ); +// c.setAnalise_year( new Integer( rs.getInt( "analise_year" ) ) ); +// c.setLast_analise_nr( new Integer( rs.getInt( "last_analise_nr" ) ) ); +// } +// return c; + return toControleBean( controles.get( 0 ) ); + } + + public Controle createAnoNumeracao( Integer ano ) throws Exception + { + Controle c = new Controle(); +// Integer newId = getMaxControleId(); +// c.setId( newId ); + c.setAnalise_year( ano ); + c.setLast_analise_nr( new Integer( 0 ) ); +// Statement st = createStatement(); + +// String sql = "INSERT INTO controle (id, analise_year, last_analise_nr) VALUES ("; +// sql += c.getId() + ", "; +// sql += c.getAnalise_year() + ", "; +// sql += c.getLast_analise_nr() + ")"; +// st.execute( sql ); + ControleData controle = fromControleBean( c, true ); + controle.save(); + c.setId( controle.getId() ); + return c; + } + + public void updateControle( Controle c ) throws Exception + { +// Statement st = createStatement(); +// String sql = "UPDATE controle SET analise_year = " + c.getAnalise_year() + ", "; +// sql += "last_analise_nr = " + c.getLast_analise_nr() + " "; +// sql += "WHERE id = " + c.getId(); +// st.execute( sql ); + fromControleBean( c, false ).save(); + } + + protected ControleData fromControleBean( Controle controleBean, boolean criar ) + throws Exception + { + ControleData controle; + if( !criar && controleBean.getId() != null ) + { + controle = getProvider().load( ControleData.class, controleBean.getId() ); + } + else + { + controle = new ControleData(); + controle.setProvider( getProvider() ); + } + controle.setAnalise_year( controleBean.getAnalise_year() ); + controle.setLast_analise_nr( controleBean.getLast_analise_nr() ); + return controle; + } + + protected Controle toControleBean( ControleData controle ) + { + Controle controleBean = new Controle(); + controleBean.setId( controle.getId() ); + controleBean.setAnalise_year( controle.getAnalise_year() ); + controleBean.setLast_analise_nr( controle.getLast_analise_nr() ); + return controleBean; + } + + public String getExpression( String nome, Integer estabelecimentoID, String visitaDate, String POR, Integer fromYear ) + { + String tables = "analises_acidentes"; + String joinConditions = ""; + String whereExpression = "analises_acidentes.apagada = 'n' "; + + if ( nome != null || POR != null ) + { + tables += ", acidentados"; + joinConditions += "acidentados.id = analises_acidentes.acidentado_id AND "; + } + + if ( nome != null ) + { + nome = StringPlainer.convertString( nome.trim() ); + nome = nome.replaceAll( " ", "%" ); + whereExpression += "AND plain_utf8( acidentados.nome ) LIKE '%" + nome + "%' "; + } + if ( estabelecimentoID != null ) + { +// estabelecimento = StringPlainer.convertString( estabelecimento.trim() ); +// estabelecimento = estabelecimento.replaceAll( " ", "%" ); +// tables += ", estabelecimentos"; +// joinConditions += "analises_acidentes.estabelecimento_id = estabelecimentos.id AND "; +// whereExpression += "AND plain_utf8( estabelecimentos.nome ) LIKE '%" + estabelecimento + "%' "; + whereExpression += " AND analises_acidentes.estabelecimento_id = " + estabelecimentoID + " "; + } + if ( visitaDate != null ) + { + whereExpression += "AND analises_acidentes.data_acidente = '" + visitaDate + "' "; + } + if ( POR != null ) + { + whereExpression += "AND acidentados.numero_mecanografico LIKE '%" + POR.toUpperCase() + "%' "; + } + + if( visitaDate == null ) + { + whereExpression += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " "; + } + + return "SELECT * FROM " + tables + " WHERE " + joinConditions + whereExpression + " "; + } + + /*************************************************************************/ + /********************************* ACTUAIS *******************************/ + /*************************************************************************/ + public ArrayList searchAnalisesActualSeg( Integer estabelecimento_id, + String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) + throws Exception + { + if ( nome == null && visitaDate == null && POR == null ) + { + return getAnalisesActuaisSegList( estabelecimento_id, responsavel_loja, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, null, visitaDate, POR, fromYear ); + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '')" + + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + ")" + " AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + else + { + sql += "AND (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = ''))" + + " AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + + System.out.println( "SQL: " + sql ); + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesActuaisSegList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) + throws Exception + { + Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" ); + where = where.and( new Field( "analises_acidentes.estabelecimento_id" ).isEqual( estabelecimentoID ) ); + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + + Expression states = new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_SEG ).or( + new Field( "analises_acidentes.averiguacao_posterior" ).isEqual( "y" ).and( new Field( "analises_acidentes.averiguacao_obs" ).isEqual( "" ) ) ); + if ( "y".equals( responsavel_loja ) ) + { + states = states.or( new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_ASSINATURA_SEG ) ); + } + where = where.and( states ); + + Select2 query = new Select2( + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, + where, + new String[] + { + "analises_acidentes.analise_nr" + }, + null, null, null ); + +// String sql = ""; +// if ( responsavel_loja.matches( "y" ) ) +// { +// sql = "SELECT * " + +// "FROM analises_acidentes " + +// "WHERE " + +// "(estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '')" + +// " OR estado = " + Global.ESTADO_ASSINATURA_SEG + ")" + +// " AND estabelecimento_id = " + estabelecimentoID + +// " AND apagada = 'n' " + +// "ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * " + +// "FROM analises_acidentes " + +// "WHERE " + +// "( estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '') )" + +// " AND estabelecimento_id = " + estabelecimentoID + +// " AND apagada = 'n' " + +// "ORDER BY analise_nr"; +// } + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesActualRH( Integer estabelecimento_id, + String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) + throws Exception + { + if ( nome == null && visitaDate == null && POR == null ) + { + return getAnalisesActuaisRhList( estabelecimento_id, responsavel_loja, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, null, visitaDate, POR, fromYear ); + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + + " OR estado = " + Global.ESTADO_ASSINATURA_RH + ") AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + else + { + sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + + ") AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesActuaisRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) + throws Exception + { + Expression where = new Field( "apagada" ).isEqual( "n" ); + where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) ); + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + + Expression or = new Field( "estado" ).isEqual( Global.ESTADO_RH1 ).or( new Field( "estado" ).isEqual( Global.ESTADO_RH2 ) ); + if ( "y".equals( responsavel_loja ) ) + { + or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_RH ) ); + } + where = where.and( or ); + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analise_nr" }, + null, null, null ); + +// String sql = ""; +// if ( responsavel_loja.matches( "y" ) ) +// { +// sql = "SELECT * " + +// "FROM analises_acidentes " + +// "WHERE " + +// "(estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + " OR estado = " + Global.ESTADO_ASSINATURA_RH + ") " + +// "AND estabelecimento_id = " + estabelecimentoID + +// " AND apagada = 'n' " + +// "ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * " + +// "FROM analises_acidentes " + +// "WHERE " + +// "(estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + ") " + +// "AND estabelecimento_id = " + estabelecimentoID + +// " AND apagada = 'n' " + +// "ORDER BY analise_nr"; +// } + + System.out.println( "\ngetAnalisesActuaisRhList() : " + query.toString() + "\n" ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesActuaisHS( Integer estabelecimento_id, + String nome, Integer estabelecimentoID, String visitaDate, String POR, Integer fromYear ) + throws Exception + { + if ( nome == null && estabelecimentoID == null && visitaDate == null && POR == null ) + { + return getAnalisesActuaisHsList( estabelecimento_id, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, estabelecimentoID, visitaDate, POR, fromYear ); + + sql += "AND (estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_FECHAR + + " OR estado = " + Global.ESTADO_CONSOLIDACAO + ")" + + " ORDER BY analise_nr"; + + System.out.println( "\nAnalisesDataProvider . searchAnalisesActuaisHS() :\n\t" + sql ); + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesActuaisHsList( Integer estabelecimentoID, Integer fromYear ) throws Exception + { + Expression where = new Field( "apagada" ).isEqual( "n" ).and( + new Field( "estado" ).isEqual( Global.ESTADO_HS ).or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) ).or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) ) ); + + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).isEqual( fromYear ) ); + } + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analise_nr" }, + null, null, null + ); + +// String sql = "SELECT * " + +// "FROM analises_acidentes " + +// "WHERE " + +// "(estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_FECHAR + +// " OR estado = " + Global.ESTADO_CONSOLIDACAO + ")" + +// " AND apagada = 'n' " + +// "ORDER BY analise_nr"; + + System.out.println( "\nAnalisesDataProvider . getAnalisesActuaisHsList() : " + query.toString() ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + /*************************************************************************/ + /******************************* SEGUIMENTO ******************************/ + /*************************************************************************/ + public ArrayList searchAnalisesSeguimentoSeg( Integer estabelecimento_id, + String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) + throws Exception + { + if ( nome == null && visitaDate == null && POR == null ) + { + return getAnalisesSeguimentoSegList( estabelecimento_id, responsavel_loja, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, null, visitaDate, POR, fromYear ); + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND estabelecimento_id = " + estabelecimento_id + " AND (" + + "estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ") " + + "OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" + + ")" + " ORDER BY analise_nr"; + } + else + { + sql += "AND estabelecimento_id = " + estabelecimento_id + " AND (" + + "(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ")) OR estado = " + Global.ESTADO_FECHAR + + ")" + " ORDER BY analise_nr"; + } + + System.out.println( "SQL: " + sql ); + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesSeguimentoSegList( Integer estabelecimento_id, String responsavel_loja, Integer fromYear ) + throws Exception + { + String sql = null; + + // TODO : change to Select2 + if ( responsavel_loja.matches( "y" ) ) + { + sql = "SELECT * FROM analises_acidentes WHERE " + + "estabelecimento_id = " + estabelecimento_id + " AND (" + + "estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ") " + + "OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" + + ")" + " AND apagada = 'n' "; + } + else + { + sql = "SELECT * FROM analises_acidentes WHERE " + + "estabelecimento_id = " + estabelecimento_id + " AND (" + + "(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ")) OR estado = " + Global.ESTADO_FECHAR + + ")" + " AND apagada = 'n' "; + } + if ( fromYear != null ) + { + sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " "; + } + sql += " ORDER BY analise_nr "; + + System.out.println( "\ngetAnalisesSeguimentoSegList() : " + sql + "\n" ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesSeguimentoHS( Integer estabelecimento_id, + String nome, Integer estabelecimentoID, String visitaDate, String POR, Integer fromYear ) + throws Exception + { + if ( nome == null && estabelecimentoID == null && visitaDate == null && POR == null ) + { + return getAnalisesSeguimentoHsList( estabelecimento_id, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, estabelecimentoID, visitaDate, POR, fromYear ); + + sql += "AND (" + + "estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") " + + "OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" + + ")" + " ORDER BY analise_nr"; + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesSeguimentoHsList( Integer estabelecimentoID, Integer fromYear ) + throws Exception + { + Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" ); + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + where = where.and( + new Field( "estado" ).isLess( Global.ESTADO_HS ).or( new Field( "estado" ).isGreater( Global.ESTADO_HS ).and( new Field( "estado" ).isLess( Global.ESTADO_CONSOLIDACAO ) ) ).or( new Field( "estado" ).isGreater( Global.ESTADO_CONSOLIDACAO ).and( new Field( "estado" ).isLess( Global.ESTADO_FECHAR ) ) ) ); + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analises_acidentes.analise_nr" }, + null, null, null + ); + +// String sql = null; +// sql = "SELECT * FROM analises_acidentes WHERE (" + +// "estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") " + +// "OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" + +// ")" + " AND apagada = 'n' " + +// "ORDER BY analise_nr"; + // AND estabelecimento_id = " + estabelecimento_id; + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + System.out.println( "SEGUIMENTO HS SQL : " + query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesSeguimentoRH( Integer estabelecimento_id, + String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) + throws Exception + { + if ( nome == null && visitaDate == null && POR == null ) + { + return getAnalisesSeguimentoRhList( estabelecimento_id, responsavel_loja, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, null, visitaDate, POR, fromYear ); + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND (estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + + " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + + " OR estado = " + Global.ESTADO_FECHAR + ") AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + else + { + sql += "AND ( estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + + " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + + " OR estado = " + Global.ESTADO_ASSINATURA_RH + " OR estado = " + Global.ESTADO_FECHAR + + ") AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesSeguimentoRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) + throws Exception + { + Expression where = new Field( "apagada" ).isEqual( "n" ); + where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) ); + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + + Expression or = new Field( "estado" ).isEqual( Global.ESTADO_SEG ); + or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_HS ) ); + or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) ); + or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_SEG ) ); + or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) ); + if ( !"y".equals( responsavel_loja ) ) + { + or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_RH ) ); + } + where = where.and( or ); + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analise_nr" }, + null, null, null + ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesSeguimentoMedico( Integer estabelecimento_id, String nome, String visitaDate, String POR, Integer fromYear ) + throws Exception + { + if ( nome == null && visitaDate == null && POR == null ) + { + return getAnalisesSeguimentoMedList( estabelecimento_id, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, null, visitaDate, POR, fromYear ); + + sql += "AND estado < 5 OR (estado = 6 AND estado_assinatura <> 2) OR (estado = 6 AND estado_assinatura = 2 AND ass_med = 'y') " + + "OR (estado > 6 AND estado < 9) " + + "AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesSeguimentoMedList( Integer estabelecimentoID, Integer fromYear ) + throws Exception + { +// String sql = null; +// sql = "SELECT * FROM analises_acidentes WHERE " + +// "estado < 5 OR (estado = 6 AND estado_assinatura <> 2) OR (estado = 6 AND estado_assinatura = 2 AND ass_med = 'y') " + +// "OR (estado > 6 AND estado < 9) " + +// "AND estabelecimento_id = " + estabelecimentoID + " AND apagada = 'n' "; +// if ( fromYear != null ) +// { +// sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " "; +// } +// sql += " ORDER BY analise_nr "; + + Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" ); + where = where.and( new Field( "analises_acidentes.estabelecimento_id" ).isEqual( estabelecimentoID ) ); + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + where = where.and( + new Field( "analises_acidentes.estado" ).isLess( 5 ).or( + new Field( "analises_acidentes.estado" ).isEqual( 6 ).and( new Field( "analises_acidentes.estado_assinatura" ).isDifferent( 2 ) ) ).or( + new Field( "analises_acidentes.estado" ).isEqual( 6 ).and( new Field( "analises_acidentes.estado_assinatura" ).isEqual( 2 ) ).and( new Field( "analises_acidentes.ass_med" ).isEqual( "y" ) ) ).or( + new Field( "analises_acidentes.estado" ).isGreater( 6 ).and( new Field( "analises_acidentes.estado" ).isLess( 9 ) ) ) ); + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analises_acidentes.analise_nr" }, + null, null, null + ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesSeguimentoDirSiprp( String nome, Integer estabelecimentoID, String visitaDate, String POR, Integer fromYear ) + throws Exception + { + if ( nome == null && estabelecimentoID == null && visitaDate == null && POR == null ) + { + return getAnalisesSeguimentoDirSiprpList( fromYear ); + } + + String sql = getExpression( nome, estabelecimentoID, visitaDate, POR, fromYear ); + + sql += " AND estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesSeguimentoDirSiprpList( Integer fromYear ) throws Exception + { + Expression where = new Field( "apagada" ).isEqual( "n" ); + where = where.and( new Field( "estado" ).isLess( Global.ESTADO_CONCLUIDO ) ); + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analise_nr" }, + null, null, null + ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList searchAnalisesSeguimentoDirGerRh( + String nome, Integer estabelecimentoID, String visitaDate, String POR, Integer fromYear ) + throws Exception + { + return searchAnalisesSeguimentoDirSiprp( nome, estabelecimentoID, visitaDate, POR, fromYear ); + } + + public ArrayList getAnalisesSeguimentoDirGerRhList( Integer fromYear ) throws Exception + { + return getAnalisesSeguimentoDirSiprpList( fromYear ); + } + + public ArrayList searchAnalisesSeguimentoGestor( Integer estabelecimento_id, + String nome, Integer estabelecimentoID, String visitaDate, String POR, Integer fromYear ) + throws Exception + { + if ( nome == null && estabelecimentoID == null && visitaDate == null && POR == null ) + { + return getAnalisesSeguimentoGestorList( estabelecimento_id, fromYear ); + } + + Statement st = createStatement(); + String sql = getExpression( nome, estabelecimentoID, visitaDate, POR, fromYear ); + sql += "AND estado < " + Global.ESTADO_CONCLUIDO + " "; + + if ( estabelecimento_id != null ) + { + sql += " AND estabelecimento_id = " + estabelecimento_id + " "; + } + sql += " ORDER BY analise_nr"; + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesSeguimentoGestorList( Integer estabelecimentoID, Integer fromYear ) + throws Exception + { + Expression where = new Field( "apagada" ).isEqual( "n" ); + where = where.and( new Field( "estado" ).isLess( Global.ESTADO_CONCLUIDO ) ); + if ( estabelecimentoID != null ) + { + where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) ); + } + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); + } + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analise_nr" }, + null, null, null + ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + /*************************************************************************/ + /****************************** CONCLUIDOS *******************************/ + /*************************************************************************/ + public ArrayList getAnalisesConcluidasList( Integer estabelecimentoID, Integer fromYear ) throws Exception + { + Statement st = createStatement(); + + Expression where = new Field( "estado" ).isEqual( Global.ESTADO_CONCLUIDO ); + where = where.and( new Field( "apagada" ).isEqual( "n" ) ); + if ( estabelecimentoID != null ) + { + where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) ); + } + if ( fromYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).isEqual( fromYear ) ); + } + + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "*" }, + where, + new String[] { "analise_nr" }, + null, null, null + ); + + System.out.println( "\ngetAnalisesConcluidasList() : " + query.toString() + "\n" ); + + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesConcluidasHsList( Integer fromYear ) throws Exception + { + return getAnalisesConcluidasList( null, fromYear ); + } + + public ArrayList searchAnalisesConcluidasList( Integer estabelecimento_id, + Integer ano, Integer mes, Integer dia, String POR, String nome, Integer estabelecimentoID, Integer fromYear ) + throws Exception + { + String sql = null; + + sql = getExpression( nome, estabelecimentoID, null, POR, ano == null ? fromYear : ano ); + + if ( estabelecimento_id != null && estabelecimento_id.intValue() > 0 ) + { + sql += "AND analises_acidentes.estabelecimento_id = " + estabelecimento_id + " "; + } + + if ( ano != null ) + { + final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + Calendar calendar_from = Calendar.getInstance(); + Calendar calendar_to = Calendar.getInstance(); + + calendar_from.set( Calendar.YEAR, ano.intValue() ); + calendar_from.set( Calendar.MONTH, 0 ); + calendar_from.set( Calendar.DATE, 1 ); + + calendar_to.set( Calendar.YEAR, ano.intValue() ); + calendar_to.set( Calendar.MONTH, 11 ); + calendar_to.set( Calendar.DATE, 31 ); + + if ( mes != null ) + { + calendar_from.set( Calendar.MONTH, mes.intValue() - 1 ); + calendar_to.set( Calendar.MONTH, mes.intValue() - 1 ); + + if ( dia != null ) + { + calendar_from.set( Calendar.DATE, dia.intValue() ); + calendar_to.set( Calendar.DATE, dia.intValue() ); + } + else + { + calendar_from.set( Calendar.DATE, 1 ); + calendar_to.set( Calendar.DATE, 31 ); + } + } + else + { + calendar_from.set( Calendar.MONTH, 0 ); + calendar_to.set( Calendar.MONTH, 11 ); + } + + Date dateStart = calendar_from.getTime(); + Date dateEnd = calendar_to.getTime(); + + if ( dateStart.compareTo( dateEnd ) == 0 ) + { + sql += "AND analises_acidentes.data_acidente = '" + D_F.format( dateStart ) + "' "; + } + else + { + sql += "AND ( analises_acidentes.data_acidente >= '" + D_F.format( dateStart ) + "' AND analises_acidentes.data_acidente <= '" + D_F.format( dateEnd ) + "' ) "; + } + } + + sql += " AND estado = " + Global.ESTADO_CONCLUIDO + " "; + + // if search parameters are null, account with fromYear + if ( ano == null && mes == null && dia == null && POR == null && nome == null && estabelecimentoID == null && fromYear != null ) + { + sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " "; + } + + sql += " ORDER BY analises_acidentes.analise_nr ASC "; + + System.out.println( "CONCLUIDAS SQL: " + sql ); + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + //by lino +// public ArrayList searchAanalisesConcluidasList( Integer estabelecimento_id, +// Integer ano, Integer mes, Integer dia, String por, String nome, String estabelecimento ) +// throws Exception +// { +// Calendar cal = Calendar.getInstance(); +// Statement st = createStatement(); +// String sql = ""; +// if(por != null) +// { +// por = por.toUpperCase(); +// } +// if(nome != null) +// { +// nome = nome.toUpperCase(); +// } +// +// if( ano != null) +// { +// if( mes != null) +// { +// if( dia != null) +// { +// cal.set( cal.YEAR, ano.intValue() ); +// cal.set( cal.MONTH, mes.intValue() -1 ); +// cal.set( cal.DATE, dia.intValue() ); +// java.sql.Date data_acidente = new java.sql.Date( cal.getTime().getTime() ); +// if(por != null && nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + +// "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + +// "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else if(por != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + +// "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + +// "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// else if( nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + +// "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + +// "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE data_acidente = '" + data_acidente + "' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE data_acidente = '" + data_acidente + "' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND estabelecimento_id = " + estabelecimento_id + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// } +// else +// { +// cal.set( cal.YEAR, ano.intValue() ); +// cal.set( cal.MONTH, mes.intValue() -1 ); +// cal.set( cal.DATE, 1 ); +// java.sql.Date data_acidente_from = new java.sql.Date( cal.getTime().getTime() ); +// cal.set( cal.DATE, 31 ); +// java.sql.Date data_acidente_to = new java.sql.Date( cal.getTime().getTime() ); +// if(por != null && nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + +// "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + +// "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else if(por != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// else if( nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados" + +// " WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + +// "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + +// "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// } // dia +// } // mes +// else +// { +// cal.set( cal.YEAR, ano.intValue() ); +// cal.set( cal.MONTH, 0 ); +// cal.set( cal.DATE, 1 ); +// java.sql.Date data_acidente_from = new java.sql.Date( cal.getTime().getTime() ); +// cal.set( cal.MONTH, 11 ); +// cal.set( cal.DATE, 31 ); +// java.sql.Date data_acidente_to = new java.sql.Date( cal.getTime().getTime() ); +// if(por != null && nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + +// "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + +// "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else if(por != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + +// "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// else if( nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + +// "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + +// "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + +// "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// } +// } // ano +// else +// { +// if(por != null && nome != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// } +// else if(por != null) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND numero_mecanografico LIKE '%" + por + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND numero_mecanografico LIKE '%" + por + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// else if( nome != null ) +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND nome LIKE '%" + nome + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes, acidentados " + +// "WHERE acidentado_id = acidentados.id AND nome LIKE '%" + nome + "%' " + +// "AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// else +// { +// if(estabelecimento_id == null) +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND apagada = 'n' ORDER BY analise_nr"; +// } +// else +// { +// sql = "SELECT * FROM analises_acidentes " + +// "WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + +// " AND apagada = 'n' ORDER BY analise_nr"; +// } +// +// } +// } +// ResultSet rs = st.executeQuery(sql); +// ArrayList list = fillAnaliseFields(rs); +// +// return list; +// } + private ArrayList fillAnaliseFields( ResultSet rs ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); +// Statement stlocal1 = dblocal.createStatement(); + + ArrayList list = new ArrayList(); + if ( !rs.isBeforeFirst() ) //rs empty + { + return list; + } + + Statement stlocal = createLocalStatement(); + Statement stlocal1 = createLocalStatement(); + + rs.first(); + int nr = 0; + do + { + AnaliseAcidente a = new AnaliseAcidente(); + a.setId( new Integer( rs.getInt( "id" ) ) ); + + nr++; + a.setNr( new Integer( nr ) ); + a.setData_acidente( rs.getDate( "data_acidente" ) ); + a.setEmpresa_id( new Integer( rs.getInt( "empresa_id" ) ) ); + a.setEstabelecimento_id( new Integer( rs.getInt( "estabelecimento_id" ) ) ); + String sqllocal1 = "SELECT nome FROM estabelecimentos WHERE id = " + a.getEstabelecimento_id(); + ResultSet rslocal1 = stlocal1.executeQuery( sqllocal1 ); + rslocal1.first(); + a.setNome_estabelecimento( utils.Utils.unicodeToHTML( rslocal1.getString( "nome" ) ) ); + + a.setEstado( new Integer( rs.getInt( "estado" ) ) ); + a.setEstado_assinatura( new Integer( rs.getInt( "estado_assinatura" ) ) ); + a.setFase( getFase( a.getEstado().intValue() ) ); + a.setAcidentado_id( new Integer( rs.getInt( "acidentado_id" ) ) ); + Acidentado ac = getAcidentado( a.getAcidentado_id() ); + String sqllocal = "SELECT nome, numero_mecanografico FROM trabalhadores WHERE id = " + ac.getTrabalhador_id(); + ResultSet rslocal = stlocal.executeQuery( sqllocal ); + String nome_acidentado = ""; + String numero_mecanografico = ""; + if ( rslocal.first() ) + { + nome_acidentado = rslocal.getString( "nome" ); + numero_mecanografico = rslocal.getString( "numero_mecanografico" ); + } + a.setNome_acidentado( utils.Utils.unicodeToHTML( nome_acidentado ) ); + a.setNumero_mecanografico( numero_mecanografico ); + Object horas_turno = rs.getObject( "horas_turno" ); + if ( horas_turno == null ) + { + a.setHoras_turno( null ); + } + else + { + a.setHoras_turno( new Integer( rs.getInt( "horas_turno" ) ) ); + } + + a.setAveriguador( rs.getString( "averiguador" ) ); + //a.setSeccao(rs.getString("seccao")); + a.setDepartamento_id( new Integer( rs.getInt( "departamento_id" ) ) ); + a.setSeccao_id( new Integer( rs.getInt( "seccao_id" ) ) ); + a.setLocal_trabalho( rs.getString( "local_trabalho" ) ); + a.setTarefa( rs.getString( "tarefa" ) ); + a.setSubstancias( rs.getString( "substancias" ) ); +// a.setSuperior_hierarquico(rs.getString("superior_hierarquico")); + a.setCondicoes( rs.getString( "condicoes" ) ); + a.setTestemunhas( rs.getString( "testemunhas" ) ); + a.setCausas( new Integer( rs.getInt( "causas" ) ) ); + a.setDescricao( rs.getString( "descricao" ) ); + a.setConclusoes( rs.getString( "conclusoes" ) ); + a.setAccoes( rs.getString( "accoes" ) ); + a.setAveriguacao_posterior( rs.getString( "averiguacao_posterior" ) ); + a.setAveriguacao_obs( rs.getString( "averiguacao_obs" ) ); + + a.setHora_acidente( rs.getTime( "hora_acidente" ) ); + a.setFormacao_shst( rs.getString( "formacao_shst" ) ); + Object o = rs.getString( "formacao_shst_nao_porque" ); + if ( o == null ) + { + a.setFormacao_shst_nao_porque( "" ); + } + else + { + a.setFormacao_shst_nao_porque( rs.getString( "formacao_shst_nao_porque" ) ); + } + a.setOutros_acidentes_com_colaborador( rs.getString( "outros_acidentes_com_colaborador" ) ); + a.setNr_acidentes_com_colaborador( new Integer( rs.getInt( "nr_acidentes_com_colaborador" ) ) ); + a.setNr_relatorio_acidente_colaborador1( new Integer( rs.getInt( "nr_relatorio_acidente_colaborador1" ) ) ); + a.setNr_relatorio_acidente_colaborador2( new Integer( rs.getInt( "nr_relatorio_acidente_colaborador2" ) ) ); + a.setNr_relatorio_acidente_colaborador3( new Integer( rs.getInt( "nr_relatorio_acidente_colaborador3" ) ) ); + a.setNr_relatorio_acidente_colaborador4( new Integer( rs.getInt( "nr_relatorio_acidente_colaborador4" ) ) ); + a.setAcidentes_outros_colaboradores( rs.getString( "acidentes_outros_colaboradores" ) ); + a.setNr_acidentes_outros_colaboradores( new Integer( rs.getInt( "nr_acidentes_outros_colaboradores" ) ) ); + a.setNr_relatorio_acidente_outros_colaboradores1( new Integer( rs.getInt( "nr_relatorio_acidente_outros_colaboradores1" ) ) ); + a.setNr_relatorio_acidente_outros_colaboradores2( new Integer( rs.getInt( "nr_relatorio_acidente_outros_colaboradores2" ) ) ); + a.setNr_relatorio_acidente_outros_colaboradores3( new Integer( rs.getInt( "nr_relatorio_acidente_outros_colaboradores3" ) ) ); + a.setNr_relatorio_acidente_outros_colaboradores4( new Integer( rs.getInt( "nr_relatorio_acidente_outros_colaboradores4" ) ) ); + + a.setLesao_cabeca( rs.getString( "lesao_cabeca" ) ); + a.setLesao_pescoco( rs.getString( "lesao_pescoco" ) ); + a.setLesao_tronco( rs.getString( "lesao_tronco" ) ); + a.setLesao_membro_sup_dir( rs.getString( "lesao_membro_sup_dir" ) ); + a.setLesao_membro_sup_esq( rs.getString( "lesao_membro_sup_esq" ) ); + a.setLesao_membro_inf_dir( rs.getString( "lesao_membro_inf_dir" ) ); + a.setLesao_membro_inf_esq( rs.getString( "lesao_membro_inf_esq" ) ); + Object ob = rs.getString( "especif1" ); + if ( ob == null ) + { + a.setEspecif1( "" ); + } + else + { + a.setEspecif1( rs.getString( "especif1" ) ); + } + ob = rs.getString( "especif2" ); + if ( ob == null ) + { + a.setEspecif2( "" ); + } + else + { + a.setEspecif2( rs.getString( "especif2" ) ); + } + ob = rs.getString( "especif3" ); + if ( ob == null ) + { + a.setEspecif3( "" ); + } + else + { + a.setEspecif3( rs.getString( "especif3" ) ); + } + ob = rs.getString( "especif4" ); + if ( ob == null ) + { + a.setEspecif4( "" ); + } + else + { + a.setEspecif4( rs.getString( "especif4" ) ); + } + ob = rs.getString( "tipo_lesao" ); + if ( ob == null ) + { + a.setTipo_lesao( "" ); + } + else + { + a.setTipo_lesao( rs.getString( "tipo_lesao" ) ); + } + + a.setTipo_incapacidade( rs.getString( "tipo_incapacidade" ) ); + //a.setCoef_incapacidade(new Integer(( rs.getInt("coef_incapacidade") ))); + a.setCoef_incapacidade( ( Integer ) rs.getObject( "coef_incapacidade" ) ); + a.setData_aval_incapacidade( rs.getDate( "data_aval_incapacidade" ) ); + a.setData_rev_incapacidade( rs.getDate( "data_rev_incapacidade" ) ); + a.setPeriodo_incapacidade_de( rs.getDate( "periodo_incapacidade_de" ) ); + a.setPeriodo_incapacidade_a( rs.getDate( "periodo_incapacidade_a" ) ); + a.setImg_flexao( rs.getString( "img_flexao" ) ); + a.setImg_ext1( rs.getString( "img_ext1" ) ); + a.setImg_ext2( rs.getString( "img_ext2" ) ); + a.setImg_cab2( rs.getString( "img_cab2" ) ); + a.setImg_cab3( rs.getString( "img_cab3" ) ); + a.setImg_ma2( rs.getString( "img_ma2" ) ); + a.setImg_ma3( rs.getString( "img_ma3" ) ); + a.setImg_ma5( rs.getString( "img_ma5" ) ); + a.setImg_ma6( rs.getString( "img_ma6" ) ); + a.setImg_ma8( rs.getString( "img_ma8" ) ); + a.setImg_ma10( rs.getString( "img_ma10" ) ); + a.setImg_rot1( rs.getString( "img_rot1" ) ); + a.setImg_rot2( rs.getString( "img_rot2" ) ); + a.setImg_cab1( rs.getString( "img_cab1" ) ); + a.setImg_cab4( rs.getString( "img_cab4" ) ); + a.setImg_ma1( rs.getString( "img_ma1" ) ); + a.setImg_ma4( rs.getString( "img_ma4" ) ); + a.setImg_ma7( rs.getString( "img_ma7" ) ); + a.setImg_ma9( rs.getString( "img_ma9" ) ); + a.setRestricao_carga( new Integer( rs.getInt( "restricao_carga" ) ) ); + a.setRestricao_motricidade( rs.getString( "restricao_motricidade" ) ); + a.setRestricao_conducao( rs.getString( "restricao_conducao" ) ); + a.setRestricao_vibracoes( rs.getString( "restricao_vibracoes" ) ); + ob = rs.getString( "restricao_outras" ); + if ( ob == null ) + { + a.setRestricao_outras( "" ); + } + else + { + a.setRestricao_outras( rs.getString( "restricao_outras" ) ); + } + ob = rs.getString( "med_observ" ); + if ( ob == null ) + { + a.setMed_observ( "" ); + } + else + { + a.setMed_observ( rs.getString( "med_observ" ) ); + } + a.setAnalise_nr( rs.getString( "analise_nr" ) ); + a.setMedico_id( new Integer( rs.getInt( "medico_id" ) ) ); + a.setTecnico_saude_id( new Integer( rs.getInt( "tecnico_saude_id" ) ) ); + + //a.setAss_hs(rs.getString("ass_hs")); + //a.setAss_seg(rs.getString("ass_seg")); + a.setAss_resp_seg( rs.getString( "ass_resp_seg" ) ); + //a.setAss_med(rs.getString("ass_med")); + a.setAss_resp_rh( rs.getString( "ass_resp_rh" ) ); + a.setAss_consolidacao( rs.getString( "ass_consolidacao" ) ); + a.setData_consolidacao( rs.getDate( "data_consolidacao" ) ); + a.setData_assinatura_seg( rs.getDate( "data_assinatura_seg" ) ); + a.setData_assinatura_rh( rs.getDate( "data_assinatura_rh" ) ); + a.setNome_resp_seg( rs.getString( "nome_resp_seg" ) ); + a.setNome_resp_rh( rs.getString( "nome_resp_rh" ) ); + a.setCorrecao( rs.getString( "correcao" ) ); + a.setObservacoes_correcao( rs.getString( "observacoes_correcao" ) ); + a.setEstado_antes_correcao( new Integer( rs.getInt( "estado_antes_correcao" ) ) ); + a.setAss_superior( rs.getString( "ass_superior" ) ); + a.setNome_superior( rs.getString( "nome_superior" ) ); + a.setData_assinatura_superior( rs.getDate( "data_assinatura_superior" ) ); + a.setData_inicio_processo( rs.getDate( "data_inicio_processo" ) ); + a.setNome_resp_consolidacao( rs.getString( "nome_resp_consolidacao" ) ); + //System.out.println("ANALISE NR : " + a.getAnalise_nr()); + a.setRh_fase4( new Integer( rs.getInt( "rh_fase4" ) ) ); + + a.setConcluido_por_desactivacao( rs.getBoolean( "concluido_por_desactivacao" ) ); + a.setData_desactivacao( rs.getDate( "data_desactivacao" ) ); + a.setComentario_desactivacao( rs.getString( "comentario_desactivacao" ) ); + a.setParticipado( "y".equals( rs.getString( "participado" ) ) ); + a.setNomeResponsavelParticipacao( rs.getString( "nome_responsavel_participacao" ) ); + a.setDataParticipacao( rs.getDate( "data_participacao" ) ); + list.add( a ); + } + while ( rs.next() ); + + return list; + } + + public ArrayList searchTrabalhador( Integer empresa_id, Integer estabelecimento_id, String nrMecanografico, String nome ) + throws Exception + { + ArrayList list = new ArrayList(); + +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = ""; + // trabalhadores do estabelecimento + if ( nrMecanografico != null ) + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + else + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + + System.out.println( "TRABALHADORES SQL B : " + sql ); + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( 1 ) ) ); //id + String nome_trab = rslocal.getString( 2 ); + t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); + t.setData_nascimento( rslocal.getDate( "data_nascimento" ) ); + t.setFuncao( rslocal.getString( "funcao_proposta" ) ); + t.setData_admissao( rslocal.getDate( "data_admissao" ) ); + t.setNumero_mecanografico( rslocal.getString( "numero_mecanografico" ) ); + t.setEstabelecimento_id( new Integer( rslocal.getInt( 7 ) ) ); + //if(nome != null) + //{ + t.setEstabelecimento( utils.Utils.unicodeToHTML( rslocal.getString( 8 ) ) ); + //} + + list.add( t ); + } + while ( rslocal.next() ); + } + + + //restantes trabalhadores + if ( nrMecanografico != null ) + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + else + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + + +// if(nrMecanografico != null) +// { +// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; +// } +// else if(nome != null) +// { +// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; +// } + System.out.println( "TRABALHADORES SQL : " + sql ); + rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( 1 ) ) ); //id + String nome_trab = rslocal.getString( 2 ); + t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); + t.setData_nascimento( rslocal.getDate( "data_nascimento" ) ); + t.setFuncao( rslocal.getString( "funcao_proposta" ) ); + t.setData_admissao( rslocal.getDate( "data_admissao" ) ); + t.setNumero_mecanografico( rslocal.getString( "numero_mecanografico" ) ); + t.setEstabelecimento_id( new Integer( rslocal.getInt( 7 ) ) ); + //if(nome != null) + //{ + t.setEstabelecimento( utils.Utils.unicodeToHTML( rslocal.getString( 8 ) ) ); + //} + + list.add( t ); + } + while ( rslocal.next() ); + } + return list; + } + + public ArrayList searchTrabalhador( Integer empresa_id, String nrMecanografico, String nome ) throws Exception + { + ArrayList list = new ArrayList(); + +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + +// String sql = ""; + + StringTokenizer st = null; + + Expression expr = new Field( EstabelecimentosData.EMPRESA_ID_FULL ).isEqual( empresa_id ).and( + new Field( TrabalhadoresData.INACTIVO_FULL ).isEqual( "n" ) ).and( + new Field( EstabelecimentosData.INACTIVO_FULL ).isEqual( "n" ) ); + + + + if( nome != null ) + { + st = new StringTokenizer( nome ); + while ( st.hasMoreTokens() ) + { + expr = expr.and( new Field( TrabalhadoresData.NOME_FULL ).isILike( "'%" + st.nextToken() + "%'" ) ); + } + } + if ( nrMecanografico != null ) + { + expr = expr.and( new Field( TrabalhadoresData.NUMERO_MECANOGRAFICO_FULL ).isILike( nrMecanografico.toLowerCase() ) ); + } + + Select select = + new Select2( new String[]{ TrabalhadoresData.TABLENAME, EstabelecimentosData.TABLENAME }, + new Integer[]{ Select2.JOIN_INNER }, + new Expression[]{ new Field( TrabalhadoresData.ESTABELECIMENTO_ID_FULL ).isEqual( new Field( EstabelecimentosData.ID_FULL ) ) }, + new String[]{ TrabalhadoresData.ID_FULL, TrabalhadoresData.NOME_FULL, TrabalhadoresData.DATA_NASCIMENTO_FULL, + TrabalhadoresData.FUNCAO_PROPOSTA_FULL, TrabalhadoresData.DATA_ADMISSAO_FULL, TrabalhadoresData.NUMERO_MECANOGRAFICO_FULL, + EstabelecimentosData.ID_FULL, EstabelecimentosData.NOME_FULL }, + expr, + null, + null, + null, + null ); +// if ( nrMecanografico != null ) +// { +// if ( nome != null ) +// { +// +// +//// String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; +//// String sql2 = ""; +//// String sql3 = ") AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; +//// st = new StringTokenizer( nome ); +//// int n = 0; +//// while ( st.hasMoreTokens() ) +//// { +//// if ( n > 0 ) +//// { +//// sql2 += "AND "; +//// } +//// sql2 += "trabalhadores.nome LIKE '%" + st.nextToken() + "%' "; +//// n++; +//// } +//// sql = sql1 + sql2 + sql3; +// //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND (trabalhadores.nome LIKE '%" + nome + "%' AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id; +// } +// else +// { +//// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; +// } +// } +// else +// { +// if ( nome != null ) +// { +//// //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id; +//// String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; +//// String sql2 = ""; +//// String sql3 = ") AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; +//// st = new StringTokenizer( nome ); +//// int n = 0; +//// while ( st.hasMoreTokens() ) +//// { +//// if ( n > 0 ) +//// { +//// sql2 += "AND "; +//// } +//// sql2 += "trabalhadores.nome LIKE '%" + st.nextToken() + "%' "; +//// n++; +//// } +//// sql = sql1 + sql2 + sql3; +// +// } +// } + + System.out.println( "TRABALHADORES SQL (NOVO) : " + select ); +// if(nrMecanografico != null) +// { +// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; +// } +// else if(nome != null) +// { +// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; +// } +// ResultSet rslocal = stlocal.executeQuery( sql ); +// rslocal.first(); + Virtual2DArray array = getLocalExecuter().executeQuery( select ); +// do +// { +// Trabalhador t = new Trabalhador(); +// t.setId( new Integer( rslocal.getInt( 1 ) ) ); //id +// String nome_trab = rslocal.getString( 2 ); +// t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); +// t.setData_nascimento( rslocal.getDate( "data_nascimento" ) ); +// t.setFuncao( rslocal.getString( "funcao_proposta" ) ); +// t.setData_admissao( rslocal.getDate( "data_admissao" ) ); +// t.setNumero_mecanografico( rslocal.getString( "numero_mecanografico" ) ); +// t.setEstabelecimento_id( new Integer( rslocal.getInt( 7 ) ) ); +// //if(nome != null) +// //{ +// t.setEstabelecimento( utils.Utils.unicodeToHTML( rslocal.getString( 8 ) ) ); +// //} +// +// list.add( t ); +// } +// while ( rslocal.next() ); + System.out.println( "Encontrei : " + array.columnLength() ); + for( int n = 0; n < array.columnLength(); n++ ) + { + try + { + Trabalhador t = new Trabalhador(); + t.setId( ( Integer ) array.get( n, 0 ) ); + String nome_trab = ( String ) array.get( n, 1 ); + t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); + t.setData_nascimento( ( java.sql.Date ) array.get( n, 2 ) ); + t.setFuncao( ( String ) array.get( n, 3 ) ); + t.setData_admissao( ( java.sql.Date ) array.get( n, 4 ) ); + t.setNumero_mecanografico( ( String ) array.get( n, 5 ) ); + t.setEstabelecimento_id( ( Integer ) array.get( n, 6 ) ); + t.setEstabelecimento( utils.Utils.unicodeToHTML( ( String ) array.get( n, 7 ) ) ); + list.add( t ); + System.out.println( nome_trab ); + } + catch( Exception ex ) + { + ex.printStackTrace(); + } + } + System.out.println( "na lista vao : " + list.size() ); + return list; + } + + public ArrayList getTrabalhadoresListByEstabelecimento( Integer estabelecimento_id ) throws Exception + { + Utils utils = new Utils(); + ArrayList list = new ArrayList(); + +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT * FROM trabalhadores WHERE estabelecimento_id = " + estabelecimento_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + int nr = 0; + do + { + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( "id" ) ) ); + String nome = rslocal.getString( "nome" ); + t.setNome( utils.unicodeToHTML( nome ) ); + t.setData_nascimento( rslocal.getDate( "data_nascimento" ) ); + t.setFuncao( rslocal.getString( "funcao_proposta" ) ); + t.setData_admissao( rslocal.getDate( "data_admissao" ) ); + list.add( t ); + } + while ( rslocal.next() ); + + return list; + } + + public Trabalhador getTrabalhador( Integer id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT * FROM trabalhadores WHERE id = " + id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( "id" ) ) ); + t.setNome( rslocal.getString( "nome" ) ); + t.setData_nascimento( rslocal.getDate( "data_nascimento" ) ); + t.setFuncao( rslocal.getString( "funcao_proposta" ) ); + t.setData_admissao( rslocal.getDate( "data_admissao" ) ); + return t; + } + + public Acidentado getAcidentado( Integer acidentado_id ) throws Exception + { + Strings strings = new Strings(); + Acidentado a = new Acidentado(); + Statement st = createStatement(); + String sql = "SELECT * FROM acidentados WHERE id = " + acidentado_id; + ResultSet rs = st.executeQuery( sql ); + rs.first(); + a.setId( new Integer( rs.getInt( "id" ) ) ); + a.setNome( rs.getString( "nome" ) ); + a.setData_nascimento( rs.getDate( "data_nascimento" ) ); + a.setBilhete_identidade( rs.getString( "bilhete_identidade" ) ); + a.setMorada( rs.getString( "morada" ) ); + a.setCod_postal( rs.getString( "cod_postal" ) ); + a.setLocalidade( rs.getString( "localidade" ) ); + a.setContacto_telefonico( rs.getString( "contacto_telefonico" ) ); + a.setData_admissao( rs.getDate( "data_admissao" ) ); + a.setTurno( rs.getString( "turno" ) ); + String funcao = rs.getString( "funcao" ); + a.setFuncao( utils.Utils.unicodeToHTML( funcao ) ); + a.setTrabalhador_id( new Integer( rs.getInt( "trabalhador_id" ) ) ); + a.setNumero_mecanografico( rs.getString( "numero_mecanografico" ) ); + a.setNome_superior_hierarquico( rs.getString( "nome_superior_hierarquico" ) ); + a.setEmail_superior_hierarquico( rs.getString( "email_superior_hierarquico" ) ); + a.setEstabelecimento_origem( rs.getString( "estabelecimento_origem" ) ); + a.setData_email_superior_hierarquico( rs.getDate( "data_email_superior_hierarquico" ) ); + //a.setAnalise_acidente_id(new Integer("analise_acidente_id")); + return a; + } + + public String getEmpresaNome( Integer empresa_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT designacao_social FROM empresas WHERE id = " + empresa_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String nome = rslocal.getString( "designacao_social" ); + return nome; + } + + public String getEstabelecimentoNome( Integer estabelecimento_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT nome FROM estabelecimentos WHERE id = " + estabelecimento_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + + String nome = ""; + if ( rslocal.first() ) + { + nome = rslocal.getString( "nome" ); + } + return Utils.unicodeToHTML( nome ); + } + + public String getMedicoNome( Integer medico_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT nome FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String nome = rslocal.getString( "nome" ); + return Utils.unicodeToHTML( nome ); + } + + public Medico getMedico( Integer id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT * FROM medicos WHERE id = " + id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + Medico m = new Medico(); + m.setId( new Integer( rslocal.getInt( "id" ) ) ); + m.setNome( rslocal.getString( "nome" ) ); + m.setNumero_cedula( rslocal.getString( "numero_cedula" ) ); + return m; + } + + public String getTecnicoSaudeNome( Integer tecnico_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT nome FROM marcacoes_tecnicos_hst WHERE id = " + tecnico_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String nome = rslocal.getString( "nome" ); + return nome; + } + + public Integer getMaxAcidentadoId() + { + Statement st = createStatement(); + String sql = "SELECT max(acidentados.id)+1 AS MAXACIDENTADOID FROM acidentados"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Integer newId = new Integer( rs.getInt( "MAXACIDENTADOID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + return newId; + } + catch ( Exception ex ) + { + return new Integer( 1 ); + } + } + + public Integer createAcidentado( Acidentado a ) throws Exception + { +// Statement st = createStatement(); +// Integer newId = getMaxAcidentadoId(); +// String sql = "INSERT INTO acidentados (id, nome, data_nascimento, bilhete_identidade, morada, cod_postal, localidade, contacto_telefonico, data_admissao, turno, funcao, trabalhador_id, numero_mecanografico, nome_superior_hierarquico, email_superior_hierarquico, estabelecimento_origem, data_email_superior_hierarquico) VALUES ("; +// sql += newId + ", '"; +// sql += a.getNome() + "', "; +// if ( a.getData_nascimento() == null ) +// { +// sql += null + ", '"; +// } +// else +// { +// sql += "'" + a.getData_nascimento() + "', '"; +// } +// //sql += a.getData_nascimento() + "', '"; +// sql += a.getBilhete_identidade() + "', '"; +// sql += a.getMorada() + "', '"; +// sql += a.getCod_postal() + "', '"; +// sql += a.getLocalidade() + "', '"; +// sql += a.getContacto_telefonico() + "', "; +// if ( a.getData_admissao() == null ) +// { +// sql += null + ", '"; +// } +// else +// { +// sql += "'" + a.getData_admissao() + "', '"; +// } +//// sql += a.getData_admissao() + "', '"; +// sql += a.getTurno() + "', '"; +// sql += a.getFuncao() + "', "; +// sql += a.getTrabalhador_id() + ", '"; +// sql += a.getNumero_mecanografico() + "', '"; +// sql += a.getNome_superior_hierarquico() + "', '"; +// sql += a.getEmail_superior_hierarquico() + "', '"; +// sql += a.getEstabelecimento_origem() + "', "; +// if ( a.getData_email_superior_hierarquico() == null ) +// { +// sql += null + ")"; +// } +// else +// { +// sql += "'" + a.getData_email_superior_hierarquico() + "')"; +// } +// //sql += a.getAnalise_acidente_id() + ")"; +// System.out.println( "SQL ACIDENTADO : " + sql ); +// st.execute( sql ); + + AcidentadosData acidentado = fromAcidentadoBean( a, true ); + acidentado.save(); + + return acidentado.getId(); + } + + public void updateAcidentado( Acidentado a ) throws Exception + { +// Statement st = createStatement(); +// String sql = "UPDATE acidentados SET nome = '" + a.getNome() + "', "; +// if ( a.getData_nascimento() == null ) +// { +// sql += "data_nascimento = " + null + ", "; +// } +// else +// { +// sql += "data_nascimento = '" + a.getData_nascimento() + "', "; +// } +//// sql += "data_nascimento = '" + a.getData_nascimento() + "', "; +// sql += "bilhete_identidade = '" + a.getBilhete_identidade() + "', "; +// sql += "morada = '" + a.getMorada() + "', "; +// sql += "cod_postal = '" + a.getCod_postal() + "', "; +// sql += "localidade = '" + a.getLocalidade() + "', "; +// sql += "contacto_telefonico = '" + a.getContacto_telefonico() + "', "; +// if ( a.getData_admissao() == null ) +// { +// sql += "data_admissao = " + null + ", "; +// } +// else +// { +// sql += "data_admissao = '" + a.getData_admissao() + "', "; +// } +//// sql += "data_admissao = '" + a.getData_admissao() + "', "; +// sql += "turno = '" + a.getTurno() + "', "; +// sql += "funcao = '" + a.getFuncao() + "', "; +// sql += "trabalhador_id = " + a.getTrabalhador_id() + ", "; +// sql += "numero_mecanografico = '" + a.getNumero_mecanografico() + "', "; +// sql += "nome_superior_hierarquico = '" + a.getNome_superior_hierarquico() + "', "; +// sql += "email_superior_hierarquico = '" + a.getEmail_superior_hierarquico() + "', "; +// sql += "estabelecimento_origem = '" + a.getEstabelecimento_origem() + "', "; +// if ( a.getData_email_superior_hierarquico() == null ) +// { +// sql += "data_email_superior_hierarquico = " + null + " "; +// } +// else +// { +// sql += "data_email_superior_hierarquico = '" + a.getData_email_superior_hierarquico() + "' "; +// } +// //sql += "analise_acidente_id = '" + a.getAnalise_acidente_id() + " "; +// sql += "WHERE id = " + a.getId(); +// System.out.println( "SQL UPDATE ACIDENTADO : " + sql ); +// st.execute( sql ); + AcidentadosData acidentado = fromAcidentadoBean( a, false ); + acidentado.save(); + } + + public Integer getMaxControleId() + { + Statement st = createStatement(); + String sql = "SELECT max(controle.id)+1 AS MAXCONTROLEID FROM controle"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Integer newId = new Integer( rs.getInt( "MAXCONTROLEID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + return newId; + } + catch ( Exception ex ) + { + return new Integer( 1 ); + } + } + + public Integer getMaxAnaliseId() + { + Statement st = createStatement(); + String sql = "SELECT max(analises_acidentes.id)+1 AS MAXANALISEID FROM analises_acidentes"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Integer newId = new Integer( rs.getInt( "MAXANALISEID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + return newId; + } + catch ( Exception ex ) + { + return new Integer( 1 ); + } + } + + public AnaliseAcidente createAnalise( AnaliseAcidente a ) throws Exception + { +// Integer newId = getMaxAnaliseId(); + + //calc analise_nr + java.util.Date data_acidente = new java.util.Date( a.getData_acidente().getTime() ); + Calendar cal = new GregorianCalendar(); + cal.setTime( data_acidente ); + int ano = cal.get( Calendar.YEAR ); + Controle c = getControloByAno( new Integer( ano ) ); + if ( c == null ) + { + c = createAnoNumeracao( new Integer( ano ) ); + } +// if(c.getAnalise_year().intValue() != ano) +// { +// c.setAnalise_year(new Integer(ano)); +// c.setLast_analise_nr(new Integer(0)); +// } + //String seq_str = new Integer(10000 + newId.intValue()).toString(); + int i_analise_nr = c.getLast_analise_nr().intValue() + 1; + c.setLast_analise_nr( new Integer( i_analise_nr ) ); + //updateControle(c); + String seq_str = new Integer( 10000 + i_analise_nr ).toString(); + String ano_str = new Integer( ano ).toString(); + String analise_nr = ano_str.substring( 2 ) + "/" + seq_str.substring( 1 ); + a.setAnalise_nr( analise_nr ); + + AnalisesAcidentesData analise = fromAnaliseAcidenteBean( a, true ); + analise.save(); + + a.setId( analise.getId() ); + +// Insert insert = new Insert( "analises_acidentes", new Assignment[] { +//// new Assignment( new Field( "id" ), newId ), +// new Assignment( new Field( "averiguador" ), a.getAveriguador() ), +// new Assignment( new Field( "data_acidente" ), a.getData_acidente() ), +// new Assignment( new Field( "acidentado_id" ), a.getAcidentado_id() ), +// new Assignment( new Field( "estado" ), a.getEstado() ), +// new Assignment( new Field( "empresa_id" ), a.getEmpresa_id() ), +// new Assignment( new Field( "estabelecimento_id" ), a.getEstabelecimento_id() ), +// new Assignment( new Field( "horas_turno" ), a.getHoras_turno() ), +// new Assignment( new Field( "departamento_id" ), a.getDepartamento_id() ), +// new Assignment( new Field( "seccao_id" ), a.getSeccao_id() ), +// new Assignment( new Field( "local_trabalho" ), a.getLocal_trabalho() ), +// new Assignment( new Field( "tarefa" ), a.getTarefa() ), +// new Assignment( new Field( "substancias" ), a.getSubstancias() ), +// new Assignment( new Field( "condicoes" ), a.getCondicoes() ), +// new Assignment( new Field( "testemunhas" ), a.getTestemunhas() ), +// new Assignment( new Field( "causas" ), a.getCausas() ), +// new Assignment( new Field( "descricao" ), a.getDescricao() ), +// new Assignment( new Field( "conclusoes" ), a.getConclusoes() ), +// new Assignment( new Field( "accoes" ), a.getAccoes() ), +// new Assignment( new Field( "hora_acidente" ), a.getHora_acidente() ), +// new Assignment( new Field( "medico_id" ), a.getMedico_id() ), +// new Assignment( new Field( "tecnico_saude_id" ), a.getTecnico_saude_id() ), +// new Assignment( new Field( "averiguacao_posterior" ), a.getAveriguacao_posterior() ), +// new Assignment( new Field( "averiguacao_obs" ), a.getAveriguacao_obs() ), +// new Assignment( new Field( "data_inicio_processo" ), a.getData_inicio_processo() ), +// new Assignment( new Field( "analise_nr" ), analise_nr ), +// new Assignment( new Field( "coef_incapacidade" ), null ), +// new Assignment( new Field( "concluido_por_desactivacao" ), Boolean.FALSE ), +// new Assignment( new Field( "data_desactivacao" ), null ), +// new Assignment( new Field( "comentario_desactivacao" ), null ), +// } ); +// Virtual2DArray array = getExecuter().executeQuery( insert ); +// Integer insertedID = getInsertedID( array ); +// System.out.println( "SQL : " + insert.toString() ); +// System.out.println( "\nINSERTED ANALISE ID : " + insertedID ); +// a.setId( insertedID ); + + + updateControle( c ); + return a; + } + + public void updateAnalise( AnaliseAcidente a ) throws Exception + { + if ( a.getEspecif1().matches( "null" ) ) + { + a.setEspecif1( "" ); + } + if ( a.getEspecif2().matches( "null" ) ) + { + a.setEspecif2( "" ); + } + if ( a.getEspecif3().matches( "null" ) ) + { + a.setEspecif3( "" ); + } + if ( a.getEspecif4().matches( "null" ) ) + { + a.setEspecif4( "" ); + } + if ( a.getRestricao_outras().matches( "null" ) ) + { + a.setRestricao_outras( "" ); + } + if ( a.getTipo_lesao().matches( "null" ) ) + { + a.setTipo_lesao( "" ); + } + if ( a.getMed_observ().matches( "null" ) ) + { + a.setMed_observ( "" ); + } + if ( a.getFormacao_shst_nao_porque().matches( "null" ) ) + { + a.setFormacao_shst_nao_porque( "" ); + } + if ( a.getConcluido_por_desactivacao() == null ) + { + a.setConcluido_por_desactivacao( Boolean.FALSE ); + a.setData_desactivacao( null ); + a.setComentario_desactivacao( null ); + } + if ( a.getConcluido_por_desactivacao() != null && a.getConcluido_por_desactivacao().equals( Boolean.TRUE ) && a.getData_desactivacao() == null ) + { + a.setData_desactivacao( new Date() ); + } + if ( a.getComentario_desactivacao() != null && "".equals( a.getComentario_desactivacao().trim() ) ) + { + a.setComentario_desactivacao( null ); + } + + +// Statement st = createStatement(); +// String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', "; +// sql += "acidentado_id = " + a.getAcidentado_id() + ", "; +// sql += "estado = " + a.getEstado() + ", "; +// sql += "empresa_id = " + a.getEmpresa_id() + ", "; +// sql += "estabelecimento_id = " + a.getEstabelecimento_id() + ", "; +// sql += "horas_turno = " + a.getHoras_turno() + ", "; +// sql += "departamento_id = " + a.getDepartamento_id() + ", "; +// sql += "seccao_id = " + a.getSeccao_id() + ", "; +// sql += "local_trabalho = '" + a.getLocal_trabalho() + "', "; +// sql += "tarefa = '" + a.getTarefa() + "', "; +// sql += "substancias = '" + a.getSubstancias() + "', "; +//// sql += "superior_hierarquico = '" + a.getSuperior_hierarquico() + "', "; +// sql += "condicoes = '" + a.getCondicoes() + "', "; +// sql += "testemunhas = '" + a.getTestemunhas() + "', "; +// sql += "causas = " + a.getCausas() + ", "; +// sql += "descricao = '" + a.getDescricao() + "', "; +// sql += "conclusoes = '" + a.getConclusoes() + "', "; +// sql += "accoes = '" + a.getAccoes() + "', "; +// sql += "averiguador = '" + a.getAveriguador() + "', "; +// if ( a.getHora_acidente() == null ) +// { +// sql += "hora_acidente = " + null + ", "; +// } +// else +// { +// sql += "hora_acidente = '" + a.getHora_acidente() + "', "; +// } +// +// sql += "formacao_shst = '" + a.getFormacao_shst() + "', "; +// sql += "formacao_shst_nao_porque = '" + a.getFormacao_shst_nao_porque() + "', "; +// sql += "outros_acidentes_com_colaborador = '" + a.getOutros_acidentes_com_colaborador() + "', "; +// sql += "nr_acidentes_com_colaborador = " + a.getNr_acidentes_com_colaborador() + ", "; +// sql += "nr_relatorio_acidente_colaborador1 = " + a.getNr_relatorio_acidente_colaborador1() + ", "; +// sql += "nr_relatorio_acidente_colaborador2 = " + a.getNr_relatorio_acidente_colaborador2() + ", "; +// sql += "nr_relatorio_acidente_colaborador3 = " + a.getNr_relatorio_acidente_colaborador3() + ", "; +// sql += "nr_relatorio_acidente_colaborador4 = " + a.getNr_relatorio_acidente_colaborador4() + ", "; +// sql += "acidentes_outros_colaboradores = '" + a.getAcidentes_outros_colaboradores() + "', "; +// sql += "nr_acidentes_outros_colaboradores = " + a.getNr_acidentes_outros_colaboradores() + ", "; +// sql += "nr_relatorio_acidente_outros_colaboradores1 = " + a.getNr_relatorio_acidente_outros_colaboradores1() + ", "; +// sql += "nr_relatorio_acidente_outros_colaboradores2 = " + a.getNr_relatorio_acidente_outros_colaboradores2() + ", "; +// sql += "nr_relatorio_acidente_outros_colaboradores3 = " + a.getNr_relatorio_acidente_outros_colaboradores3() + ", "; +// sql += "nr_relatorio_acidente_outros_colaboradores4 = " + a.getNr_relatorio_acidente_outros_colaboradores4() + ", "; +// sql += "lesao_cabeca = '" + a.getLesao_cabeca() + "', "; +// sql += "lesao_pescoco = '" + a.getLesao_pescoco() + "', "; +// sql += "lesao_tronco = '" + a.getLesao_tronco() + "', "; +// sql += "lesao_membro_sup_dir = '" + a.getLesao_membro_sup_dir() + "', "; +// sql += "lesao_membro_sup_esq = '" + a.getLesao_membro_sup_esq() + "', "; +// sql += "lesao_membro_inf_dir = '" + a.getLesao_membro_inf_dir() + "', "; +// sql += "lesao_membro_inf_esq = '" + a.getLesao_membro_inf_esq() + "', "; +// sql += "especif1 = '" + a.getEspecif1() + "', "; +// sql += "especif2 = '" + a.getEspecif2() + "', "; +// sql += "especif3 = '" + a.getEspecif3() + "', "; +// sql += "especif4 = '" + a.getEspecif4() + "', "; +// sql += "tipo_lesao = '" + a.getTipo_lesao() + "', "; +// sql += "tipo_incapacidade = '" + a.getTipo_incapacidade() + "', "; +// sql += "coef_incapacidade = " + a.getCoef_incapacidade() + ", "; +// if ( a.getData_aval_incapacidade() == null ) +// { +// sql += "data_aval_incapacidade = " + null + ", "; +// } +// else +// { +// sql += "data_aval_incapacidade = '" + a.getData_aval_incapacidade() + "', "; +// } +// if ( a.getData_rev_incapacidade() == null ) +// { +// sql += "data_rev_incapacidade = " + null + ", "; +// } +// else +// { +// sql += "data_rev_incapacidade = '" + a.getData_rev_incapacidade() + "', "; +// } +// if ( a.getPeriodo_incapacidade_de() == null ) +// { +// sql += "periodo_incapacidade_de = " + null + ", "; +// } +// else +// { +// sql += "periodo_incapacidade_de = '" + a.getPeriodo_incapacidade_de() + "', "; +// } +// if ( a.getPeriodo_incapacidade_a() == null ) +// { +// sql += "periodo_incapacidade_a = " + null + ", "; +// } +// else +// { +// sql += "periodo_incapacidade_a = '" + a.getPeriodo_incapacidade_a() + "', "; +// } +// sql += "img_flexao = '" + a.getImg_flexao() + "', "; +// sql += "img_ext1 = '" + a.getImg_ext1() + "', "; +// sql += "img_ext2 = '" + a.getImg_ext2() + "', "; +// sql += "img_cab2 = '" + a.getImg_cab2() + "', "; +// sql += "img_cab3 = '" + a.getImg_cab3() + "', "; +// sql += "img_ma2 = '" + a.getImg_ma2() + "', "; +// sql += "img_ma3 = '" + a.getImg_ma3() + "', "; +// sql += "img_ma5 = '" + a.getImg_ma5() + "', "; +// sql += "img_ma6 = '" + a.getImg_ma6() + "', "; +// sql += "img_ma8 = '" + a.getImg_ma8() + "', "; +// sql += "img_ma10 = '" + a.getImg_ma10() + "', "; +// sql += "img_rot1 = '" + a.getImg_rot1() + "', "; +// sql += "img_rot2 = '" + a.getImg_rot2() + "', "; +// sql += "img_cab1 = '" + a.getImg_cab1() + "', "; +// sql += "img_cab4 = '" + a.getImg_cab4() + "', "; +// sql += "img_ma1 = '" + a.getImg_ma1() + "', "; +// sql += "img_ma4 = '" + a.getImg_ma4() + "', "; +// sql += "img_ma7 = '" + a.getImg_ma7() + "', "; +// sql += "img_ma9 = '" + a.getImg_ma9() + "', "; +// sql += "restricao_carga = " + a.getRestricao_carga() + ", "; +// sql += "restricao_motricidade = '" + a.getRestricao_motricidade() + "', "; +// sql += "restricao_conducao = '" + a.getRestricao_conducao() + "', "; +// sql += "restricao_vibracoes = '" + a.getRestricao_vibracoes() + "', "; +// sql += "restricao_outras = '" + a.getRestricao_outras() + "', "; +// sql += "med_observ = '" + a.getMed_observ() + "', "; +// sql += "estado_assinatura = " + a.getEstado_assinatura() + ", "; +// sql += "tecnico_saude_id = " + a.getTecnico_saude_id() + ", "; +// sql += "medico_id = " + a.getMedico_id() + ", "; +// sql += "ass_consolidacao = '" + a.getAss_consolidacao() + "', "; +// sql += "ass_resp_seg = '" + a.getAss_resp_seg() + "', "; +// sql += "ass_resp_rh = '" + a.getAss_resp_rh() + "', "; +// if ( a.getData_consolidacao() == null ) +// { +// sql += "data_consolidacao = " + null + ", "; +// } +// else +// { +// sql += "data_consolidacao = '" + a.getData_consolidacao() + "', "; +// } +// if ( a.getData_assinatura_seg() == null ) +// { +// sql += "data_assinatura_seg = " + null + ", "; +// } +// else +// { +// sql += "data_assinatura_seg = '" + a.getData_assinatura_seg() + "', "; +// } +// if ( a.getData_assinatura_rh() == null ) +// { +// sql += "data_assinatura_rh = " + null + ", "; +// } +// else +// { +// sql += "data_assinatura_rh = '" + a.getData_assinatura_rh() + "', "; +// } +// sql += "nome_resp_seg = '" + a.getNome_resp_seg() + "', "; +// sql += "nome_resp_rh = '" + a.getNome_resp_rh() + "', "; +// sql += "correcao = '" + a.getCorrecao() + "', "; +// sql += "observacoes_correcao = '" + a.getObservacoes_correcao() + "', "; +// sql += "estado_antes_correcao = " + a.getEstado_antes_correcao() + ", "; +// sql += "ass_superior = '" + a.getAss_superior() + "', "; +// sql += "nome_superior = '" + a.getNome_superior() + "', "; +// sql += "averiguacao_posterior = '" + a.getAveriguacao_posterior() + "', "; +// sql += "averiguacao_obs = '" + a.getAveriguacao_obs() + "', "; +// sql += "nome_resp_consolidacao = '" + a.getNome_resp_consolidacao() + "', "; +// if ( a.getData_assinatura_superior() == null ) +// { +// sql += "data_assinatura_superior = " + null + ", "; +// } +// else +// { +// sql += "data_assinatura_superior = '" + a.getData_assinatura_superior() + "', "; +// } +// sql += "rh_fase4 = " + a.getRh_fase4() + ", "; +// sql += "concluido_por_desactivacao = " + a.getConcluido_por_desactivacao() + ", "; +// sql += "comentario_desactivacao = " + ( a.getComentario_desactivacao() == null ? "null" : "'" + a.getComentario_desactivacao() + "'" ) + ", "; +// sql += "data_desactivacao = " + ( a.getData_desactivacao() == null ? "null" : "'" + new java.sql.Date( a.getData_desactivacao().getTime() ) + "'" ); +// sql += " WHERE id = " + a.getId(); +// System.out.println( "SQL UPDATE : " + sql ); +// st.execute( sql ); + AnalisesAcidentesData analise = fromAnaliseAcidenteBean( a, false ); + + analise.save(); + } + + public void changeEstado( Correcao c ) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE analises_acidentes SET correcao = '" + c.getCorrecao() + "', estado = " + c.getEstado_corr() + ", estado_antes_correcao = " + c.getEstado_actual() + ", observacoes_correcao = '" + c.getObservacoes() + "' WHERE id = " + c.getAnalise_id(); + st.execute( sql ); + } + + public Integer getMaxRecomendacaoId() + { + Statement st = createStatement(); + String sql = "SELECT max(recomendacoes.id)+1 AS MAXRECOMENDACAOID FROM recomendacoes"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Integer newId = new Integer( rs.getInt( "MAXRECOMENDACAOID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + return newId; + } + catch ( Exception ex ) + { + return new Integer( 1 ); + } + } + + public Integer createRecomendacao( Recomendacao r ) throws Exception + { +// Statement st = createStatement(); +// Integer newId = getMaxRecomendacaoId(); +// String sql = "INSERT INTO recomendacoes (id, analise_id, recomendacao) VALUES ("; +// sql += newId + ", "; +// sql += r.getAnalise_id() + ", '"; +// sql += r.getRecomendacao() + "')"; +// st.execute( sql ); +// +// return newId; + RecomendacoesData recomendacao = fromRecomendacaoBean( r, true ); + recomendacao.save(); + return recomendacao.getId(); + } + + public void updateRecomendacao( Recomendacao r ) + throws Exception + { +// Statement st = createStatement(); +// String sql = "UPDATE recomendacoes SET analise_id = " + r.getAnalise_id() + ", "; +// sql += "recomendacao = '" + r.getRecomendacao() + "' "; +// sql += "WHERE id = " + r.getId(); +// //System.out.println("SQL : " + sql); +// st.execute( sql ); + fromRecomendacaoBean( r, false ).save(); + } + + protected RecomendacoesData fromRecomendacaoBean( Recomendacao recomendacaoBean, boolean criar ) + throws Exception + { + RecomendacoesData recomendacao; + if( !criar && recomendacaoBean.getId() != null ) + { + recomendacao = getProvider().load( RecomendacoesData.class, recomendacaoBean.getId() ); + } + else + { + recomendacao = new RecomendacoesData(); + recomendacao.setProvider( getProvider() ); + } + recomendacao.setAnalise_id( recomendacaoBean.getAnalise_id() ); + recomendacao.setRecomendacao( recomendacaoBean.getRecomendacao() ); + return recomendacao; + } + + public void deleteRecomendacoesByAnalise( Integer analise_id ) throws Exception + { + System.out.println( "DELETE RECOMENDACOES" ); + Statement st = createStatement(); + String sql = "DELETE FROM recomendacoes WHERE analise_id = " + analise_id; + st.execute( sql ); + } + + public void deleteAnaliseAcidente( Integer analise_id ) throws Exception + { + Statement st = createStatement(); + //String sql = "DELETE FROM analises_acidentes WHERE id = " + analise_id; + String sql = "UPDATE analises_acidentes SET apagada = 'y' WHERE id = " + analise_id; + st.execute( sql ); + } + + public void deleteAcidentado( Integer acidentado_id ) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM acidentados WHERE id = " + acidentado_id; + st.execute( sql ); + } + + public ArrayList getRecomendacoesByAnalise( Integer analiseId ) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM recomendacoes WHERE analise_id = " + analiseId; + //System.out.println("SQL : " + sql); + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + Recomendacao r = new Recomendacao(); + r.setId( new Integer( rs.getInt( "id" ) ) ); + r.setAnalise_id( new Integer( rs.getInt( "analise_id" ) ) ); + r.setRecomendacao( rs.getString( "recomendacao" ) ); + list.add( r ); + } + while ( rs.next() ); + } + + return list; + } + + public Integer getMaxMedidaId() + { + Statement st = createStatement(); + String sql = "SELECT max(medidas.id)+1 AS MAXMEDIDAID FROM medidas"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Integer newId = new Integer( rs.getInt( "MAXMEDIDAID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + return newId; + } + catch ( Exception ex ) + { + return new Integer( 1 ); + } + } + + public Integer createMedida( Medida m ) throws Exception + { +// Statement st = createStatement(); +// Integer newId = getMaxMedidaId(); +// String sql = "INSERT INTO medidas (id, analise_id, medida) VALUES ("; +// sql += newId + ", "; +// sql += m.getAnalise_id() + ", '"; +// sql += m.getMedidaForSql() + "')"; +// st.execute( sql ); +// +// return newId; + MedidasData medida = fromMedidaBean( m, true ); + medida.save(); + + return medida.getId(); + } + + public void updateMedida( Medida m ) throws Exception + { +// Statement st = createStatement(); +// String sql = "UPDATE medidas SET analise_id = " + m.getAnalise_id() + ", "; +// sql += "medida = '" + m.getMedidaForSql() + "' "; +// sql += "WHERE id = " + m.getId(); +// //System.out.println("SQL : " + sql); +// st.execute( sql ); + fromMedidaBean( m, false ).save(); + } + + protected MedidasData fromMedidaBean( Medida medidaBean, boolean criar ) + throws Exception + { + MedidasData medida; + if( !criar && medidaBean.getId() != null ) + { + medida = getProvider().load( MedidasData.class, medidaBean.getId() ); + } + else + { + medida = new MedidasData(); + medida.setProvider( getProvider() ); + } + medida.setAnalise_id( medidaBean.getAnalise_id() ); + medida.setMedida( medidaBean.getMedida() ); + return medida; + } + + public void deleteMedidasByAnalise( Integer analise_id ) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM medidas WHERE analise_id = " + analise_id; + st.execute( sql ); + } + + public ArrayList getMedidasByAnalise( Integer analiseId ) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM medidas WHERE analise_id = " + analiseId; + //System.out.println("SQL : " + sql); + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + Medida m = new Medida(); + m.setId( new Integer( rs.getInt( "id" ) ) ); + m.setAnalise_id( new Integer( rs.getInt( "analise_id" ) ) ); + m.setMedida( rs.getString( "medida" ) ); + list.add( m ); + } + while ( rs.next() ); + } + + return list; + } + + public String getNumeroCedula( Integer medico_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT numero_cedula FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String numero_cedula = rslocal.getString( "numero_cedula" ); + return numero_cedula; + } + + public String getTipoDescricao( Integer tipo ) throws Exception + { + Statement st = createStatement(); + String sql = "SELECT descricao FROM tipos_utilizadores WHERE tipo = " + tipo; + ResultSet rs = st.executeQuery( sql ); + rs.first(); + String descricao = rs.getString( "descricao" ); + return descricao; + } + + public com.sun.rave.web.ui.model.Option[] getTiposList() throws Exception + { + ArrayList list = new ArrayList(); + TipoUtilizador t = new TipoUtilizador(); + t.setId( new Integer( 0 ) ); + t.setTipo( new Integer( 0 ) ); + t.setDescricao( "" ); + list.add( t ); + Statement st = createStatement(); + String sql = "SELECT * FROM tipos_utilizadores WHERE activo = 'y' ORDER BY ordem"; + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + t = new TipoUtilizador(); + t.setId( new Integer( rs.getInt( "id" ) ) ); + t.setTipo( new Integer( rs.getInt( "tipo" ) ) ); + t.setDescricao( rs.getString( "descricao" ) ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( t ); + } + while ( rs.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + t = ( TipoUtilizador ) iter.next(); + + listOptions[i] = new Option( t.getTipo(), t.getDescricao() ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTiposList( Integer permissao ) throws Exception + { + ArrayList list = new ArrayList(); + TipoUtilizador t = new TipoUtilizador(); + t.setId( new Integer( 0 ) ); + t.setTipo( new Integer( 0 ) ); + t.setDescricao( "" ); + list.add( t ); + Statement st = createStatement(); + String sql = "SELECT * FROM tipos_utilizadores WHERE activo = 'y' ORDER BY ordem"; + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + t = new TipoUtilizador(); + if ( permissao.intValue() == 7 ) //director rh + { + t.setTipo( new Integer( rs.getInt( "tipo" ) ) ); + if ( t.getTipo().intValue() == 1 || t.getTipo().intValue() == 2 || t.getTipo().intValue() == 6 ) // seguranca || rh || gestor + { + t.setId( new Integer( rs.getInt( "id" ) ) ); + t.setDescricao( rs.getString( "descricao" ) ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( t ); + } + } + else + { + t.setId( new Integer( rs.getInt( "id" ) ) ); + t.setTipo( new Integer( rs.getInt( "tipo" ) ) ); + t.setDescricao( rs.getString( "descricao" ) ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( t ); + } + + } + while ( rs.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + t = ( TipoUtilizador ) iter.next(); + + listOptions[i] = new Option( t.getTipo(), t.getDescricao() ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosList( Integer empresa_id, Boolean booGestor ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + Estabelecimento e = new Estabelecimento(); + e.setId( new Integer( -1 ) ); + + e.setNome( "-Seleccionar-" ); + + list.add( e ); + if ( booGestor.equals( new Boolean( true ) ) ) + { + e = new Estabelecimento(); + e.setId( new Integer( 0 ) ); + e.setNome( "-Todos os estabelecimentos-" ); + + list.add( e ); + } + String sql = "SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; + + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + e = new Estabelecimento(); + e.setId( new Integer( rslocal.getInt( "id" ) ) ); + //e.setNome_plain(rslocal.getString("nome_plain")); + e.setNome( rslocal.getString( "nome" ) ); + System.out.println( "ESTABELECIMENTOAA : " + e.getId().toString() + " - " + e.getNome() ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( e ); + } + while ( rslocal.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + e = ( Estabelecimento ) iter.next(); + System.out.println( "ESTABELECIMENTOL : " + e.getId().toString() + " - " + e.getNome() ); + listOptions[i] = new Option( e.getId(), Utils.unicodeToHTML( e.getNome() ) ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosGestorList( Integer empresa_id, Boolean booGestor ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + Estabelecimento e = null; + //Estabelecimento e = new Estabelecimento(); + //e.setId(new Integer(-1)); + + //e.setNome("-Seleccionar-"); + + //list.add(e); + if ( booGestor.equals( new Boolean( true ) ) ) + { + e = new Estabelecimento(); + e.setId( new Integer( 0 ) ); + e.setNome( "-Todos os estabelecimentos-" ); + + list.add( e ); + } + String sql = "SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; + + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + e = new Estabelecimento(); + e.setId( new Integer( rslocal.getInt( "id" ) ) ); + //e.setNome_plain(rslocal.getString("nome_plain")); + e.setNome( rslocal.getString( "nome" ) ); + System.out.println( "ESTABELECIMENTOAA : " + e.getId().toString() + " - " + e.getNome() ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( e ); + } + while ( rslocal.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + e = ( Estabelecimento ) iter.next(); + System.out.println( "ESTABELECIMENTOL : " + e.getId().toString() + " - " + e.getNome() ); + listOptions[i] = new Option( e.getId(), Utils.unicodeToHTML( e.getNome() ) ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + Medico m = new Medico(); + m.setId( new Integer( 0 ) ); + m.setNome( "-Seleccionar-" ); + list.add( m ); + String sql = "SELECT * FROM medicos WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + m = new Medico(); + m.setId( new Integer( rslocal.getInt( "id" ) ) ); + m.setNome( rslocal.getString( "nome" ) ); + list.add( m ); + } + while ( rslocal.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + m = ( Medico ) iter.next(); + + listOptions[i] = new Option( m.getId(), Utils.unicodeToHTML( m.getNome() ) ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId( new Integer( 0 ) ); + t.setNome( "-Seleccionar-" ); + list.add( t ); + String sql = "SELECT * FROM marcacoes_tecnicos_hst WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + t = new TecnicoSaude(); + t.setId( new Integer( rslocal.getInt( "id" ) ) ); + t.setNome( rslocal.getString( "nome" ) ); + list.add( t ); + } + while ( rslocal.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + t = ( TecnicoSaude ) iter.next(); + + listOptions[i] = new Option( t.getId(), Utils.unicodeToHTML( t.getNome() ) ); + i++; + } + return listOptions; + } + + + public com.sun.rave.web.ui.model.Option[] getCausasAcidente( boolean toStatistics ) throws Exception + { + com.sun.rave.web.ui.model.Option[] options = null; + + Select2 query = new Select2( + new String[] { CausasData.TABLENAME }, + new Integer[] { }, + new Expression[] { }, + new String[] { CausasData.ID_FULL, CausasData.CAUSA_FULL }, + new Field( CausasData.ACTIVA_FULL ).isEqual( "y" ), + new String[] { CausasData.ID_FULL, CausasData.CAUSA_FULL }, + null, null, null + ); + Virtual2DArray array = getExecuter().executeQuery( query ); + if ( array != null ) + { + options = new com.sun.rave.web.ui.model.Option[ array.columnLength() + 1 ]; + options[ 0 ] = toStatistics ? new Option( "", "" ) : new Option( new Integer( 0 ), "-Seleccionar" ); + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer causaID = array.get( i, 0 ); + String causa = array.get( i, 1 ); + options[ (i+1) ] = new Option( causaID, causa ); + } + } + return options; + } + +// public com.sun.rave.web.ui.model.Option[] getCausasList() throws Exception +// { +// ArrayList list = new ArrayList(); +// Causa c = new Causa(); +// c.setId( new Integer( 0 ) ); +// c.setCausa( "-Seleccionar-" ); +// list.add( c ); +// Statement st = createStatement(); +// String sql = "SELECT * FROM causas WHERE activa = 'y'"; +// ResultSet rs = st.executeQuery( sql ); +// if ( rs.isBeforeFirst() ) +// { +// rs.first(); +// do +// { +// c = new Causa(); +// c.setId( new Integer( rs.getInt( "id" ) ) ); +// c.setCausa( rs.getString( "causa" ) ); +// list.add( c ); +// } +// while ( rs.next() ); +// } +// +// com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; +// ListIterator iter = list.listIterator(); +// int i = 0; +// while ( iter.hasNext() ) +// { +// c = ( Causa ) iter.next(); +// +// listOptions[i] = new Option( c.getId(), c.getCausa() ); +// i++; +// } +// return listOptions; +// } + + public com.sun.rave.web.ui.model.Option[] getDepartamentosList() throws Exception + { + ArrayList list = new ArrayList(); + Departamento d = new Departamento(); + + d.setId( new Integer( 0 ) ); + d.setDescricao( "-Todos-" ); + list.add( d ); + Statement st = createStatement(); + String sql = "SELECT * FROM departamentos WHERE activo = 'y'"; + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + d = new Departamento(); + d.setId( new Integer( rs.getInt( "id" ) ) ); + d.setDescricao( rs.getString( "descricao" ) ); + list.add( d ); + } + while ( rs.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + d = ( Departamento ) iter.next(); + + listOptions[i] = new Option( d.getId(), d.getDescricao() ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getSeccoesList( Integer departamento_id ) throws Exception + { + ArrayList list = new ArrayList(); + Seccao s = new Seccao(); + + s.setId( new Integer( 0 ) ); + s.setDescricao( "-Seleccionar-" ); + list.add( s ); + Statement st = createStatement(); + String sql = ""; + if ( departamento_id == null ) // todos + { + sql = "SELECT * FROM seccoes WHERE activo = 'y'"; + } + else + { + sql = "SELECT * FROM seccoes WHERE activo = 'y' AND departamento_id = " + departamento_id; + } + + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + s = new Seccao(); + s.setId( new Integer( rs.getInt( "id" ) ) ); + s.setDescricao( rs.getString( "descricao" ) ); + s.setDepartamento_id( new Integer( rs.getInt( "departamento_id" ) ) ); + list.add( s ); + } + while ( rs.next() ); + } + + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[ list.size() ]; + ListIterator iter = list.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + s = ( Seccao ) iter.next(); + + listOptions[i] = new Option( s.getId(), s.getDescricao() ); + i++; + } + return listOptions; + } + + public Causa getCausa( Integer id ) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql = "SELECT * FROM causas WHERE id = " + id; + + ResultSet rs = st.executeQuery( sql ); + Causa c = null; + if ( rs.first() ) + { + c = new Causa(); + c.setId( new Integer( rs.getInt( "id" ) ) ); + c.setCausa( rs.getString( "causa" ) ); + } + return c; + } + + public Seccao getSeccao( Integer id ) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql = "SELECT * FROM seccoes WHERE id = " + id + " AND activo = 'y'"; + + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Seccao s = new Seccao(); + s.setId( new Integer( rs.getInt( "id" ) ) ); + s.setDescricao( rs.getString( "descricao" ) ); + return s; + } + + public List getDistinctYears( Integer excludeYear ) throws Exception + { + List result = new LinkedList(); + + Expression where = new Field( "apagada" ).isEqual( "n" ); + if ( excludeYear != null ) + { + where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).notIn( new Integer[] { excludeYear } ) ); + } + Select2 query = new Select2( + new String[] { "analises_acidentes" }, + new Integer[] { }, + new Expression[] { }, + new String[] { "DISTINCT( cast( EXTRACT( year FROM data_acidente ) as integer ) ) AS ano" }, + where, + new String[] { "ano DESC" }, + null, null, null ); + query.disableOrderFieldsVerification(); + Virtual2DArray array = getExecuter().executeQuery( query ); + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer ano = array.get( i, 0 ); + result.add( ano ); + } + return result; + } + + public ArrayList getAnosListFromAnalises() throws Exception + { + ArrayList list = new ArrayList(); + + String sql = "SELECT DISTINCT EXTRACT( year FROM data_acidente ) AS ano " + + "FROM analises_acidentes " + + "WHERE " + + "apagada = 'n' AND estado = " + Global.ESTADO_CONCLUIDO + + " ORDER BY ano"; + + Statement st = createStatement(); + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + Double dAno = new Double( rs.getDouble( "ano" ) ); + Integer iAno = new Integer( dAno.intValue() ); + list.add( iAno ); + } + while ( rs.next() ); + } + return list; + } + + public String getFase( int estado ) + { + if ( estado == Global.ESTADO_SEG ) + { + return "FASE 1 - SEG - ABERTURA"; + } + else if ( estado == Global.ESTADO_RH1 ) + { + return "FASE 2 - RH - ACOMPANHAMENTO"; + } + else if ( estado == Global.ESTADO_HS ) + { + return "FASE 3 - SIPRP - RECOMENDAÇÕES"; + } + else if ( estado == Global.ESTADO_RH2 ) + { + return "FASE 4 - RH - MEDIDAS + LESÃO"; + } +// else if(estado == Global.ESTADO_MEDICINA) +// { +// return "Medicina"; +// } + else if ( estado == Global.ESTADO_CONSOLIDACAO ) + { + return "FASE 5 - SIPRP - CONSOLIDAÇÃO"; + } +// else if(estado == Global.ESTADO_ASSINATURAS) +// { +// return "Verificação"; +// } +// else if(estado == Global.ESTADO_IMPRESSAO) +// { +// return "Impressão"; +// } + else if ( estado == Global.ESTADO_ASSINATURA_SEG ) + { + return "FASE 6 - SEG - VERIFICAÇÃO SEG."; + } + else if ( estado == Global.ESTADO_ASSINATURA_RH ) + { + return "FASE 7 - RH - VERIFICAÇÃO RH"; + } + else if ( estado == Global.ESTADO_FECHAR ) + { + return "FASE 8 - SIPRP - CONCLUSÃO"; + } + else if ( estado == Global.ESTADO_CONCLUIDO ) + { + return "FASE 9 - CONCLUÍDO"; + } + return null; + } + + public HashMap getMetaData( String table ) throws Exception + { + Statement st = createStatement(); + String sql = "select * from " + table; + + ResultSet rs = st.executeQuery( sql ); + ResultSetMetaData rsmd = rs.getMetaData(); + + HashMap hash = new HashMap(); + int cols = rsmd.getColumnCount(); + + for ( int i = 0; i < cols; i++ ) + { + String field = rsmd.getColumnName( i + 1 ); + int len = rsmd.getPrecision( i + 1 ); + hash.put( field, new Integer( len ) ); + } + return hash; + } + + public byte[] getLogoByEmpresa( Integer empresaID ) throws Exception + { + byte[] result = null; + String sql = "SELECT empresa_logo_id FROM empresas WHERE id = " + empresaID; + Statement st = createLocalStatement(); + ResultSet rslocal = st.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + Integer logoId = new Integer( rslocal.getInt( "empresa_logo_id" ) ); + result = getLogo( logoId ); + } + return result; + } + + private byte[] getLogo( Integer logoID ) throws Exception + { + System.out.println( "AnalisesDataProvider . getLogo( " + logoID + " ) : " ); + + byte[] result = null; + String sql = "SELECT image_data FROM image WHERE id = " + logoID; + Statement st = createLocalStatement(); + ResultSet rslocal = st.executeQuery( sql ); + if ( rslocal.first() ) + { + result = rslocal.getBytes( "image_data" ); + } + System.out.println( "\tLOGO SIZE : " + ( result == null ? "null" : result.length ) ); + return result; + } + + protected AnalisesAcidentesData fromAnaliseAcidenteBean( AnaliseAcidente analiseBean, boolean criar ) + throws Exception + { + AnalisesAcidentesData analise; + boolean nova = false; + if( !criar && analiseBean.getId() != null ) + { + analise = getProvider().load( AnalisesAcidentesData.class, analiseBean.getId() ); + } + else + { + analise = new AnalisesAcidentesData(); + analise.setProvider( getProvider() ); + nova = true; + } + + analise.setAveriguador( analiseBean.getAveriguador() ); + analise.setData_acidente( analiseBean.getData_acidente() ); + analise.setAcidentado_id( analiseBean.getAcidentado_id() ); + analise.setEstado( analiseBean.getEstado() ); + analise.setEmpresa_id( analiseBean.getEmpresa_id() ); + analise.setEstabelecimento_id( analiseBean.getEstabelecimento_id() ); + analise.setHoras_turno( analiseBean.getHoras_turno() ); + analise.setDepartamento_id( analiseBean.getDepartamento_id() ); + analise.setSeccao_id( analiseBean.getSeccao_id() ); + analise.setLocal_trabalho( analiseBean.getLocal_trabalho() ); + analise.setTarefa( analiseBean.getTarefa() ); + analise.setSubstancias( analiseBean.getSubstancias() ); + analise.setCondicoes( analiseBean.getCondicoes() ); + analise.setTestemunhas( analiseBean.getTestemunhas() ); + analise.setCausas( analiseBean.getCausas() ); + analise.setDescricao( analiseBean.getDescricao() ); + analise.setConclusoes( analiseBean.getConclusoes() ); + analise.setAccoes( analiseBean.getAccoes() ); + analise.setHora_acidente( analiseBean.getHora_acidente() ); + analise.setMedico_id( analiseBean.getMedico_id() ); + analise.setTecnico_saude_id( analiseBean.getTecnico_saude_id() ); + analise.setAveriguacao_posterior( analiseBean.getAveriguacao_posterior() ); + analise.setAveriguacao_obs( analiseBean.getAveriguacao_obs() ); + analise.setData_inicio_processo( analiseBean.getData_inicio_processo() ); + analise.setAnalise_nr( analiseBean.getAnalise_nr() ); + analise.setCoef_incapacidade( analiseBean.getCoef_incapacidade() ); + analise.setConcluido_por_desactivacao( nova ? Boolean.FALSE : analiseBean.getConcluido_por_desactivacao() ); + analise.setData_desactivacao( nova ? null : analiseBean.getData_desactivacao() ); + analise.setComentario_desactivacao( nova ? null : analiseBean.getComentario_desactivacao() ); + if( !nova ) + { + analise.setFormacao_shst( analiseBean.getFormacao_shst() ); + analise.setFormacao_shst_nao_porque( analiseBean.getFormacao_shst_nao_porque() ); + analise.setOutros_acidentes_com_colaborador( analiseBean.getOutros_acidentes_com_colaborador() ); + analise.setNr_acidentes_com_colaborador( analiseBean.getNr_acidentes_com_colaborador() ); + analise.setNr_relatorio_acidente_colaborador1( analiseBean.getNr_relatorio_acidente_colaborador1() ); + analise.setNr_relatorio_acidente_colaborador2( analiseBean.getNr_relatorio_acidente_colaborador2() ); + analise.setNr_relatorio_acidente_colaborador3( analiseBean.getNr_relatorio_acidente_colaborador3() ); + analise.setNr_relatorio_acidente_colaborador4( analiseBean.getNr_relatorio_acidente_colaborador4() ); + analise.setAcidentes_outros_colaboradores( analiseBean.getAcidentes_outros_colaboradores() ); + analise.setNr_acidentes_outros_colaboradores( analiseBean.getNr_acidentes_outros_colaboradores() ); + analise.setNr_relatorio_acidente_outros_colaboradores1( analiseBean.getNr_relatorio_acidente_outros_colaboradores1() ); + analise.setNr_relatorio_acidente_outros_colaboradores2( analiseBean.getNr_relatorio_acidente_outros_colaboradores2() ); + analise.setNr_relatorio_acidente_outros_colaboradores3( analiseBean.getNr_relatorio_acidente_outros_colaboradores3() ); + analise.setNr_relatorio_acidente_outros_colaboradores4( analiseBean.getNr_relatorio_acidente_outros_colaboradores4() ); + analise.setLesao_cabeca( analiseBean.getLesao_cabeca() ); + analise.setLesao_pescoco( analiseBean.getLesao_pescoco() ); + analise.setLesao_tronco( analiseBean.getLesao_tronco() ); + analise.setLesao_membro_sup_dir( analiseBean.getLesao_membro_sup_dir() ); + analise.setLesao_membro_sup_esq( analiseBean.getLesao_membro_sup_esq() ); + analise.setLesao_membro_inf_dir( analiseBean.getLesao_membro_inf_dir() ); + analise.setLesao_membro_inf_esq( analiseBean.getLesao_membro_inf_esq() ); + analise.setEspecif1( analiseBean.getEspecif1() ); + analise.setEspecif2( analiseBean.getEspecif2() ); + analise.setEspecif3( analiseBean.getEspecif3() ); + analise.setEspecif4( analiseBean.getEspecif4() ); + analise.setTipo_lesao( analiseBean.getTipo_lesao() ); + analise.setTipo_incapacidade( analiseBean.getTipo_incapacidade() ); + analise.setData_aval_incapacidade( analiseBean.getData_aval_incapacidade() ); + analise.setData_rev_incapacidade( analiseBean.getData_rev_incapacidade() ); + analise.setPeriodo_incapacidade_de( analiseBean.getPeriodo_incapacidade_de() ); + analise.setPeriodo_incapacidade_a( analiseBean.getPeriodo_incapacidade_a() ); + analise.setImg_flexao( analiseBean.getImg_flexao() ); + analise.setImg_ext1( analiseBean.getImg_ext1() ); + analise.setImg_ext2( analiseBean.getImg_ext2() ); + analise.setImg_cab2( analiseBean.getImg_cab2() ); + analise.setImg_cab3( analiseBean.getImg_cab3() ); + analise.setImg_ma2( analiseBean.getImg_ma2() ); + analise.setImg_ma3( analiseBean.getImg_ma3() ); + analise.setImg_ma5( analiseBean.getImg_ma5() ); + analise.setImg_ma6( analiseBean.getImg_ma6() ); + analise.setImg_ma8( analiseBean.getImg_ma8() ); + analise.setImg_ma10( analiseBean.getImg_ma10() ); + analise.setImg_rot1( analiseBean.getImg_rot1() ); + analise.setImg_rot2( analiseBean.getImg_rot2() ); + analise.setImg_cab1( analiseBean.getImg_cab1() ); + analise.setImg_cab4( analiseBean.getImg_cab4() ); + analise.setImg_ma1( analiseBean.getImg_ma1() ); + analise.setImg_ma4( analiseBean.getImg_ma4() ); + analise.setImg_ma7( analiseBean.getImg_ma7() ); + analise.setImg_ma9( analiseBean.getImg_ma9() ); + analise.setRestricao_carga( analiseBean.getRestricao_carga() ); + analise.setRestricao_motricidade( analiseBean.getRestricao_motricidade() ); + analise.setRestricao_conducao( analiseBean.getRestricao_conducao() ); + analise.setRestricao_vibracoes( analiseBean.getRestricao_vibracoes() ); + analise.setRestricao_outras( analiseBean.getRestricao_outras() ); + analise.setMed_observ( analiseBean.getMed_observ() ); + analise.setEstado_assinatura( analiseBean.getEstado_assinatura() ); + analise.setAss_consolidacao( analiseBean.getAss_consolidacao() ); + analise.setAss_resp_seg( analiseBean.getAss_resp_seg() ); + analise.setAss_resp_rh( analiseBean.getAss_resp_rh() ); + analise.setData_consolidacao( analiseBean.getData_consolidacao() ); + analise.setData_assinatura_seg( analiseBean.getData_assinatura_seg() ); + analise.setData_assinatura_rh( analiseBean.getData_assinatura_rh() ); + analise.setNome_resp_seg( analiseBean.getNome_resp_seg() ); + analise.setNome_resp_rh( analiseBean.getNome_resp_rh() ); + analise.setCorrecao( analiseBean.getCorrecao() ); + analise.setObservacoes_correcao( analiseBean.getObservacoes_correcao() ); + analise.setEstado_antes_correcao( analiseBean.getEstado_antes_correcao() ); + analise.setAss_superior( analiseBean.getAss_superior() ); + analise.setNome_superior( analiseBean.getNome_superior() ); + analise.setNome_resp_consolidacao( analiseBean.getNome_resp_consolidacao() ); + analise.setData_assinatura_superior( analiseBean.getData_assinatura_superior() ); + analise.setRh_fase4( analiseBean.getRh_fase4() ); + } + analise.setParticipado( ( analiseBean.getParticipado() != null && analiseBean.getParticipado() ) ? "y" : "n" ); + analise.setNome_responsavel_participacao( analiseBean.getNomeResponsavelParticipacao() ); + analise.setData_participacao( analiseBean.getDataParticipacao() ); + + return analise; + } + + protected AcidentadosData fromAcidentadoBean( Acidentado acidentadoBean, boolean criar ) + throws Exception + { + AcidentadosData acidentado; + if( !criar && acidentadoBean.getId() != null ) + { + acidentado = getProvider().load( AcidentadosData.class, acidentadoBean.getId() ); + } + else + { + acidentado = new AcidentadosData(); + acidentado.setProvider( getProvider() ); + } + acidentado.setNome( acidentadoBean.getNome() ); + acidentado.setData_nascimento( acidentadoBean.getData_nascimento() ); + acidentado.setBilhete_identidade( acidentadoBean.getBilhete_identidade() ); + acidentado.setMorada( acidentadoBean.getMorada() ); + acidentado.setCod_postal( acidentadoBean.getCod_postal() ); + acidentado.setLocalidade( acidentadoBean.getLocalidade() ); + acidentado.setContacto_telefonico( acidentadoBean.getContacto_telefonico() ); + acidentado.setData_admissao( acidentadoBean.getData_admissao() ); + acidentado.setTurno( acidentadoBean.getTurno() ); + acidentado.setFuncao( acidentadoBean.getFuncao() ); + acidentado.setTrabalhador_id( acidentadoBean.getTrabalhador_id() ); + acidentado.setNumero_mecanografico( acidentadoBean.getNumero_mecanografico() ); + acidentado.setNome_superior_hierarquico( acidentadoBean.getNome_superior_hierarquico() ); + acidentado.setEmail_superior_hierarquico( acidentadoBean.getEmail_superior_hierarquico() ); + acidentado.setEstabelecimento_origem( acidentadoBean.getEstabelecimento_origem() ); + acidentado.setData_email_superior_hierarquico( acidentadoBean.getData_email_superior_hierarquico() ); + + return acidentado; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesSeguimentoDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesSeguimentoDataProvider.java new file mode 100644 index 00000000..f6c95e32 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/AnalisesSeguimentoDataProvider.java @@ -0,0 +1,24 @@ +/* + * AnalisesSeguimentoDataProvider.java + * + * Created on September 20, 2007, 1:42 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class AnalisesSeguimentoDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of AnalisesSeguimentoDataProvider */ + public AnalisesSeguimentoDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/EstadosCorrecaoDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/EstadosCorrecaoDataProvider.java new file mode 100644 index 00000000..84fa6987 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/EstadosCorrecaoDataProvider.java @@ -0,0 +1,24 @@ +/* + * EstadosCorrecaoDataProvider.java + * + * Created on November 29, 2007, 9:50 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class EstadosCorrecaoDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of EstadosCorrecaoDataProvider */ + public EstadosCorrecaoDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/EstatisticasDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/EstatisticasDataProvider.java new file mode 100644 index 00000000..2f2f9587 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/EstatisticasDataProvider.java @@ -0,0 +1,320 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package db.providers; + +import db.*; +import beans.EstatisticaProcessoBean; +import com.evolute.utils.arrays.Virtual2DArray; +import com.evolute.utils.error.ErrorLogger; +import com.evolute.utils.sql.Expression; +import com.evolute.utils.sql.Field; +import com.evolute.utils.sql.Select; +import com.evolute.utils.sql.Select2; +import com.sun.rave.web.ui.model.Option; +import db.data.siprp.outer.CausasData; +import db.data.siprp.outer.SeccoesData; +import db.data.siprp_local.outer.EstabelecimentosData; +import global.Global; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * + * @author dneves + */ +public class EstatisticasDataProvider extends GenericDataProvider +{ + private static final SimpleDateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); + private static final SimpleDateFormat T_F = new SimpleDateFormat( "HH:mm:ss" ); + + + private static EstatisticasDataProvider INSTANCE = null; + + private EstatisticasDataProvider() throws Exception + { + super(); + } + + public static synchronized EstatisticasDataProvider getInstance() throws Exception + { + if ( INSTANCE == null ) + { + INSTANCE = new EstatisticasDataProvider(); + } + return INSTANCE; + } + +// private Statement createStatement() +// { +// if ( db == null ) +// { +// db = new Db(); +// } +// return db.createStatement(); +// } + + public List< EstatisticaProcessoBean > getEstatisticas( Map< String, Object > searchProperties ) + { + String por = ( String ) searchProperties.get( EstatisticasConstants.KEY_POR ); + String nome = ( String ) searchProperties.get( EstatisticasConstants.KEY_NOME ); + String anoOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_ANO_OCORRENCIA ); + Date dataOcorrencia = ( Date ) searchProperties.get( EstatisticasConstants.KEY_DATA_OCORRENCIA ); + String horaOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORA_OCORRENCIA ); + String horasTrabalhadas = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORAS_TRABALHADAS ); +// String departamento = ( String ) searchProperties.get( EstatisticasConstants.KEY_DEPARTAMENTO ); + Integer estabelecimentoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_ESTABELECIMENTO ); + Integer seccaoID = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_SECCAO ); + Integer causas = ( Integer ) searchProperties.get( EstatisticasConstants.KEY_CAUSAS_ACIDENTE ); + String turno = ( String ) searchProperties.get( EstatisticasConstants.KEY_TURNO_TRABALHO ); + Boolean formacao_shst = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_FORMACAO_SHST ); + Boolean participado_seguro = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_PARTICIPADO_SEGURO ); + Boolean postoAcidentado = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_POSTO_ACIDENTADO ); + Boolean outrosAcidentados = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_OUTROS_ACIDENTADOS ); + + String tableNames = "analises_acidentes"; + String joinConditions = ""; + String whereConditions = " analises_acidentes.apagada = 'n' "; + + if ( por != null || nome != null || turno != null ) + { + tableNames += ", acidentados"; + joinConditions += " analises_acidentes.acidentado_id = acidentados.id "; + } +// if ( departamento != null ) +// { +// tableNames += ", departamentos"; +// joinConditions += ( "".equals( joinConditions ) ? "" : " AND " ) + " analises_acidentes.departamento_id = departamentos.id "; +// } + + if ( por != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_POR + " = '" + por + "' "; + } + if ( nome != null ) + { + nome = nome.replaceAll( " ", "%" ); + whereConditions += " AND " + EstatisticasConstants.KEY_NOME + " ILIKE '%" + nome + "%' "; + } + if ( turno != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_TURNO_TRABALHO + " = '" + turno + "' "; + } + + if ( anoOcorrencia != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_ANO_OCORRENCIA + " = '" + anoOcorrencia + "' "; + } + if ( dataOcorrencia != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_DATA_OCORRENCIA + " = '" + D_F.format( dataOcorrencia ) + "' "; + } + if ( horaOcorrencia != null ) + { + String hora = null; + try + { + Date dateOcorrencia = T_F.parse( horaOcorrencia ); + hora = T_F.format( dateOcorrencia ); + } + catch ( ParseException ex ) + { + ErrorLogger.logException( ex ); + } + if ( hora != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_HORA_OCORRENCIA + " = '" + hora + "' " ; + } + } + if ( horasTrabalhadas != null ) + { + Integer nrHoras = null; + try + { + nrHoras = Integer.parseInt( horasTrabalhadas ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + if ( nrHoras != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_HORAS_TRABALHADAS + " = " + nrHoras + " "; + } + } + if ( causas != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_CAUSAS_ACIDENTE + " = " + causas + " "; + } +// if ( departamento != null ) +// { +// departamento = departamento.replaceAll( " ", "%" ); +// whereConditions += " AND " + EstatisticasConstants.KEY_DEPARTAMENTO + " ILIKE '%" + departamento + "%' "; +// } + if ( estabelecimentoID != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_ESTABELECIMENTO + " = " + estabelecimentoID + " "; + } + if ( seccaoID != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_SECCAO + " = " + seccaoID + " "; + } + if ( formacao_shst != null ) + { + /** + * opcoes possiveis : 'y', 'n', 't' ( AnaliseAcidentesTrabalho.java ) + * 'y' -> if ( yes selected ) + * 'n' -> if ( ! yes selected ) && ( no selected ) + * 't' -> else + */ + whereConditions += " AND " + EstatisticasConstants.KEY_FORMACAO_SHST + " = '" + ( formacao_shst ? "y" : "n" ) + "' "; + } + + if( participado_seguro != null ) + { + whereConditions += " AND " + EstatisticasConstants.KEY_PARTICIPADO_SEGURO + " = '" + ( participado_seguro ? "y" : "n" ) + "' "; + } + + String sql = "SELECT analises_acidentes.estado, COUNT( analises_acidentes.* ) AS count " + + "FROM " + tableNames + " " + + "WHERE " + ( "".equals( joinConditions ) ? "" : joinConditions + " AND " ) + whereConditions + " " + + "GROUP BY analises_acidentes.estado " + + "ORDER BY analises_acidentes.estado"; + + List< EstatisticaProcessoBean > stats = new LinkedList< EstatisticaProcessoBean >(); + try + { + stats = getEstatisticasForSQL( sql ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + return stats; + } + + + private List< EstatisticaProcessoBean > getEstatisticasForSQL( String sql ) throws Exception + { + System.out.println( "\nEstatisticasQuery : " + sql + "\n" ); + + List< EstatisticaProcessoBean > stats = new LinkedList< EstatisticaProcessoBean >(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Virtual2DArray array = getExecuter().executeQuery( new Select( sql ) ); + if ( array != null ) + { + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer estado = array.get( i, 0 ); + Long count = array.get( i, 1 ); + String fase = adp.getFase( estado ); + + if ( fase != null ) + { + EstatisticaProcessoBean bean = new EstatisticaProcessoBean(); + bean.setEstado( estado ); + bean.setCount( count ); + bean.setFase( fase ); + stats.add( bean ); + } + } + } + return stats; + } + + public com.sun.rave.web.ui.model.Option[] getSeccoesList( ) throws Exception + { + com.sun.rave.web.ui.model.Option[] options = null; + Select2 query = new Select2( + new String[] { SeccoesData.TABLENAME }, + new Integer[] { }, + new Expression[] { }, + new String[] { SeccoesData.ID_FULL, SeccoesData.DESCRICAO_FULL }, + new Field( SeccoesData.ACTIVO_FULL ).isEqual( "y" ).and( new Field( SeccoesData.DESCRICAO_FULL ).isDifferent( null ) ), + new String[] { SeccoesData.DESCRICAO_FULL }, + null, null, null + ); + + Virtual2DArray array = getExecuter().executeQuery( query ); + if ( array != null ) + { + options = new com.sun.rave.web.ui.model.Option[ array.columnLength() + 1 ]; + options[ 0 ] = new Option( "", "" ); + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer seccaoID = array.get( i, 0 ); + String seccao = array.get( i, 1 ); + + options[ (i+1) ] = new Option( seccaoID, seccao ); + } + } + return options; + } + + public SeccoesData loadSeccaoByID( Integer seccaoID ) throws Exception + { + return getProvider().load( SeccoesData.class, seccaoID, SeccoesData.ID ); + } + + public String getCausaByID( Integer causaID ) throws Exception + { + String causa = ""; + + CausasData causaData = getProvider().load( CausasData.class, causaID, CausasData.ID ); + if ( causaData != null ) + { + causa = causaData.getCausa(); + } + return causa; + } + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentos() throws Exception + { + com.sun.rave.web.ui.model.Option[] options = null; + + Select2 query = new Select2( + new String[] { EstabelecimentosData.TABLENAME }, + new Integer[] { }, + new Expression[] {}, + new String[] { + EstabelecimentosData.ID_FULL, EstabelecimentosData.NOME_FULL + }, + new Field( EstabelecimentosData.INACTIVO_FULL ).isDifferent( "y" ) + .and( new Field( EstabelecimentosData.EMPRESA_ID_FULL ).isEqual( Global.AUCHAN ) ), + new String[] { EstabelecimentosData.NOME_FULL }, + null, null, null ); + Virtual2DArray array = getLocalExecuter().executeQuery( query ); + if ( array != null ) + { + options = new com.sun.rave.web.ui.model.Option[ array.columnLength() + 1 ]; + options[ 0 ] = new Option( "", "" ); + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer estabelecimentoID = array.get( i, 0 ); + String estabelecimentoNome = array.get( i, 1 ); + options[ ( i + 1 ) ] = new Option( estabelecimentoID, estabelecimentoNome ); + } + } + return options; + } + + public String getEstabelecimentoByID( Integer estabelecimentoID ) throws Exception + { + String estabelecimento = ""; + EstabelecimentosData estabelecimentoData = getLocalProvider().load( EstabelecimentosData.class, estabelecimentoID, EstabelecimentosData.ID ); + if ( estabelecimentoData != null ) + { + estabelecimento = estabelecimentoData.getNome(); + } + return estabelecimento; + } + +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/EvoBaseProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/EvoBaseProvider.java new file mode 100644 index 00000000..f67a64a0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/EvoBaseProvider.java @@ -0,0 +1,370 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package db.providers; + +import com.evolute.entity.ProviderInterface; +import com.evolute.entity.ProviderRegistry; +import com.evolute.entity.evo.EvoDataException; +import com.evolute.entity.evo.EvoDataObject; +import com.evolute.entity.evo.EvoDataProvider; +import com.evolute.entity.evo.EvoDataProviderFactory; +import com.evolute.entity.utils.ConnectionIdentity; +import com.evolute.utils.Singleton; +import com.evolute.utils.db.DBException; +import com.evolute.utils.db.DBManager; +import com.evolute.utils.db.Executer; +import com.evolute.utils.db.JDBCManager; +import com.evolute.utils.error.ErrorLogger; +import com.evolute.utils.jdbc.DBStatementExecuter; +import com.evolute.utils.jdbc.StatementExecuterFactory; +import com.evolute.utils.sql.SQLQuery; +import com.evolute.utils.sql.backend.BackendProvider; +import com.evolute.utils.strings.UnicodeChecker; +import db.DBConstants; +import db.DBPropertiesLoader; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; +import javax.servlet.http.HttpSession; + +/** + * + * @author dneves + */ +public class EvoBaseProvider +{ + private static EvoBaseProvider INSTANCE = null; + + private ProviderInterface< EvoDataObject< ? >, EvoDataException > providerInterface; + private DBManager dbManager; + + private ProviderInterface< EvoDataObject< ? >, EvoDataException > localProviderInterface; + private DBManager localDBManager; + + private EvoBaseProvider() throws DBException + { + init(); + } + + public static synchronized EvoBaseProvider getInstance() throws DBException + { + if ( INSTANCE == null ) + { + INSTANCE = new EvoBaseProvider(); + } + return INSTANCE; + } + + private void init() throws DBException + { + System.out.println( "EvoBaseProvider . init() : " ); + + String server = DBPropertiesLoader.getInstance().findProperty( DBConstants.SERVER_SIPRP ); + int port = DBPropertiesLoader.getInstance().findProperty( DBConstants.PORT_SIPRP, -1 ); + String dbname = DBPropertiesLoader.getInstance().findProperty( DBConstants.DATABASE_SIPRP ); + String username = DBPropertiesLoader.getInstance().findProperty( DBConstants.USERNAME_SIPRP ); + String password = DBPropertiesLoader.getInstance().findProperty( DBConstants.PASSWORD_SIPRP ); + +// System.out.println( "\t" + server + " : " + port + " : " + dbname + " : " + username + " : " + password ); + + String server_local = DBPropertiesLoader.getInstance().findProperty( DBConstants.SERVER_SIPRP_LOCAL ); + int port_local = DBPropertiesLoader.getInstance().findProperty( DBConstants.PORT_SIPRP_LOCAL, -1 ); + String dbname_local = DBPropertiesLoader.getInstance().findProperty( DBConstants.DATABASE_SIPRP_LOCAL ); + String username_local = DBPropertiesLoader.getInstance().findProperty( DBConstants.USERNAME_SIPRP_LOCAL ); + String password_local = DBPropertiesLoader.getInstance().findProperty( DBConstants.PASSWORD_SIPRP_LOCAL ); + +// System.out.println( "\t" + server_local + " : " + port_local + " : " + dbname_local + " : " + username_local + " : " + password_local ); + + init( DBConstants.DB.SIPRP, server, port, dbname, username, password ); + init( DBConstants.DB.SIPRP_LOCAL, server_local, port_local, dbname_local, username_local, password_local ); + } + + private void init( DBConstants.DB db, String dbServer, Integer dbPort, String dbName, String dbUsername, String dbPassword ) + throws DBException + { + String dbUrl = "jdbc:postgresql://" + dbServer + ":" + dbPort + "/" + dbName + "?prepareThreshold=2"; + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + Singleton.setInstance( DBConstants.CONNECTION_URL, dbUrl ); + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + Singleton.setInstance( DBConstants.LOCAL_CONNECTION_URL, dbUrl ); + } + + createDBManager( db, dbUsername, dbPassword ); + initProviderConnection( db, dbUsername, dbPassword ); + } + + private void createDBManager( DBConstants.DB db, String username, String password ) + throws DBException + { + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + if( dbManager != null ) + { + dbManager.close(); + } + String dbUrl = ( String ) Singleton.getInstance( DBConstants.CONNECTION_URL ); + DBManager manager = new JDBCManager( dbUrl, username, password , 14, 7, 7, new SQLQuery[] { } ); + StatementExecuterFactory.initialize( new DBStatementExecuter( manager.getSharedExecuter( EvoBaseProvider.class ) ) ); + UnicodeChecker.setUseDoubleSlash( true ); +// Insert.setDefaultKeyRetriever( PostgresqlAutoKeyRetriever.RETRIEVER ); + dbManager = manager; +// System.out.println( "\nDBManager : " + dbManager ); + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + if( localDBManager != null ) + { + localDBManager.close(); + } + String dbUrl = ( String ) Singleton.getInstance( DBConstants.LOCAL_CONNECTION_URL ); + DBManager manager = new JDBCManager( dbUrl, username, password , 14, 7, 7, new SQLQuery[] { } ); + StatementExecuterFactory.initialize( new DBStatementExecuter( manager.getSharedExecuter( EvoBaseProvider.class ) ) ); + UnicodeChecker.setUseDoubleSlash( true ); +// Insert.setDefaultKeyRetriever( PostgresqlAutoKeyRetriever.RETRIEVER ); + localDBManager = manager; + Singleton.setInstance( Singleton.DEFAULT_DBMANAGER, localDBManager ); +// System.out.println( "\nLocalDBManager : " + localDBManager ); + } + } + + private void initProviderConnection( DBConstants.DB db, String username, String password ) + { + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + String dbUrl = ( String ) Singleton.getInstance( DBConstants.CONNECTION_URL ); + providerInterface = createInstance( db, dbUrl, username, password ); + BackendProvider.getBackend( dbUrl ).setEscapeUnicode( false ); + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + String dbUrl = ( String ) Singleton.getInstance( DBConstants.LOCAL_CONNECTION_URL ); + localProviderInterface = createInstance( db, dbUrl, username, password ); + } + } + + private static ProviderInterface< EvoDataObject< ? >, EvoDataException > createInstance( DBConstants.DB db, String url, String user, String password ) + { + ProviderRegistry.registerDefaultProviderFactory( new EvoDataProviderFactory() ); + ConnectionIdentity conn = new ConnectionIdentity( url, user ); + ProviderRegistry.registerDefaultConnection( conn ); + ProviderInterface< EvoDataObject< ? >, EvoDataException > provider = + ( ProviderInterface< EvoDataObject< ? >, EvoDataException > ) ProviderRegistry.getDefaultProvider( conn ); + ( ( EvoDataProvider ) provider ).setIsUsingCache( Boolean.FALSE ); + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + Singleton.setInstance( DBConstants.DEFAULT_PROVIDER, provider ); + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + Singleton.setInstance( DBConstants.LOCAL_PROVIDER, provider ); + Singleton.setInstance( Singleton.DEFAULT_EVO_DATA_PROVIDER, provider ); + Singleton.setInstance( Singleton.DEFAULT_OBJECT_PROVIDER, provider ); + } + conn.setPassword( password ); + return provider; + } + + public ProviderInterface< EvoDataObject< ? >, EvoDataException > getProvider() + { + return getProvider( DBConstants.DB.SIPRP ); + } + + public ProviderInterface< EvoDataObject< ? >, EvoDataException > getProvider( DBConstants.DB db ) + { + ProviderInterface< EvoDataObject< ? >, EvoDataException > provider = null; + + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + provider = providerInterface; + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + provider = localProviderInterface; + } + + return provider; + } + + public DBManager getDbManager() + { + return getDbManager( DBConstants.DB.SIPRP ); + } + + public DBManager getDbManager( DBConstants.DB db ) + { + DBManager manager = null; + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + manager = dbManager; + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + manager = localDBManager; + } + return manager; + } + + public Executer getExecuter() throws DBException + { + return getExecuter( this ); + } + + private Executer getExecuter( Object clazz ) throws DBException + { + if ( getDbManager() == null ) + { + init(); + } + +// DBManager dbm = ( DBManager ) Singleton.getInstance( DBConstants.DEFAULT_DBMANAGER ); +// return dbm.getSharedExecuter( this ); + + DBManager dbm = getDbManager( DBConstants.DB.SIPRP ); + if ( dbm != null ) + { + return dbm.getSharedExecuter( this ); + } + return null; + } + + public Executer getLocalExecuter() throws DBException + { + return getLocalExecuter( this ); + } + + private Executer getLocalExecuter( Object clazz ) throws DBException + { + if ( getDbManager( DBConstants.DB.SIPRP_LOCAL ) == null ) + { + init(); + } +// DBManager dbm = ( DBManager ) Singleton.getInstance( DBConstants.LOCAL_DBMANAGER ); +// return dbm.getSharedExecuter( this ); + + DBManager dbm = getDbManager( DBConstants.DB.SIPRP_LOCAL ); + if ( dbm != null ) + { + return dbm.getSharedExecuter( this ); + } + return null; + } + + @Deprecated + public Statement createStatement() + { + String connectionURL = ( String ) Singleton.getInstance( DBConstants.CONNECTION_URL ); + String username = DBPropertiesLoader.getInstance().findProperty( DBConstants.USERNAME_SIPRP ); + String password = DBPropertiesLoader.getInstance().findProperty( DBConstants.PASSWORD_SIPRP ); + + return getStatement( DBConstants.DB.SIPRP, connectionURL, username, password ); + } + + @Deprecated + public Statement createLocalStatement() + { + String connectionURL = ( String ) Singleton.getInstance( DBConstants.LOCAL_CONNECTION_URL ); + String username = DBPropertiesLoader.getInstance().findProperty( DBConstants.USERNAME_SIPRP_LOCAL ); + String password = DBPropertiesLoader.getInstance().findProperty( DBConstants.PASSWORD_SIPRP_LOCAL ); + + return getStatement( DBConstants.DB.SIPRP_LOCAL, connectionURL, username, password ); + } + + private Statement getStatement( DBConstants.DB db, String connectionURL, String username, String password ) + { + Statement stm = null; + try + { + Connection connection = getConnection( db, connectionURL, username, password ); + if ( connection != null ) + { + stm = connection.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY ); + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + return stm; + } + + private Connection getConnection( DBConstants.DB db, String connectionURL, String username, String password ) throws Exception + { + Connection connection = null; +// System.out.println( "\nEvoBaseProvider . getConnection( " + connectionURL + ", " + username + " ) : " ); + + FacesContext fc = FacesContext.getCurrentInstance(); +// System.out.println( "\tFacesContext : " + fc ); + if ( fc != null ) + { + + ExternalContext ec = fc.getExternalContext(); + // System.out.println( "\tExternalContext : " + ec ); + if ( ec != null ) + { + HttpSession session = ( HttpSession ) ec.getSession( false ); + // System.out.println( "\tSession : " + session ); + + if ( session != null ) + { + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + connection = ( Connection ) session.getAttribute( DBConstants.SESSION_CONNECTION ); + if ( connection == null ) + { + // System.out.println( "\n-> Creating new SIPRP connection ..." ); + Class.forName( "org.postgresql.Driver" ).newInstance(); + connection = DriverManager.getConnection( connectionURL, username, password ); + session.setAttribute( DBConstants.SESSION_CONNECTION, connection ); + } + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + connection = ( Connection ) session.getAttribute( DBConstants.SESSION_CONNECTION_LOCAL ); + if ( connection == null ) + { + // System.out.println( "\n-> Creating new SIPRP_LOCAL connection ..." ); + Class.forName( "org.postgresql.Driver" ).newInstance(); + connection = DriverManager.getConnection( connectionURL, username, password ); + session.setAttribute( DBConstants.SESSION_CONNECTION_LOCAL, connection ); + } + } + } + } + } + + if ( connection == null ) + { + connection = ( Connection ) Singleton.getInstance( "CONNECTION_OBJECT" ); + if ( connection == null ) + { + // System.out.println( "\nEvoBaseProvider . getConnection() : session is null !" ); + + if ( DBConstants.DB.SIPRP.equals( db ) ) + { + // System.out.println( "\t-> Creating new SIPRP connection ..." ); + Class.forName( "org.postgresql.Driver" ).newInstance(); + connection = DriverManager.getConnection( connectionURL, username, password ); + } + else if ( DBConstants.DB.SIPRP_LOCAL.equals( db ) ) + { + // System.out.println( "\t-> Creating new SIPRP_LOCAL connection ..." ); + Class.forName( "org.postgresql.Driver" ).newInstance(); + connection = DriverManager.getConnection( connectionURL, username, password ); + } + Singleton.setInstance( "CONNECTION_OBJECT", connection ); + } + } + +// System.out.println( "<-- getConnection() : " + connection ); + return connection; + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/GenericDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/GenericDataProvider.java new file mode 100644 index 00000000..fa61ac52 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/GenericDataProvider.java @@ -0,0 +1,133 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package db.providers; + +import com.evolute.entity.ProviderInterface; +import com.evolute.entity.evo.EvoDataException; +import com.evolute.entity.evo.EvoDataObject; +import com.evolute.utils.arrays.Virtual2DArray; +import com.evolute.utils.db.DBException; +import com.evolute.utils.db.Executer; +import com.evolute.utils.error.ErrorLogger; +import db.DBConstants; +import java.sql.ResultSet; +import java.sql.Statement; + + +public abstract class GenericDataProvider +{ + private ProviderInterface< EvoDataObject< ? >, EvoDataException > provider = null; + private Executer executer = null; + + private ProviderInterface< EvoDataObject< ? >, EvoDataException > localProvider = null; + private Executer localExecuter = null; + + protected GenericDataProvider() throws Exception + { + provider = EvoBaseProvider.getInstance().getProvider( DBConstants.DB.SIPRP ); + executer = EvoBaseProvider.getInstance().getExecuter(); + + localProvider = EvoBaseProvider.getInstance().getProvider( DBConstants.DB.SIPRP_LOCAL ); + localExecuter = EvoBaseProvider.getInstance().getLocalExecuter(); + } + + public Executer getExecuter() + { + return executer; + } + + public Executer getLocalExecuter() + { + return localExecuter; + } + + public ProviderInterface< EvoDataObject< ? >, EvoDataException > getProvider() + { + return provider; + } + + public ProviderInterface< EvoDataObject< ? >, EvoDataException > getLocalProvider() + { + return localProvider; + } + + +// public void checkConnection() +// { +// Db db = Db.getInstance(); +// if ( db.getConnection() == null ) +// { +// try +// { +// db.connect(); +// } +// catch ( Exception ex ) +// { +// ErrorLogger.logException( ex ); +// } +// } +// } + + protected Integer getInsertedID( Virtual2DArray array ) + { + Integer id = null; + if ( array != null && array.columnLength() > 0 ) + { + id = array.get( 0, 0 ); + } + return id; + } + protected Integer getMaxTableId(String table) + { + Statement st = createStatement(); + String id = table + ".id"; + String sql = "SELECT max(" + id + ")+1 AS MAXID FROM " + table; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + protected Statement createStatement() + { + try + { +// Db db = Db.getInstance(); +// return db.createStatement(); + return EvoBaseProvider.getInstance().createStatement(); + } + catch ( DBException ex ) + { + ErrorLogger.logException( ex ); + } + return null; + } + + protected Statement createLocalStatement() + { + try + { + return EvoBaseProvider.getInstance().createLocalStatement(); + } + catch ( DBException ex ) + { + ErrorLogger.logException( ex ); + } + return null; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/TrabalhadoresListDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/TrabalhadoresListDataProvider.java new file mode 100644 index 00000000..a77dbac3 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/TrabalhadoresListDataProvider.java @@ -0,0 +1,24 @@ +/* + * TrabalhadoresListDataProvider.java + * + * Created on September 26, 2007, 4:25 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class TrabalhadoresListDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of TrabalhadoresListDataProvider */ + public TrabalhadoresListDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresActivosListDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresActivosListDataProvider.java new file mode 100644 index 00000000..5a810776 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresActivosListDataProvider.java @@ -0,0 +1,24 @@ +/* + * UtilizadoresListDataProvider.java + * + * Created on November 30, 2007, 2:51 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class UtilizadoresActivosListDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of UtilizadoresListDataProvider */ + public UtilizadoresActivosListDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresDataProvider.java new file mode 100644 index 00000000..b01ad691 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresDataProvider.java @@ -0,0 +1,751 @@ +/* + * UtilizadoresDataProvider.java + * + * Created on September 20, 2007, 10:03 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import beans.Medico; +import beans.Permissao; +import beans.TecnicoSaude; +import beans.Utilizador; +import com.evolute.utils.arrays.Virtual2DArray; +import com.evolute.utils.error.ErrorLogger; +import com.evolute.utils.sql.Expression; +import com.evolute.utils.sql.Field; +import com.evolute.utils.sql.Select; +import com.evolute.utils.sql.Select2; +import com.evolute.utils.sql.expression.Par; +import com.evolute.utils.strings.StringPlainer; +import com.sun.rave.web.ui.model.Option; +import db.data.siprp.outer.TiposUtilizadoresData; +import db.data.siprp.outer.UtilizadoresData; +import global.Global; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import utils.Utils; + +/** + * + * @author lluis + */ +public class UtilizadoresDataProvider extends GenericDataProvider +{ + private static UtilizadoresDataProvider INSTANCE = null; + + private UtilizadoresDataProvider() throws Exception + { + super(); + } + + public static synchronized UtilizadoresDataProvider getInstance() throws Exception + { + if ( INSTANCE == null ) + { + INSTANCE = new UtilizadoresDataProvider(); + } + return INSTANCE; + } + + + public Integer getMaxUserId() + { + Integer newId = new Integer( 1 ); + + Statement st = createStatement(); + String sql = "SELECT max( utilizadores.id ) + 1 AS MAXUSERID FROM utilizadores"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + newId = new Integer( rs.getInt( "MAXUSERID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + return newId; + } + + public Integer createNewUtilizador( Utilizador u ) throws Exception + { + Statement st = createStatement(); + Integer newUserId = getMaxUserId(); + + String sql = "INSERT INTO utilizadores (id, login, password, data_password, email, empresa_id, estabelecimento_id, administrador, tipo, numero_cedula, cap, nome, medico_id, funcionario_hst_id, activo, responsavel_loja, gestor_geral, numero_mecanografico) VALUES ("; + sql += newUserId + ", '"; + sql += u.getLogin() + "', '"; + sql += u.getPassword() + "', "; + if(u.getData_password() == null) + { + sql += null + ", '"; + } + else + { + sql += "'" + u.getData_password() + "', '"; + } + sql += u.getEmail() + "', "; + sql += u.getEmpresa_id() + ", "; + sql += u.getEstabelecimento_id() + ", '"; + sql += u.getAdministrador() + "', "; + sql += u.getTipo() + ", '"; + sql += u.getNumero_cedula() + "', '"; + sql += u.getCap() + "', '"; + sql += u.getNome() + "', "; + sql += u.getMedico_id() + ", "; + sql += u.getFuncionario_hst_id() + ", '"; + sql += u.getActivo() + "', '"; + sql += u.getResponsavel_loja() + "', '"; + sql += u.getGestor_geral() + "', '"; + sql += u.getNumero_mecanografico() + "')"; + System.out.println("USER SQL : " + sql); + st.execute(sql); + return newUserId; + } + + public void updateUtilizador(Utilizador u) throws Exception + { + Statement st = createStatement(); + String sql = ""; + if(u.getData_password() == null) + { + sql = "UPDATE utilizadores SET login = '" + u.getLogin() + "', password = '" + u.getPassword() + "', data_password = " + null + ", email = '" + u.getEmail() + "', empresa_id = " + u.getEmpresa_id() + ", estabelecimento_id = " + u.getEstabelecimento_id() + ", administrador = '" + u.getAdministrador() + "', tipo = " + u.getTipo() + ", numero_cedula = '" + u.getNumero_cedula() + "', cap = '" + u.getCap() + "', nome = '" + u.getNome() + "', medico_id = " + u.getMedico_id() + ", funcionario_hst_id = " + u.getFuncionario_hst_id() + ", activo = '" + u.getActivo() + "', responsavel_loja = '" + u.getResponsavel_loja() + "', gestor_geral = '" + u.getGestor_geral() + "', primeiro_login = '" + u.getPrimeiro_login() + "' WHERE id = " + u.getId(); + } + else + { + sql = "UPDATE utilizadores SET login = '" + u.getLogin() + "', password = '" + u.getPassword() + "', data_password = '" + u.getData_password() + "', email = '" + u.getEmail() + "', empresa_id = " + u.getEmpresa_id() + ", estabelecimento_id = " + u.getEstabelecimento_id() + ", administrador = '" + u.getAdministrador() + "', tipo = " + u.getTipo() + ", numero_cedula = '" + u.getNumero_cedula() + "', cap = '" + u.getCap() + "', nome = '" + u.getNome() + "', medico_id = " + u.getMedico_id() + ", funcionario_hst_id = " + u.getFuncionario_hst_id() + ", activo = '" + u.getActivo() + "', responsavel_loja = '" + u.getResponsavel_loja() + "', gestor_geral = '" + u.getGestor_geral() + "', primeiro_login = '" + u.getPrimeiro_login() + "' WHERE id = " + u.getId(); + } + + System.out.println("SQL UPDATE USER : " + sql); + st.execute(sql); + } + + public void deleteUser( Integer userID ) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE utilizadores SET apagado = 'y', activo = 'n' WHERE id = " + userID; + st.execute(sql); + } + + public Utilizador getUtilizador(String login) throws Exception + { + Utilizador u = new Utilizador(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE LOWER(login) = '" + login.toLowerCase() + "' AND apagado = 'n'"; + ResultSet rs = st.executeQuery(sql); + if ( rs.first() ) + { + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + u.setGestor_geral(rs.getString("gestor_geral")); + u.setPrimeiro_login(rs.getString("primeiro_login")); + u.setApagado(rs.getString("apagado")); + } + return u; + } + + public Utilizador getUtilizador(Integer id) throws Exception + { + Utilizador u = new Utilizador(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE id = " + id; + ResultSet rs = st.executeQuery(sql); + + if ( rs.first() ) + { + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + u.setGestor_geral(rs.getString("gestor_geral")); + u.setApagado(rs.getString("apagado")); + } + return u; + } + + public ArrayList getUtilizadoresListByTipo( Integer tipo, String responsavel_loja, Integer estabelecimento_id ) + throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND tipo = " + tipo; + String estabelecimento_constraint = ""; + if( tipo != null && ( tipo.intValue() == Global.TIPO_UTILIZADOR_RH || tipo.intValue() == Global.TIPO_UTILIZADOR_SEGURANCA ) ) + { + estabelecimento_constraint = " AND estabelecimento_id = " + estabelecimento_id; + } + sql += estabelecimento_constraint; + + if ( "y".equals( responsavel_loja ) ) + { + sql += " AND responsavel_loja = 'y'"; +// sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND responsavel_loja = 'y' AND tipo = " + tipo + estabelecimento_constraint; + } +// else +// { +// sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND tipo = " + tipo + estabelecimento_constraint; +// } + + ResultSet rs = st.executeQuery( sql ); +// rs.first(); +// do +// { + while ( rs != null && rs.next() ) + { + Utilizador u = new Utilizador(); + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + list.add( u ); + } +// }while(rs.next()); + return list; + } + + + public List< Utilizador > getUtilizadoresList( String por, String nome, String login, Integer estabelecimentoID, String activo, String dirRH ) + throws Exception + { + List< Utilizador > listUtilizadores = new LinkedList< Utilizador >(); + +// por = por == null ? "" : por; + nome = nome == null ? null : StringPlainer.convertString( nome.replaceAll( " ", "%" ) ); + login = login == null ? null : StringPlainer.convertString( login.replaceAll( " ", "%" ) ); + activo = activo == null ? "y" : activo; + dirRH = dirRH == null ? "n" : dirRH; + boolean isDirRH = "y".equals( dirRH ); + + Expression whereExpression = new Field( UtilizadoresData.APAGADO_FULL ).isEqual( "n" ); + whereExpression = whereExpression.and( new Field( UtilizadoresData.ACTIVO_FULL ).isEqual( activo ) ); + whereExpression = whereExpression.and( new Field( UtilizadoresData.TIPO_FULL ).isDifferent( Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP ) ); + if ( por != null ) + { + whereExpression = whereExpression.and( new Field( "plain( " + UtilizadoresData.NUMERO_MECANOGRAFICO_FULL + " )" ).isILike( "%" + por + "%" ) ); + } + if ( nome != null ) + { + Expression nomeExpression = new Field( "plain( " + UtilizadoresData.NOME_FULL + " )" ).isILike( "%" + nome + "%" ).or( + new Field( "plain_utf8( " + UtilizadoresData.NOME_FULL + " )" ).isILike( "%" + nome + "%" ) ); + whereExpression = whereExpression.and( new Par( nomeExpression ) ); + } + if ( login != null ) + { + Expression loginExpression = new Field( "plain( " + UtilizadoresData.LOGIN_FULL + " )" ).isILike( "%" + login + "%" ).or( + new Field( "plain_utf8( " + UtilizadoresData.LOGIN_FULL + " )" ).isILike( "%" + login + "%" ) ); + whereExpression = whereExpression.and( new Par( loginExpression ) ); + + } + if ( estabelecimentoID != null ) + { + whereExpression = whereExpression.and( new Field( UtilizadoresData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) ); + } + + Select2 query = new Select2( + new String[] { UtilizadoresData.TABLENAME, TiposUtilizadoresData.TABLENAME }, + new Integer[] { Select2.JOIN_INNER }, + new Expression[] { + new Field( UtilizadoresData.TIPO_FULL ).isEqual( new Field( TiposUtilizadoresData.TIPO_FULL ) ) + }, + new String[] { + UtilizadoresData.ID_FULL, UtilizadoresData.LOGIN_FULL, UtilizadoresData.PASSWORD_FULL, UtilizadoresData.EMAIL_FULL, + UtilizadoresData.EMPRESA_ID_FULL, UtilizadoresData.ESTABELECIMENTO_ID_FULL, UtilizadoresData.ADMINISTRADOR_FULL, + UtilizadoresData.MEDICO_ID_FULL, UtilizadoresData.TIPO_FULL, UtilizadoresData.NUMERO_CEDULA_FULL, + UtilizadoresData.CAP_FULL, UtilizadoresData.NOME_FULL, UtilizadoresData.FUNCIONARIO_HST_ID_FULL, + UtilizadoresData.ACTIVO_FULL, UtilizadoresData.RESPONSAVEL_LOJA_FULL, UtilizadoresData.NUMERO_MECANOGRAFICO_FULL, + UtilizadoresData.GESTOR_GERAL_FULL, UtilizadoresData.PRIMEIRO_LOGIN_FULL, UtilizadoresData.APAGADO_FULL, + UtilizadoresData.DATA_PASSWORD_FULL, + TiposUtilizadoresData.DESCRICAO_FULL + }, + whereExpression, + new String[] { UtilizadoresData.NUMERO_MECANOGRAFICO_FULL, UtilizadoresData.TIPO_FULL }, + null, + null, + null + ); + + System.out.println( "\nUtilizadores SQL : " + query.toString() ); + Virtual2DArray array = getExecuter().executeQuery( query ); + if ( array != null ) + { + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer userID = array.get( i, 0 ); + String loginUtilizador = array.get( i, 1 ); + String password = array.get( i, 2 ); + String email = array.get( i, 3 ); + Integer empresaID = array.get( i, 4 ); + Integer estabelecimento_ID = array.get( i, 5 ); + String administrador = array.get( i, 6 ); + Integer medicoID = array.get( i, 7 ); + Integer tipoTIPO = array.get( i, 8 ); + String numeroCedula = array.get( i, 9 ); + String cap = array.get( i, 10 ); + String nomeUtilizador = array.get( i, 11 ); + Integer funcionarioHSTID = array.get( i, 12 ); + String activoUtilizador = array.get( i, 13 ); + String responsavelLoja = array.get( i, 14 ); + String numeroMecanografico = array.get( i, 15 ); + String gestorGeral = array.get( i, 16 ); + String primeiroLogin = array.get( i, 17 ); + String apagado = array.get( i, 18 ); + Date dataPassword = array.get( i, 19 ); + java.sql.Date sqlDataPassword = dataPassword == null ? null : new java.sql.Date( dataPassword.getTime() ); + String categoria = array.get( i, 20 ); + + String nomeEstabelecimento = ""; + try + { + nomeEstabelecimento = AnalisesDataProvider.getInstance().getEstabelecimentoNome( estabelecimento_ID ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + + Utilizador u = new Utilizador(); + u.setId( userID ); + u.setLogin( loginUtilizador ); + u.setPassword( password ); + u.setData_password( sqlDataPassword ); + u.setEmail( email ); + u.setEmpresa_id( empresaID ); + u.setEstabelecimento_id( estabelecimento_ID ); + u.setAdministrador( administrador ); + u.setTipo( tipoTIPO ); + u.setNumero_cedula( numeroCedula ); + u.setCap( cap ); + u.setNome( Utils.htmlToText( Utils.unicodeToHTML( nomeUtilizador ) ) ); + u.setMedico_id( medicoID ); + u.setFuncionario_hst_id( funcionarioHSTID ); + u.setActivo( activoUtilizador ); + u.setResponsavel_loja( responsavelLoja ); + u.setGestor_geral( gestorGeral ); + u.setNumero_mecanografico( numeroMecanografico ); + u.setCategoria( categoria ); + u.setApagado( apagado ); + u.setNome_estabelecimento( Utils.htmlToText( Utils.unicodeToHTML( nomeEstabelecimento ) ) ); + + listUtilizadores.add( u ); + } + } + + return listUtilizadores; + } + +// public List< Utilizador > getUtilizadoresList(String por, String nome, Integer estabelecimento_id, String activo, String booDirRh) throws Exception +// { +// StringTokenizer stk = null; +// AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); +// List< Utilizador > list = new LinkedList< Utilizador >(); +// Statement st = createStatement(); +// +// String sql = ""; +// String sql1 = ""; +// String sql2 = ""; +// String sql3 = ""; +// if(por != null && nome != null && estabelecimento_id != null) +// { +// sql1 = "SELECT * FROM utilizadores, tipos_utilizadores " + +// "WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND ("; +// sql3 = ") AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; +// stk = new StringTokenizer (nome); +// int n = 0; +// while (stk.hasMoreTokens ()) { +// if(n > 0) +// { +// sql2 += "AND "; +// } +// sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; +// n++; +// } +// sql = sql1 + sql2 + sql3; +// } +// else if(por != null && nome != null) +// { +// sql1 = "SELECT * FROM utilizadores, tipos_utilizadores " + +// "WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND ("; +// sql3 = ") AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// stk = new StringTokenizer (nome); +// int n = 0; +// while (stk.hasMoreTokens ()) { +// if(n > 0) +// { +// sql2 += "AND "; +// } +// sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; +// n++; +// } +// sql = sql1 + sql2 + sql3; +// } +// else if(por != null && estabelecimento_id != null) +// { +// sql = "SELECT * FROM utilizadores, tipos_utilizadores " + +// "WHERE utilizadores.tipo = tipos_utilizadores.tipo " + +// "AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND estabelecimento_id = " + estabelecimento_id + +// " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// } +// else if(nome != null && estabelecimento_id != null) +// { +// sql1 = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND ("; +// sql3 = ") AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' " + +// "AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// stk = new StringTokenizer (nome); +// int n = 0; +// while (stk.hasMoreTokens ()) { +// if(n > 0) +// { +// sql2 += "AND "; +// } +// sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; +// n++; +// } +// sql = sql1 + sql2 + sql3; +// } +// else if(por != null) +// { +// sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo " + +// "AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND utilizadores.activo ='" + activo + "' AND apagado = 'n' " + +// "AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// } +// else if(nome != null) +// { +// sql1 = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND ("; +// sql3 = ") AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// stk = new StringTokenizer (nome); +// int n = 0; +// while (stk.hasMoreTokens ()) { +// if(n > 0) +// { +// sql2 += "AND "; +// } +// sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; +// n++; +// } +// sql = sql1 + sql2 + sql3; +// } +// else if(estabelecimento_id != null) +// { +// sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo " + +// "AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' " + +// "AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// } +// else +// { +// sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo " + +// "AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + +// " ORDER BY numero_mecanografico"; +// } +// System.out.println("UTILIZADORES SQL : " + sql); +// ResultSet rs = st.executeQuery(sql); +// rs.first(); +// do +// { +// Utilizador u = new Utilizador(); +// u.setId(new Integer(rs.getInt(1))); +// u.setLogin(rs.getString("login")); +// u.setPassword(rs.getString("password")); +// u.setData_password(rs.getDate("data_password")); +// u.setEmail(rs.getString("email")); +// u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); +// u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); +// u.setAdministrador(rs.getString("administrador")); +// u.setTipo(new Integer(rs.getInt("tipo"))); +// u.setNumero_cedula(rs.getString("numero_cedula")); +// u.setCap(rs.getString("cap")); +// u.setNome(Utils.unicodeToHTML(rs.getString("nome")) ); +// u.setMedico_id(new Integer(rs.getInt("medico_id"))); +// u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); +// u.setActivo(rs.getString(14)); +// u.setResponsavel_loja(rs.getString("responsavel_loja")); +// u.setGestor_geral(rs.getString("gestor_geral")); +// u.setNumero_mecanografico(rs.getString("numero_mecanografico")); +// u.setCategoria(rs.getString("descricao")); +// u.setApagado(rs.getString("apagado")); +// try +// { +// u.setNome_estabelecimento( adp.getEstabelecimentoNome(u.getEstabelecimento_id()) ); +// } +// catch(Exception e) +// { +// ErrorLogger.logException( e ); +// } +// +// if ( booDirRh.matches( "y" ) ) +// { +// int uType = u.getTipo().intValue(); +// if ( uType == Global.TIPO_UTILIZADOR_SEGURANCA || uType == Global.TIPO_UTILIZADOR_RH || +// uType == Global.TIPO_UTILIZADOR_GESTOR || uType == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA) +// { +// list.add( u ); +// } +// } +// else +// { +// list.add( u ); +// } +// +// }while(rs.next()); +// return list; +// } + + public ArrayList getResponsavelRhList(Integer estabelecimento_id) + { + ArrayList list = new ArrayList(); + Utilizador u = null; + Statement st = createStatement(); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = " + Global.TIPO_UTILIZADOR_RH + " AND apagado = 'n' AND responsavel_loja = 'y' AND estabelecimento_id = " + estabelecimento_id; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + u = new Utilizador(); + u.setId(new Integer(rs.getInt("id"))); + u.setNome(rs.getString("nome")); + u.setLogin(rs.getString("login")); + u.setEmail(rs.getString("email")); + list.add(u); + }while(rs.next()); + return list; + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + return null; + } + } + + public Medico getMedico( Integer estabelecimentoID ) + { + Medico result = null; + try + { + Select2 query = new Select2( + new String[] { UtilizadoresData.TABLENAME }, + new Integer[] {}, + new Expression[] {}, + new String[] { UtilizadoresData.ID_FULL, UtilizadoresData.NOME_FULL, UtilizadoresData.NUMERO_CEDULA_FULL }, + new Field( UtilizadoresData.ACTIVO_FULL ).isEqual( "y" ) + .and( new Field( UtilizadoresData.APAGADO_FULL ).isEqual( "n" ) ) + .and( new Field( UtilizadoresData.TIPO_FULL ).isEqual( Global.TIPO_UTILIZADOR_MEDICO ) ) + .and( new Field( UtilizadoresData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimentoID ) ), + null, null, null, null + ); + Virtual2DArray array = getExecuter().executeQuery( query ); + if ( array.columnLength() > 0 ) + { + Integer medicoID = array.get( 0, 0 ); + String nome = array.get( 0, 1 ); + String numeroCedula = array.get( 0, 2 ); + + result = new Medico(); + result.setId( medicoID ); + result.setNome( nome ); + result.setNumero_cedula( numeroCedula ); + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + return result; + } + +// public Medico getMedico(Integer estabelecimento_id) +// { +// Medico m = null; +// Statement st = createStatement(); +// String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = " + Global.TIPO_UTILIZADOR_MEDICO + " AND apagado = 'n' AND estabelecimento_id = " + estabelecimento_id; +// try +// { +// ResultSet rs = st.executeQuery(sql); +// rs.first(); +// m = new Medico(); +// m.setId(new Integer(rs.getInt("id"))); +// m.setNome(rs.getString("nome")); +// m.setNumero_cedula(rs.getString("numero_cedula")); +// return m; +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// return null; +// } +// } + + + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + ArrayList list = new ArrayList(); +// Medico m = new Medico(); +// m.setId(new Integer(0)); +// m.setNome("-Seleccionar-"); +// list.add(m); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = 5 AND apagado = 'n' "; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Medico m = new Medico(); + m.setId(new Integer(rs.getInt("id"))); + m.setNome(Utils.unicodeToHTML(rs.getString("nome"))); + list.add(m); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + Medico m = (Medico) iter.next(); + + listOptions[i] = new Option(m.getId(), Utils.unicodeToHTML(m.getNome())); + i++; + } +// dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId(new Integer(0)); + t.setNome(""); + list.add(t); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = " + Global.TIPO_UTILIZADOR_HS; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + t = new TecnicoSaude(); + t.setId(new Integer(rs.getInt("id"))); + t.setNome(Utils.unicodeToHTML(rs.getString("nome"))); + list.add(t); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TecnicoSaude) iter.next(); + + listOptions[i] = new Option(t.getId(), Utils.unicodeToHTML(t.getNome())); + i++; + } +// dblocal.close(); + return listOptions; + } + + public Integer getMaxPermissaoId() + { + Statement st = createStatement(); + String sql = "SELECT max(permissoes.id)+1 AS MAXPERMISSAOID FROM permissoes"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXPERMISSAOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + return new Integer(1); + } + } + + public Integer createPermissao(Permissao p) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxPermissaoId(); + + String sql = "INSERT INTO permissoes (id, user_id, codigo_permissao) VALUES (" + newId + ", " + p.getUser_id() + ", " + p.getCodigo_permissao() + ")"; + st.execute(sql); + return newId; + } + + public Integer getPermissionCode( Integer userId ) throws Exception + { + Integer permission = null; + Statement st = createStatement(); + String sql = "SELECT * FROM permissoes WHERE user_id = " + userId; + ResultSet rs = st.executeQuery( sql ); + if ( rs.first() ) + { + permission = new Integer( rs.getInt( "codigo_permissao" ) ); + } + return permission; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresInactivosListDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresInactivosListDataProvider.java new file mode 100644 index 00000000..2f73e63b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/db/providers/UtilizadoresInactivosListDataProvider.java @@ -0,0 +1,24 @@ +/* + * UtilizadoresInactivosListDataProvider.java + * + * Created on November 30, 2007, 4:48 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db.providers; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class UtilizadoresInactivosListDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of UtilizadoresInactivosListDataProvider */ + public UtilizadoresInactivosListDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/global/Global.java b/trunk/AnaliseAcidentesTrabalho/src/global/Global.java new file mode 100755 index 00000000..41415718 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/global/Global.java @@ -0,0 +1,186 @@ +/* + * Global.java + * + * Created on November 23, 2007, 10:08 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package global; + +import beans.Utilizador; +//import com.sun.org.apache.bcel.internal.generic.GETFIELD; +import com.evolute.utils.error.ErrorLogger; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import utils.JSFUtils; + +/** + * + * @author lluis2 + */ +public class Global +{ + public final static int ESTADO_SEG = 1; + public final static int ESTADO_RH1 = 2; + public final static int ESTADO_HS = 3; + public final static int ESTADO_RH2 = 4; + //public final static int ESTADO_MEDICINA = 5; + public final static int ESTADO_CONSOLIDACAO = 5; + //public final static int ESTADO_ASSINATURAS = 7; + public final static int ESTADO_ASSINATURA_SEG = 6; + public final static int ESTADO_ASSINATURA_RH = 7; + //public final static int ESTADO_IMPRESSAO = 8; + public final static int ESTADO_FECHAR = 8; + public final static int ESTADO_CONCLUIDO = 9; + + + public final static int ESTADO_ASSINATURA_1 = 1; + public final static int ESTADO_ASSINATURA_2 = 2; + public final static int ESTADO_ASSINATURA_3 = 3; + + public final static int TIPO_UTILIZADOR_SEGURANCA = 1; + public final static int TIPO_UTILIZADOR_RH = 2; + public final static int TIPO_UTILIZADOR_HS = 3; + public final static int TIPO_UTILIZADOR_MEDICO = 5; + public final static int TIPO_UTILIZADOR_GESTOR = 6; + public final static int TIPO_UTILIZADOR_DIRECTOR_GERAL_RH = 7; + public final static int TIPO_UTILIZADOR_DIRECTOR_SIPRP = 8; + public final static int TIPO_UTILIZADOR_DIRECTOR_LOJA = 9; + public final static int TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA = 10; + + public final static int AUCHAN = 32; + + + public final static String SERVIDOR_SMTP = "smtp.netcabo.pt"; + public final static String SERVIDOR_SMTP_PASSWORD = "EVOLUTE"; + public final static String ENDERECO_ENVIO = "acidentes.auchan@siprp.pt"; + //public final static String ENDERECO_ENVIO = "lluis@evolute.pt"; //testes + + public final static String IMAGE_FOLDER = "/home/siprp/imagens_acidentes"; + //public final static String IMAGE_FOLDER = "/home/lluis/imagens_acidentes"; + public final static String RESOURCES_IMAGE_FOLDER = "/resources/images"; + + public static final String PDF_FOLDER_URL = "/resources/pdf"; + + +// public static final String PLANOS_ACTUACAO_URL = "http://localhost:8080/PlanosActuacao/faces/ListaPlanos.jsp"; //testes + //public static final String PLANOS_ACTUACAO_URL = "http://192.168.111.24:8084/PlanosActuacao/faces/ListaPlanos.jsp"; //testes portatil + public static final String PLANOS_ACTUACAO_URL = "https://www.siprp.pt/PlanosActuacao/faces/ListaPlanos.jsp"; //real + + public static final String LOGOS_FOLDER = "/resources/images"; + + /** Creates a new instance of Global */ + public Global() { + } + + public void copyImage(File fSource, File fDest) + { + try + { + InputStream in = new FileInputStream(fSource); + OutputStream out = new FileOutputStream(fDest); + + // Transfer bytes from in to out + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + in.close(); + out.close(); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + } + + public void deleteFolderFiles(File folder) + { + File files[] = folder.listFiles(); + for(int i=0;i 0) + { + //fos.write(buf, 0, buf.length); + } + fis.close(); + FacesContext ctx = FacesContext.getCurrentInstance(); + if (!ctx.getResponseComplete()) + { + HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); + String contentType = "application/pdf"; + response.setContentType(contentType); + response.setHeader("Content-Disposition","attachment;filename=\"" + "Ajuda.pdf" + "\""); + + ServletOutputStream out = response.getOutputStream(); + + //out.write(model.getInfo().getBytes()); + out.write(buf, 0, buf.length); + out.flush(); + out.close(); + ctx.responseComplete(); + ctx.release(); + } + } + + + public static void redirectToPlanos( FacesContext fc, Utilizador currentUser ) + { + if ( fc != null ) + { + String url = Global.PLANOS_ACTUACAO_URL; +// String url = "http://localhost:8084/PlanosActuacao/faces/ListaPlanos.jsp"; + + ExternalContext ec = fc.getExternalContext(); + if ( ec != null ) + { + HttpSession session = ( HttpSession ) ec.getSession( false ); + if ( session != null ) + { + url += "?sessionID=" + session.getId(); + + int userType = currentUser == null ? -1 : currentUser.getTipo() == null ? -1 : currentUser.getTipo().intValue(); + if ( userType == Global.TIPO_UTILIZADOR_GESTOR ) + { + url += "&estab_gestor=" + currentUser.getEstabelecimento_gestor(); + } + + try + { + System.out.println( "\tRedirecting to : " + url ); + JSFUtils.redirect( fc, url ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + } + } + } + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/pagestate/AnaliseAcidenteTrabalhoState.java b/trunk/AnaliseAcidentesTrabalho/src/pagestate/AnaliseAcidenteTrabalhoState.java new file mode 100644 index 00000000..05966ee1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/pagestate/AnaliseAcidenteTrabalhoState.java @@ -0,0 +1,463 @@ +/* + * AnaliseAcidenteTrabalhoState.java + * + * Created on September 27, 2007, 5:18 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package pagestate; + +/** + * + * @author lluis + */ +public class AnaliseAcidenteTrabalhoState +{ + private Object header_nr; + private Object header_date; + private int estado; + private Object empresa; + private Object estabelecimento; + private Object trabalhador; + private Object data_nascimento; + private Object data_admissao; + private Object funcao; + + private Object bi; + private Object morada; + private Object cod_postal1; + private Object cod_postal2; + private Object localidade; + private Object contacto_telefonico; + private Object turno; + + private Object data_acidente; + private Object horas_turno; + private Object seccao; + private Object local_trabalho; + private Integer hours; + private Integer minutes; + private Object tarefa; + private Object substancias; + + private Object superior_hierarquico; + private Object condicoes; + private Object testemunhas; + private Object causas; + private Object descricao; + private Object conclusoes; + private Object accoes; + + + private String formacao_shst; + private Object formacao_shsht_n_why; + private String acidentes_colaborador; + private Object nr_acidentes_colaborador; + private String acidentes_colaboradores; + private Object nr_acidentes_colaboradores; + + private Object nr_relatorio_acidentes_colaborador_1; + private Object nr_relatorio_acidentes_colaborador_2; + private Object nr_relatorio_acidentes_colaborador_3; + private Object nr_relatorio_acidentes_colaborador_4; + + private Object nr_relatorio_acidentes_colaboradores_1; + private Object nr_relatorio_acidentes_colaboradores_2; + private Object nr_relatorio_acidentes_colaboradores_3; + private Object nr_relatorio_acidentes_colaboradores_4; + + private Object averiguador; + private String averiguacao_posterior; + private Object averiguacao_obs; + + /** Creates a new instance of AnaliseAcidenteTrabalhoState */ + public AnaliseAcidenteTrabalhoState() { + } + + public Object getEstabelecimento() { + return estabelecimento; + } + + public void setEstabelecimento(Object estabelecimento) { + this.estabelecimento = estabelecimento; + } + + public Object getTrabalhador() { + return trabalhador; + } + + public void setTrabalhador(Object trabalhador) { + this.trabalhador = trabalhador; + } + + public Object getData_nascimento() { + return data_nascimento; + } + + public void setData_nascimento(Object data_nascimento) { + this.data_nascimento = data_nascimento; + } + + public Object getHoras_turno() { + return horas_turno; + } + + public void setHoras_turno(Object horas_turno) { + this.horas_turno = horas_turno; + } + + public Object getSeccao() { + return seccao; + } + + public void setSeccao(Object seccao) { + this.seccao = seccao; + } + + public Object getLocal_trabalho() { + return local_trabalho; + } + + public void setLocal_trabalho(Object local_trabalho) { + this.local_trabalho = local_trabalho; + } + + public Object getTarefa() { + return tarefa; + } + + public void setTarefa(Object tarefa) { + this.tarefa = tarefa; + } + + public Object getSubstancias() { + return substancias; + } + + public void setSubstancias(Object substancias) { + this.substancias = substancias; + } + + public Object getSuperior_hierarquico() { + return superior_hierarquico; + } + + public void setSuperior_hierarquico(Object superior_hierarquico) { + this.superior_hierarquico = superior_hierarquico; + } + + public Object getCondicoes() { + return condicoes; + } + + public void setCondicoes(Object condicoes) { + this.condicoes = condicoes; + } + + public Object getTestemunhas() { + return testemunhas; + } + + public void setTestemunhas(Object testemunhas) { + this.testemunhas = testemunhas; + } + + public Object getCausas() { + return causas; + } + + public void setCausas(Object causas) { + this.causas = causas; + } + + public Object getDescricao() { + return descricao; + } + + public void setDescricao(Object descricao) { + this.descricao = descricao; + } + + public Object getAccoes() { + return accoes; + } + + public void setAccoes(Object accoes) { + this.accoes = accoes; + } + + public Object getConclusoes() { + return conclusoes; + } + + public void setConclusoes(Object conclusoes) { + this.conclusoes = conclusoes; + } + + public Object getEmpresa() { + return empresa; + } + + public void setEmpresa(Object empresa) { + this.empresa = empresa; + } + + public int getEstado() { + return estado; + } + + public void setEstado(int estado) { + this.estado = estado; + } + + public Object getBi() { + return bi; + } + + public void setBi(Object bi) { + this.bi = bi; + } + + public Object getMorada() { + return morada; + } + + public void setMorada(Object morada) { + this.morada = morada; + } + + public Object getCod_postal1() { + return cod_postal1; + } + + public void setCod_postal1(Object cod_postal1) { + this.cod_postal1 = cod_postal1; + } + + public Object getCod_postal2() { + return cod_postal2; + } + + public void setCod_postal2(Object cod_postal2) { + this.cod_postal2 = cod_postal2; + } + + public Object getLocalidade() { + return localidade; + } + + public void setLocalidade(Object localidade) { + this.localidade = localidade; + } + + public Object getContacto_telefonico() { + return contacto_telefonico; + } + + public void setContacto_telefonico(Object contacto_telefonico) { + this.contacto_telefonico = contacto_telefonico; + } + + public Object getTurno() { + return turno; + } + + public void setTurno(Object turno) { + this.turno = turno; + } + + public Integer getHours() { + return hours; + } + + public void setHours(Integer hours) { + this.hours = hours; + } + + public Integer getMinutes() { + return minutes; + } + + public void setMinutes(Integer minutes) { + this.minutes = minutes; + } + + public String getFormacao_shst() { + return formacao_shst; + } + + public void setFormacao_shst(String formacao_shst) { + this.formacao_shst = formacao_shst; + } + + public Object getFormacao_shsht_n_why() { + return formacao_shsht_n_why; + } + + public void setFormacao_shsht_n_why(Object formacao_shsht_n_why) { + this.formacao_shsht_n_why = formacao_shsht_n_why; + } + + public String getAcidentes_colaborador() { + return acidentes_colaborador; + } + + public void setAcidentes_colaborador(String acidentes_colaborador) { + this.acidentes_colaborador = acidentes_colaborador; + } + + public Object getNr_acidentes_colaborador() { + return nr_acidentes_colaborador; + } + + public void setNr_acidentes_colaborador(Object nr_acidentes_colaborador) { + this.nr_acidentes_colaborador = nr_acidentes_colaborador; + } + + public String getAcidentes_colaboradores() { + return acidentes_colaboradores; + } + + public void setAcidentes_colaboradores(String acidentes_colaboradores) { + this.acidentes_colaboradores = acidentes_colaboradores; + } + + public Object getNr_acidentes_colaboradores() { + return nr_acidentes_colaboradores; + } + + public void setNr_acidentes_colaboradores(Object nr_acidentes_colaboradores) { + this.nr_acidentes_colaboradores = nr_acidentes_colaboradores; + } + + public Object getNr_relatorio_acidentes_colaborador_1() { + return nr_relatorio_acidentes_colaborador_1; + } + + public void setNr_relatorio_acidentes_colaborador_1(Object nr_relatorio_acidentes_colaborador_1) { + this.nr_relatorio_acidentes_colaborador_1 = nr_relatorio_acidentes_colaborador_1; + } + + public Object getNr_relatorio_acidentes_colaborador_2() { + return nr_relatorio_acidentes_colaborador_2; + } + + public void setNr_relatorio_acidentes_colaborador_2(Object nr_relatorio_acidentes_colaborador_2) { + this.nr_relatorio_acidentes_colaborador_2 = nr_relatorio_acidentes_colaborador_2; + } + + public Object getNr_relatorio_acidentes_colaborador_3() { + return nr_relatorio_acidentes_colaborador_3; + } + + public void setNr_relatorio_acidentes_colaborador_3(Object nr_relatorio_acidentes_colaborador_3) { + this.nr_relatorio_acidentes_colaborador_3 = nr_relatorio_acidentes_colaborador_3; + } + + public Object getNr_relatorio_acidentes_colaborador_4() { + return nr_relatorio_acidentes_colaborador_4; + } + + public void setNr_relatorio_acidentes_colaborador_4(Object nr_relatorio_acidentes_colaborador_4) { + this.nr_relatorio_acidentes_colaborador_4 = nr_relatorio_acidentes_colaborador_4; + } + + public Object getNr_relatorio_acidentes_colaboradores_1() { + return nr_relatorio_acidentes_colaboradores_1; + } + + public void setNr_relatorio_acidentes_colaboradores_1(Object nr_relatorio_acidentes_colaboradores_1) { + this.nr_relatorio_acidentes_colaboradores_1 = nr_relatorio_acidentes_colaboradores_1; + } + + public Object getNr_relatorio_acidentes_colaboradores_2() { + return nr_relatorio_acidentes_colaboradores_2; + } + + public void setNr_relatorio_acidentes_colaboradores_2(Object nr_relatorio_acidentes_colaboradores_2) { + this.nr_relatorio_acidentes_colaboradores_2 = nr_relatorio_acidentes_colaboradores_2; + } + + public Object getNr_relatorio_acidentes_colaboradores_3() { + return nr_relatorio_acidentes_colaboradores_3; + } + + public void setNr_relatorio_acidentes_colaboradores_3(Object nr_relatorio_acidentes_colaboradores_3) { + this.nr_relatorio_acidentes_colaboradores_3 = nr_relatorio_acidentes_colaboradores_3; + } + + public Object getNr_relatorio_acidentes_colaboradores_4() { + return nr_relatorio_acidentes_colaboradores_4; + } + + public void setNr_relatorio_acidentes_colaboradores_4(Object nr_relatorio_acidentes_colaboradores_4) { + this.nr_relatorio_acidentes_colaboradores_4 = nr_relatorio_acidentes_colaboradores_4; + } + + public Object getHeader_nr() { + return header_nr; + } + + public void setHeader_nr(Object header_nr) { + this.header_nr = header_nr; + } + + public Object getHeader_date() { + return header_date; + } + + public void setHeader_date(Object header_date) { + this.header_date = header_date; + } + + public Object getFuncao() { + return funcao; + } + + public void setFuncao(Object funcao) { + this.funcao = funcao; + } + + public Object getData_acidente() { + return data_acidente; + } + + public void setData_acidente(Object data_acidente) { + this.data_acidente = data_acidente; + } + + public Object getData_admissao() { + return data_admissao; + } + + public void setData_admissao(Object data_admissao) { + this.data_admissao = data_admissao; + } + + public Object getAveriguador() { + return averiguador; + } + + public void setAveriguador(Object averiguador) { + this.averiguador = averiguador; + } + + public String getAveriguacao_posterior() { + return averiguacao_posterior; + } + + public void setAveriguacao_posterior(String averiguacao_posterior) { + this.averiguacao_posterior = averiguacao_posterior; + } + + public Object getAveriguacao_obs() { + return averiguacao_obs; + } + + public void setAveriguacao_obs(Object averiguacao_obs) { + this.averiguacao_obs = averiguacao_obs; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/Logotipos.eml b/trunk/AnaliseAcidentesTrabalho/src/pdf/Logotipos.eml new file mode 100644 index 00000000..4510d78f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/pdf/Logotipos.eml @@ -0,0 +1,330 @@ +X-Account-Key: account2 +X-Mozilla-Keys: +Return-Path: +Delivered-To: 4-malves@evolute.pt +Received: (qmail 19936 invoked from network); 26 Dec 2007 15:28:46 +0000 +Received: from localhost (127.0.0.1) + by localhost with SMTP; 26 Dec 2007 15:28:46 +0000 +Received: from a213-22-140-174.cpe.netcabo.pt + (a213-22-140-174.cpe.netcabo.pt [213.22.140.174]) by webmail.evolute.pt + (Horde MIME library) with HTTP; Wed, 26 Dec 2007 15:28:45 +0000 +Message-ID: <20071226152845.ecq9t84xcswo4wow@webmail.evolute.pt> +Date: Wed, 26 Dec 2007 15:28:45 +0000 +From: lluis@evolute.pt +To: malves@evolute.pt +Subject: Logotipos +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="=_6xaiexiy7y80" +Content-Transfer-Encoding: 7bit +User-Agent: Internet Messaging Program (IMP) H3 (4.1.1) +X-Spam-Checker-Version: SpamAssassin 3.0.6 (2005-12-07) on plesk.evolute.pt +X-Spam-Level: +X-Spam-Status: No, score=1.0 required=7.0 tests=AWL,HELO_DYNAMIC_HCC, + HELO_DYNAMIC_IPADDR,NO_REAL_NAME,RCVD_IN_SORBS_DUL autolearn=no + version=3.0.6 + +This message is in MIME format. + +--=_6xaiexiy7y80 +Content-Type: text/plain; + charset=ISO-8859-1; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + + + +--=_6xaiexiy7y80 +Content-Type: image/gif; + name="auchan_logo.gif" +Content-Disposition: attachment; + filename="auchan_logo.gif" +Content-Transfer-Encoding: base64 + +R0lGODlhJwHRAPAAAAAA/wD//yH5BAEAAP0ALAAAAAAnAdEAhx2YWxulWRayazaYWSuaZjyIYzmb +aDqcciinXj2iTjimWzeobzjBa0mXWkiOYUebZ0ibc1OMZlOPclWaZlObckWjW1alWkamaUepdUi0 +akeyeFSlaFSpdVeybFW0eGSeXW+Ba2mZZ3eTaWylXmSnaGerdmq1aWi2d3WpaHKpdHmza3a1eDmw +iEerhUmqkEmzhUq4lFWsg1a1hVe3mFi3o2ari2OskmW1hGe1mHW3hnW0lW+8rVDDi1vCq2fDhmnC +m3fEjnvHlXHIsHTSy5R9XJh6Zq16Wa97Y/g1T/lIOs5zVNlmVthwXMJ2Y9xpadd/Zu1HWexWWvtJ +SfpLWfxWS/tYWulVZPtMY/xaZf5bculoXP5kS/xjW/1yXOZqZuhzY/1lZ/5oc/50af51df5pgftu +kP54hv17lpCIWoGLYY+OcoiQa5aGaZmJcIWqZ4qqdoWya4a3d5W7eK2AXrWDaaGneIfCd6PJfcCK +XMSKaN2Ib92FddqQfuWLe+SSfP2Fav6Gd/+Qb/6SfP+jeoa5g5avlZa7iJm8k4+ytZuqpa2ZlKq2 +i4jCh4bHl4PRn5nEiJjImJ3VmYjIqofIt4nTu5nFpJnOtJjXqJXUuqbFi6nImKrZi6rRnLXJlrDR +jrrWmarMpqvPs6vTpKrYuLfMprfPubjUqbfXtbfisZHTyp/jxp/i4qLPyqjVyaXc2LfZxrnd0avc +5Ljl0bLn6teQgNqtp+OUh+yXkv6Hhv6Ilv6Vh/6Xlv6Kpv6Xpv6atf+kjP6ll/+zmv+npv6ouP+3 +p/+3t9euwP+rxP6r1f63xv+508nZs8vjrcXjudLhuOPJt//Dq//Gt//Uvcbcw87f1Nvdws7f4cTk +xcfp2Mfx3NXmxtfo1Nry2sTq6cXr98X06cn0+dPq6dTs9tbz69n3/OjLw+XUx//Gxv/H1//WyP/X +1v7J5f7Y6P/a9Obrxefq1e/4zenz2v/kzP7m2PX02ufs5eLu8ev15uf8/f7n5//o+Pj26f7+/vwD ++wAAAP///wj/APsJHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOq +XMmypcuXMGPKnEmzps2bOHPq3Mmzp8+fQIMKHUq0qNGjSJMqXcq0qdOnUKNKnUq1qtWrWLNq3cq1 +q9evYMOKHUu2rNmzaNOqXcu2rdu3cOPKnUu3rt27ePOWTFasGN9kf88lOycYneDBgAkP1qe38cV0 +VKpInlyFCpcqWKJ0qdIljGQqWKpskXzMsemJwLqAAcOl9Wouq1nHBiNmdRjaXKiMOc37YaAqrT1H +AY5lim0wqrlk2YK8dhUwWBj3no5QnWQsoUNXsYLZOXQsrrFj/4fOZRj18wV/ZVmNGbOVLuuxgGkP +xvP65/Vv774KTdAuYMAIg8suuhAoHXof8SMGbNg9F992YcQnX3tYWFFffZetc5V6l2WhGhjrhXEg +gh1Fs5p88tUXGmtZUJHML6FNEcUVKI6BnxTmWfWLarWFAdt8YLBD4ke6dKFdFWGgKB507cxzHYUn +gtGLOiNOFQyStV0YRmf5DNkRP0aiCAZ32XExBRS4CPRHFuNhZwUWxPDTTzitIJKIIsYkUyVTv6w2 +RooXViGklxup4xl0mH1HI3vKCATNddqBgU4/0+iQRhNLwOYFFmPkoqFTujw33noX7kloRX2e2CBm +8Y0xhnT7eP82oRXt9GPIAEWIQQaQxuVWRS5OARPGFBLKt96gp160z4LQzaedsVVAUQZB6k1oniYU +sHFhlidu+WtTutwWxm3KySdishhF4yODm2qnxWo4EnQOkqvpM00CIWjxnBa3sSbGc89xkeZSunCx +5RjQORcGsuhSpEuzXDw75neCFvQvF6W94QAdFIN4SyH2zEtxaUoBk99qpEJnasMO7WNjF8qZeUUU +IM7HhRkGBSMFFuy4s8EGTLgGxhVjqDCDQIJg1sUUVZgDyyvY4GMUMMaJcUUWZkIhWZcsT5QOkBOW +yRppBs2zCzv8aDJBCV80CN0eJOBgSSV50DgcLjlsYAEFG3D/0Ag5Q8GYhY9hV3HFyl0vBGNsmNEs +6n0ME3RPDhMYIIKz+mLXxgAOOKAEFlfM54UIG1wQxCWQtELUw1yM0W92YCCeOEIuX6b0FRGPJxkZ +CJUyAQUh0KFFdpJNgYUWRhTRBGZtmhEPT/rIqZAgIFaRBcKIZhH57AtFk2iUoA/NGhW+GLSNBwpE +YMS7xV83HxTEQ7cpGAal0xdffqHTV44LoYOOOupgxzn+B8CIqKMXuCCDjTi1i2KYChdhqA3oUGQ8 +2RWFH/pQxzCSwY58WPAnBWNTzWTFqvkwbB+iMMEE2MAEyUSMadyJAnayMBklTWFSBQHEZcyEHM5g +gQrbK0g0/yyzJdmQC4cLUQcwAIGw20hmNmDAhTrSo6oVVSgLXBMIP84hjF3g4ou7EMY5PniQeZyj +GMQQRi+A8R9hCKMYVGrIPtjYCzfqwo1uHNEBs9QFMURQDLvQk1EU9L0kVVEyWSDINnxwgRAwYWzs +iQISmBYhZ4lnV2Agw55w4UfYWO91QSQIMRjEOMlI4VMJSQcEkdMvMWzhQ7Tp1y4OpAu3YYdGz0FW +MLYkBqxFzFsCI2M/iCEGhHGBOWAATRcWFRkxmOEcC5mHwUZDG/xwYVD5AIQP+yWbbiJRKNH4kXiw +V7jy9WMflvBACJpgs+G0pwpMe2JmVsQ4/hHkD8/xjO0EVv8FC6bjObBUzWZQeRBigMc5PvwQbPzY +mX8hK2nGilgNhaQOQBznQxHEGoqSoRB9CINbpEQZcGITsdX0IpT9mEcTxdBJ23RJHf+60IdYyjjW +8EJ6QQkEFZAzBSpAQQoAi4wUzCCnUsTAAWlYgqgkSsMqSIFpFNQa7EJjKkFMyHbYuQUVaqUQaABK +NuL5JkH0EdMVIZIKlRyXGJh2mTHgtJZKihhsRHQOH9FGNbcxkidlQwVeJEQaWGJQbcQwHG4aDFBG +sidB2KEa19GGpVtqRzg746cf0WZXflwN+YaiD314sLOfzUc+2tFZfbzDEB9owPJeUwUyjGs+NMvd +downKhn/VuEMCMGFmOaDnylwNSHRMBd4LgQdgg5EHn/gJsBo6CEajqdZYMDZQARxKPFEqhibAWvA +UoQd1/qRCoo9bmcsGxt6OhZIx+ECR8vWUOi+thi1CZEfk8StbRUTC+u9iShQoQlRvAIVnBjFKQYs +YFSEYsDNaMYrTtGMU2jCAhD4QBPCgygUGY5NxakCEpY0hS14xpwGCUSS2DSZ0PWze7285XxukwXj +9oMeP+oX076TIqwhyVybHUjB2DNcwpUXC4MDsiHBYBzbiMFIppLHE5NUHCxESIROrg0ZuCvBLA5k +HoMLQxNjI65ucvnLrInQH3FKE36o4AIe2EADLkCBDlyA/wMbeIADNoCBCWzAARDQQAcwYIELXAAN +TliSm9pjHMwwaDgUkyF0QlkbmKVIVFNAqaN2StxmTcG4+7Aoa1oDu/JWspc1qwKI+0G9sKXIM0ga +g2yVZK5m9YsLvTiINPLDIOzEE4qsXE9tVA2sgszjQ9hjD6lgeWrbdNnJrxGrTPZhAg184AES8DMF +LjABDgzgARCIwAIgcIEGKGDbDxgAEcaEH+x4gbfgYdrgNGq9y0B1CtI9iCAkWtJPSuG3CPGelpRr +3FChjDXyKSkJKfPo/PYj2K+DbpvABr/YXC+Tod7TrJ2cYTD84ozC0EVMQUS0XferCmLFsqtpU59i +NpHEWP8w0ri6fNcT+fUm7zDBAjhwAQzQ3AMcwIABHoCBBhgAAxtYwMwn0AAjKPoyFDMc7Nhku/Y4 +FzM5PgggiLWuZknGggYlrqjmQ9B0HLm8zoVOysywCwS6jjgM0zR7mjVcUbk9O5F6TWyooOx0+KgK +z7SyvCQYISeL61sEmUdssoTsFWuZ8CCqLhayRKrWkZkm3DABtTFwAZ7H+QERwMACNkCBBdR8AwNo +A/MQRaOIufMK8lSO0hcPHKZBAXELUtJ6Xoj1cm8hNDS6Qtrxg2oKXiEJZFjH4/MhjPXgW4ehY3uK +5IoFKIQhgcPicYOyIMIqhDcdGWqIGKBQ4XxGl8yCf63/+/rlxLN19oAOUtX86lOxmzyDAw/wMwda +cAEDLIAFFziABgSwgAdo4AIVwAaTAQZRkCRcIFXagXoNojtLgiijZhCAcBtugygnphDE4HayMRnI +gn1bNx+kEgVWgAwdJQwjkjTpZ0WbgQVlgA4Hog/psEAgAmScBh27YBDScAbCFFzlRR6wwTCCRy8o +UkwAcwbbkw+48CPf0yaNYhPaYAGlA23U9gBS+AALgAEEwH/ftgEgoGhgUz2hcR/bwSbOdSbz8SaZ +0X4IYVUVdhkpYkGP0jpAxmNVgEq/UG42hjtXMAVLCBGA0Ca4dyJTQAZ6JxDqgB3MwWRmNS0FsQ8Q +wQ+z/2E9F6JegadWEcRymfR4V0YGsKEciYco4QUT+9BnUwgBUkh5VSh0D6AAcmYAIeAFz8EdWWAh +k0Fbo7eJ2vFu0ZIEvNBZCXEx70QxtVczVgRPqKRNYlBjFPSJDIFPKUNcoYFSV4I1ziI+0YURCNN4 +6DZqhoJ4EugZyigQdehe7GF9NkEPGVABPgcAA5AABjAA/bcAGoABCoABpJgAaiBVTMM0V/BTE8Q8 +U4CHinKGeWg4/QAMD0gQ1zhOzlIF+FZQE8I84CEZgzIPErQtvDUFwlQQY+BL1NdDt9FrCOEk9bEe +VmA80BFvEsGImeYhSBJB2MEFuDUQ6kBZSbJ1z6gQwv8wU652jMJwE6pACalACZiACZRgCZIwCZPg +CDFwAS3gAJ73ACFAC7awB3xgC37AB35gC7rAB33QB3uwKYgkUdwlUTc0k2GAiQJhUWHzJ9qBdRaW +Ox44KF7nOs+lHTEpEWrnSeMiGXuIEIMljMSCJLJjRsQwIEykZa7iKv+2dtCxH4RoPX8yHyaJBSh5 +EHYHdxYCBn8SazuRRmn0C0ICBwZwARGAAANgANNWc262ZyXwMxxAAg6ABt+hNe7UHsPBBUgggguC +hhoZgwwyBUtzOAsRDNx1KK0xhwJhIqKygGQzEWtyIrsTlwsBV6txjIlyLgcRDLvZdNXkLCX1XK4D +G5r/dGVVMAZ+JFxeAGvR9HZcBng5oQ4SVYD6sAwRsGZUeAGeJ20PMG1AJ2cP0ABHoDXwNI5TICMC +WgWlESqhoYzOsYDZgZELQQzGYS7MQwXaIxAXSCphsCjzoWwOMQbwIRu0GAaDmB6j0ns01JD9AF8A +N428R1J1KYHSiFPwqWU7SEPfKBCCB0WhkyQDkxPEQAUWQgXKsA8qsAAGoAAZoAB+hgCjKYULUAED +4I46dwB4YDzZRThfOKBCEgih4VNmYCphsAVNBTC2hpYEcSWh8XdA1n67BEUL6GIOMXXlhTDAgZ0J +AQy9ZV3wxDD58CGbUQV/8CcJx4b50ZGPKJwC8U/l/3WeC7oQy3JIqzEFIIkTxjQ06JAPz/AM5lAO +5mAOnCoO9mAP4zCq4XCq01BzBrAGJ2IhlTSOu6gOgjCZkuGhx6h8ZkJVC6Gnn8QFNCIeg/Io+CFS +2OGhDeEqFWmmrzKcNPIghsQzV8ZSMcYq9IJ6FxKHYMVq0SGTuUN+vEUyCRErtgEonlGZNSEPyfGS +AEcckYk4cSCFHNAuxRFPSHBbtQINW6CAFXqQ/TB1xCFoEKoQv2BibHgfWPApXhVwBisFWWBwfPhd +oVMc0HGW00kh4dNkB0JdFOhuD2k48ARPO/NEtoEZG3kgX/Na1CcekqgQyzI4USKB5koTBvUsDQJV +8v9BqQrhDApAARiAB/GjmcPADvtwDrjwHUsDIjtFsRbjY8zDsFMwRdMDJJhhrRKZnOIhjWsqBS8X +EZm2nFnwj6AzngoBDIhXXgy5qNCRgk6GH0+UC8WQDv+TD+pAfKuBSbpzIDAVQRsJJEnisAYRKykY +G1pAQzE7E9qEGUwmmZpVtQlBDyRQc3UQQYBQC7VQBzoADv0QDNEFMGRQoGsrBdsTCEQWITUUGsYq +ELFCBqO3GlcwLHIZMyAiUZJxBWi6EJnVTQGntAmhueRHQpGWlqSynPUxBQuTEOfAKSCCNeOSBTiV +Dn5HQ8ZWBX5bEPlwHDSGNT9qE1/Dp5JhJN+xBYL/uBCQwHMxoAr98A4lgHkOQAn94LziQSFPwpnU +Ah4R87VfKAX8OhDeYz0Y+LGD4jLyRDhQB64QEZlxtSIWBAzPtZDzUSuOuJwUSgXyixDQUGnPcYx4 +KxuZ1XZ9eRB/2pLsEUFgUKk18QtTILswdB9nQgW5ULsCYQo0V3NS4wYN4HM1wA/L8os/JB6BaBB6 +SiPAaVbwphC1wYbEgyK/VTALSEPdmJEDYSS/2FTMuxC74Gk/1iUfPFXs4cL9IAwkdzIgYrISVR+q +gSKnq6OthDIpkr004TJiZ12wUwVRIAUdfBCOewF3Fgv9QAoD0G0QIA79sAvG8auSMccRKVZXkijw +/xSR8NSTBRUZ4UNkuIcZyCINxkN9ZjohuFCii4iQo+dkkZlIu2qHjwYGtbK909ggJCx1KiKB2BEG +jLioq4thNDS9BFG9rWZZ7lkT6ZBd22G0KRIZVkBGcgB/BoAD51Q6GPAAquO84gRPxiMfVKCI+ttU +9rFpTIMEu2Bl8zAIYwMtNnShqBsijAMF0BsaxJAQ3VypztFUUhsGDBEM6+E6zeostUIMqsJbILLK +BSENoEFjJ0IGNLpi0EVkYGDLV7amCLNbd1kTeiomEBkt2CEFDa0Qz7ABLTABf9wPhHAAbTYD/KAg +tgRPKswFI/Jr78SG8TQZggAMvzBvhhbNzRKxjP+bnAWtO+UmBrgQDMQQDdFADMQgCDBDzf1wjIMD +KfKxrGObanT5JKcsgbMRGrzTuNoEZVoiBibrXE40zyC3ELicyuLCzzDBD3/wzSLFHRJ9Sg5hDyVQ +AZUnC/2wDA2AARSgAN4wTFIgVVOLGQIqVlbDJgUKKZzxGVDHv8BhITRiGRXWkP/CxNxFrbwlGUJo +GT2MusEWJdAx1QqxCymCV/cxxfAJGpoIhlPgyAYBDY1daw+ZBWLMiQssBWfcD9U7sUkSbIX7EtJg +OydCMygioFmgognBCDX3ADaAD+/weQ2ACSlVkzJkznBXBRMcyADjPtTKPJRxGQpokt41H7rna57/ +sSujYt2PSHKo5piElCgKK5jDqXDOyDWR+RrMNR+7kA75sA/7oA7QECr4EToiNC6wYbKQCL3Bi9A6 +OrG0QSrywcYyQT3KYSFsWAWuKM01+BCk8KQGIDU5wAEL4AAhYA/9EAgGQx60VWEnLdjQu5zPYTwz +Bh20ZRyHEgagMYjncFjyNCFr96J3p6hFja24Jx+3PRDC8M/DFTZcU0ux+1WR3XTAodoUOpKx3L6Y +MTyj2x6xnQ8LtYOqtrUzESuc+D1i90lTQOAGgb4XwG2s0A86u58U0A0rKt4SEk8drGkSq1asAhpP +FB9XULSf7ERIANxD9LNxiHRAGDasbdkDyl0r/8YQuzCsFHIbXKUOk3rUKyZXJMcFx3h3ARfV9TIQ +54Acg2OSkhnb8+Aj8ZEke6ngMDGTizJDtoZsVxcRcYCfG4AD/HAPJECFEzAJKQV1URDhq9Ja1IuE +bLK3kzF7GAZvhoIogfgdeCpEyuEZnvEnGPYdtvOsSHSr2DEGZhBjFvQLIjxDS4MZB+Kl7VFS6EbO +cmcGRVsf7x0hJuu9CB67VQ5LhhZBuywTffJVFVKXVUDUDuEMBsABOQfIkOAAGOAAR9MP644FUgAG +WiMr2FEl/+Q+iJ5uLVIcuPWn2PrFphyuSYNeP1ZCNOJESKQapGIGrgPtDGHC17pqB7IPuYDuMf+o +oVonIl71Wp0IBs2bSViSVl2tELNt4Ckj1i2xDwt5ta0hoFsABWJ+EPuAAvBoAbo+DRswAZxz19HQ +8AQY2MQjBX7b6UAVGr5qSU80BS8Hnz9kiduqEMOwVuxBBmUVhylTBUsorpP6agbDELpw1CiierFj +MRhyXnW7dgWqIcRANNV5ciZLcaA8HlxQx77WI8fGGkTPEumwC5iP+blAILuQC7qAC7nwRU48EIZQ +AQ9gAC6AD/HwuH6GzC4zBhGo7b2EMAjDz/sgDDYCMB2idLuASvIwjo+IBcBdEPxQDFaVhCNXM7OE +umFCHJ5EvBakoMZhsNihosRg6jFovdBBggL/cSWu5mTK0byFt3joBfm3rBpk0Blddu9UcQ/hEA/b +kA1Scw/YwA3bsA3EjxCyo0RmQHJjcEcAka/fQIL68h3cZ5DdQYINHTbMl05XmC5YuIDBAkaMmGLs +HBI7VyxZsWjJzoU89/DhuV/CiAkLtkvYr13A9KnsF0xMFZ5YrlDBUmWXR4LnxpjZhUsQLkBmAPEj +qK4LoDFUzYipygUdToL0wIA5OubrVy65uJ5Fm1btWrZt3b6FGxdhXLps86k7p06dwLp9/f4FHFjw +YMKFDR9GnFjxYsaNHT+GHFnyZMqVLV/GnFnzZs6HoXYGHVr0aNKlTZ9GnVr1atatXb+GHVv2/2za +tW3fxp1b927evX3/Bh5c+HDixY0fR55c+XLmzZ0/hx5d+nTq1a1fx55d+3bu3b1/Bx9e/Hjy5c2f +R59e/Xr27d2/hx9f/nz69e3fx59f/37+/f3/BzBAAQcksEADD0QwQQUXZLBBBx+EMEIJJ6SwQgsv +xDBDDTfksEMPPwQxRBFHJLFEE09EMUUVV2RRtHgm4CCGbgiyZwUGfACnRd64qWEDDSrAAJ9++Clh +gxc0wGBG/6xpJRYhySMhBh8w8GEBewZaAQMZbujAA2/44wcSEijYoIQvY6vnlVmujIyfFUiAwYMM +NHiAnH72KYGDGD3goIYn8xOlggs24KCBFv/sfO2UBhwI4YIcIWvGAQ40iDGGOodslAMMbrjgglT0 +u+cECDTtgAMHPnXtGkIv4OCCBc50bBkMONgAAx8xEGcgFDTQIIZWJ5hEP3c4WIBYGTxQQIjXDHkA +AgoemOCCHT5rLB4LLvCVh07tvMeEAySglQMFZNGPnlI56MDWDYZ4LcsOWNWgAT8h6+SBDijAgAII +7NznBA08wFZa/t4ggAMDHjCAgFhc2yeOfDHw9QIX/nTskQEMAHIAblMwAIMGLsCBYvzeMWGAGBo4 +gBXYUsAXAw02wFbkxqDCZ5+G9rGHHzb920cTHIJQkuERGlggTxc2mEHmxciRRZZvwvnmyW//sJkl +m1mUJoifc4ABBCxcxhBjF4fyIUYXXHCpSReZaMqLrxD3SeGBGFld4AasEYtnhQ3kzmDffu4ptQIO +LLgB0bGBAYOLKhL/qgpfBtrnnK4VByMMLrjAIoyxxEi8CjOKcbvDfUJ4AAMMOl4g6cfgfhkCDB7Q +wE57TDDd42JFTqciMcjooguNuOhloHkwX7zyxDH/qgvNsVqep+Cj20YUR745S5trXsF6H21GCQct +fri5RpZmXiHflFGw2flvbrSR5ZppZNnmFWru4eoeEkq3dQGI7zZsGVpjwIAHNHABIeEpBum6AAYW +QC6CzMN3YqmIRsIQhpvMI3GaA4PyKDIW/7IsrngYBAMuoLOMBrRKAUNQGiQs8LEYwIog8eDABD4m +BKyB4gQfu0C0GhAtC7iOhvdAQQcc8IAGuKwBCfjYBmSkkn3kQH8xuIACWGCDb5wiCCfwQQm4lANW +3I0f4WuaLLAhC2tg4xtlxIbhGiIKJbrqAh5YwMZcRikMVCBYBOnaV8LgQTBIIRkDAURGFheGoBhP +LBjJCBcqsriNAKIKz2NOPFKQwA1UwAGueIgmMDABKHaABRSDmwUUkMAHYPIhp3jAsyxAJwMYwAIP +gGUlexQDBuhJbr4aYKc2sIBZPKRfL5ABBw5gOg3kwAHYsiWtGhCDXj4kFCegFaEqUAEKsP+KAu8a +1Axy1RBndKxUpnuBkO4RQAC+SwGm7Mc5LqKRsWSEgv2IBgYXd5GMGK+eVcACFrKQkcyFAStgIMpy +MnEBIWqqAjNwyD5M0ClixWthBPlEBw6wgE5VIAbUGgg8RjApmC1glApYAAAGkAADtEoDDBAAAxZg +AAUogE7/ukAGlKjGO/mAkiy4wAAPUIFiYcBVmoKYoxyCCluZrlP6m6aejLoBktLUDhxggQdekEAh +1YMElNLfAl7QkF980HiYM0s/dtGFxQWFn/gMQxbQWoUrVGGdFhlLFYTRHDm4agG8kpgaq5FD0+3S +Uw2JAwUykEDTsYCmzsDWAF/n0Ul84xr/bvTpBSAgAAGwYBbXgATsfMUBCVDUhXciATEXALuVCgEI +ncopujDwLpURZB9cwpYHAggwXnUAZv/yAJmU1RB+ECK1VL3TCTaggACGrCFiqCc/wYBPsfWja/hM +Lj57krnGYdC6WVguGZqzAmKNtmMaeNRAtPG6GGpAhrsdSBzgBQFYGuCzpvDp6xQAgQuorh/LUEDp +Sqc/AZhyHyOYFTFjUAFUEYQbRYLAAjxpAAgoiRnN0tQLXncBGzTEHelqFQemegFX1IwQCHhArSQc +gxiIjB5AIO4DPsmPUM2qAhqgmDrAgF3N6TOfUhjGQDgHhitgpKxqDcpFqjDBr2SBkJMr/+tNlqMC +nj5gtA7wG0G0kdPXmc4AdxwIHCBAJ9TG0SGa6CEGWPCAixU4HhugwDGrLAPDaUJ/e+vVX28WgmEq +sAUNoERDMgHLKrdqYgRpBsxYtVoM7IAg9yAEkviEAQtQgKZDMgUhRoGPe8igZqJgRCgeQozizVhx ++axCjvfRzrcWEtT51ONYNEfkfAY0OSqAgAM69gAHGLYhey1Bp9irgAL3wxAVMAAF9PcAAoR3IJp4 +QJdf18zgaoAFCDCilweC3yFeQAIXMAA6IRcCDWSVWKtoyCkcwKsYIGlShmNGtFxVTQW4MBJ3vcEL +anUA/v2tA/zTBefGoLkxYGEMVZjCMf/uFAYpEHKeUwhKW+u5kyGToXL+RC5YuNAO5qAAlixogJMx +YOxllA5mTr5yQ1ZwAWCz13TG7kcmOrBSKC5gAeCGHAkWUE0kqfhPy2ilAg7gKgO09oVwfMCRPGCA +oPXDFBVowcpnlVeC+I9UD2gBBlxoCgfw4AZ6itGjHRIPD2D0IYCoMVi+EpRQ3wm5Vdhn5dCekX1a +FwtTaJzxwjCGiyhZOSowt0ddbuxqAGmlLg85QbK0cwD41NYN0aSrODXah4JWfyyQLwz+dHTXYXsB +Dej1nT5gAIn961XhppMCHYABBfx5IM0AGLEwIAAOUI8gnFjACZDOp9ihZR8ewPcgKQL/1yxs4XH7 +2GMiB1mRffuOnWPJQsSxKxYs2D05bmAp5AWwgMMPpBpy24AB9JcAdhEEBZxfwDCdTNNFwM50lycA +zO80ApdT9AJQn7xdxayAAWT+HhuAvAJaPvUJQADyLjedm3OVDGiBAXKvNYIYDciADAhA25MBr3OI +X1A7QEAHdUCcPfqjfKA7DtqdVfMxIxMLyxk7jNCjd1KOfTAYwPOYA1CjKWuBBUAAArgAB8CyflgB +ncMAAjCAFjgAlNMkDJioASIAZlMoBcO2BJO8pvuR0SIAn8o8hcI2DGgBbGO2fjiFTtG4jjG9fmAG +nrqrfDlAgiCFcdOAF2ABBay3e+AA/3x7uzBoCEG4iD8CPrIwst/BAjIAiqAgJD06pAmSrjFoDplz +OSRRII67AApggbtyue5Lr6MaLTFDuYFyFRVrhAFQP8BJoPa7gE8iCFPQH847HQN4wiLRn/MrOlTo +AO1TPaabNrvKABbIPheqBJ7iE2zhxLOIB7sRhlzIhT9yCFxYrrAaiGAAuAzsAuxCpJ4YO+kqJOMZ +wXqCpORQKJAqxQt4ATVCrAF4FwVigF4zgbvCNgToGJrKhIOBgAF4gB6ogMaDhxPQHy6jvj+5QsNz +FQTQtjvhGGezMheSFQmoJZzSgCQciFNggKkygI9hwYbghFlhgRZIAQ4QgDQsFT1QnP8nyAAfMBxH +ukO3GYMpCIMcywfk0pwsmAKFaxx8Wi5CyicRRDXF8cXlyBLqY0CtwkbtS7a7CoA8I4gUcJmVUiAX +iEQ3mqi7Qqd9GK7zc7ktNIUOKB1eUQADUL+BuL+OoZskaQhScJkYuKtugzGC6ITzSyCecr2BEAXi +ygAoer966wdssIY/WK5bYMs3BDUzyAtgGDIwAMnliivo2sNCwpyRpCcg45ytGIjQKY4RcJXKMxI1 +ugai2bJaQQCdbEQF6hSXoalIuIAmXIAtw4Ci7AAk2UyPUkpqxKkY4LWtO4GDMSpeaghPbJVBtDmC +YAaAUTEF2riGUKEFQMs0U8uB0IX/xHkch9CFIeOCK/gJxpECgduHCLqCfHJOiiADlAwDMhADLvDI +LEi+GZsxJfuFHEMO2gFAn1oAinGGClCxo3qAXrtBBRoz/aGpQ6imrFop9TNKu3IjFqAWrAQ8/am/ +rUMg0FSAKgSFBALNiymxpmuVZHu/zyMISMipAZI3A9A6lcCFKqAC72wIYNRLLvBALMhL6VKrtIKu +dgoK7Lon5MGC5soHgEKOfVCBnnS/6rsvBFgABoSAA3AA9OqHb4SdBhgA10G5RzAAnNI+D1jHrhCX +0RKAXWKB1qzM8JMsnxuId/AAGUASXhGAoiOFnDpDlxsAF2iIadCw1XqAAuhBhXzH/3zRn97sh43A +gpfEo7TbMb2cguBZUbgLvrKqpyzoN7M6NVWrAsIcAxFCDn6gHQUCv2u8NQIFwgUgAIQaiHgoAT5z +uQs4FIdwUAVyHdJjtngggQRige6yL6MjJpfhgP5siHg4AZc5Eg1QACnVBGfrFMjbxD/xBFPdzER0 +IUMwnQcAIJ9iU1zQHDgdCLpzTujSp7IAJJTkJ1DrU+qqiGYcSSwwg4EghjCAQOIYAUIkgBcAKYrZ +hgEAR62yAAB4KFAYgNOZqMy0NId4BFI6gFgzgMYzyjK0AEW8xX7ohIzDgAxov1FEkhZggZUzrn7A +B4sjLuoboB8ghycxhRg5vwo4p/+GyAELyBcIkAHSY1PEKTuHcCS9rCegqAJcgIpcKKvo5Im/fEaF +o7Ea04p+yIcqSAlpXNV3ZMAWAKV7jToByEGk24EdeL/7JD0dHQhPcLJiITkMUKMV0E0CqDkddYag +04AWoAANMIAqxJL4chnT6YFYcIUbcLJWrccadAagcpXaWQVy8IZGmKMmpBT8XAtglIJieAhdWEkf +c858ugliIB7nBDJUU0ayc8a5GwhhAITl4If7MTwWeEWauoO9OR3qG60NWKVuA8c6eoWHcIdrwQCV +MgAccAhPwDYBYoEE0LZ3IIHXBMKudIhO6JgMeIEMEKCWOsoFqBXqcxVsaAh6gBn/MdvGa0HazlMg +CTCARmALQeAcgXOIMcgCykHGuFqHfkgHjODQKogCtcIn5ClB5uNQ7LKZfggDVzuOfkFLl0KAfCUI +Q/DJBTimSvU/+xwAyXQIT4QdJ+uemxEu0BQCr0MFV6mVC8BayHkEqCs3XgmgTCREl7mA/R0qirpS +Z+OAZOsVl4IjJWLTfgDGN/265NrTGnseQVAunng4PRQDDFrJPWJRftgFLnC+8V0o02mBElgAnFUJ +ZiCBqVIABGAABciABLgAAQApD2AgnOgED2iAF/gsyMmBTiFagtCEKIoBVTgLR+iABhgg4uq2BCAA +AniAhKUhldiEKOI8BECSAOhX/4qSon7dpritgi1Q3oZwpCsw4crppyrwiHkACoyYAp7gHLRbJ2TE +Luuc2V1AOPE1jm2gFUJcgC+9m33Yh3uwmXxw5Elmi+/likc+i3yIh/TBCe25Bve5BmeYhmmgBm04 +hVLm5ITSBmcIhVM4BWcgBVc2BVE4hVLYhrcQhD3CUII4u8xxTh9zK++0yxFFtX6aMYpQKyoYA3UY +iHNQuxbeDUqAARYYgkdzhlopLGwTSPXAhRKORpitiL7cJygQg3Sw5IEQBGX0giHjnJVUnCqQAmIo +CizgnC6gON+ohEGxFRqgKfyCIn6tgC1MDwnsgjNwCGd+xihY5obQB3b4jGgQA/+4ozEfYxxciAa+ +0Idd8LfGuefeUIG9+UwP+GKCOIQAIwAWAKBtTo9gECQ4FQR7AgMqgKR5EIbf5IIxCChi2DcqIMEw +wIVhcL5zQC4OFQPsgubc0LLZyoAGEIKo4QdnYMrucr8eaI95gK4sOAd9UIcVHkEqMIPPEIaxsy5m +Zuh80IdzvpNzgMOHYxws6GjeWAQFeAEBciMO4BMWkFj6+kICyDz04AfjK+GyWq6MiIIrULI9YsYs +IKspMAOgxol8GIZcQOy2SrWgOGrcQCwqi6wBShe/OoBETCCUSw9oMLISvgh/WkaiwAUh6+k55YJq +fQgLWp64u5y0a77f2AcSaAD/CIiBXXKZOWkoCCAAuXa2C/4OfvgDDu0C6qyc6+1YPCZBLCArEQWL +KjDo2B7qEWSrVKuCy8YNd8iAZBuzM+QV+dSfFkAARqzqPKqnsXjjYjg+5wSbPQQD2HaIebAcIiOL +h2M+72YNekALULir/03ALrNclXaPX1CrPZ6CMgidX4ggMHC4ytmnPuYFlVCHOU21Cdo3HsvW3WAG +BPKpSfGpblMgIDDu8tiHeZgHlQAGfVI7zXErRKKCC4/t5Am7Qcogyx4OeJADBfDRBfAACUaAAXCE +ALHLY1S1fcscxbFxh5jeY9Ycj+SCOswI/94N8HmEG/AADwgCR8CEcRAQxFGrgxF0RowQxoZIh/bW +77GjMSzXEcuwy4fDoOTzwG8WHs6Z7a+YcNSG8zinDGhwJw6dOxBaLmItzAkCIeviN/sG9M4YtSqI +zrGDu7MzbJxwJOQ5bRLd5UfnDHXQiY3Yt6oY1KG4ZGE4pM7Ry5/2dOFA61aH9ViX9Vmn9Vq39VvH +9VxnjoAAACH/C1NUQVJESVYgNS4wCQGiDgAAXgoAAAA7 + +--=_6xaiexiy7y80 +Content-Type: image/gif; + name="siprp_logo.gif" +Content-Disposition: attachment; + filename="siprp_logo.gif" +Content-Transfer-Encoding: base64 + +R0lGODlhUgHeAPAAAAAA/wD//yH5BAEAACAALAAAAABSAd4Ah8IxPcVMVMpiZ850eIF/g4yKjZWU +l5+eoKmnqrGwsrm4utODh9eRlNqeod6qreK1t8LBw8nIytHQ0dfX2N/e3+bAwunKy+3U1fHd3ubm +5uzs7PXm5/ju7/Pz8/v3+P39/fwD+wAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE +wDy22L88tqy/PLaAvzy2VL88tii/PLb8vjy20L48tqS+PLZ4vjy2TL48tiC+PLb0vTy2yL08tpy9 +PLZwvTy2RL08thi9PLbsvDy2wLw8tpS8PLZovDy2PLw8thC8PLbkuzy2uLs8toy7PLZguzy2NLs8 +tgi7PLbcujy2sLo8toS6PLZYujy2LLo8tgC6PLbUuTy2qLk8tny5PLZQuTy2JLk8tvi4PLbMuDy2 +oLg8tnS4PLZIuDy2HLg8tvC3PLbEtzy2mLc8tmy3PLZAtzy2FLc8tui2PLa8tjy2kLY8tmS2PLY4 +tjy2DLY8tuC1PLa0tTy2iLU8tly1PLYwtTy2BLU8tti0PLastDy2gLQ8tlS0PLYotDy2/LM8ttCz +PLakszy2eAj/AEEIHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOq +XMmypcuXMGPKnEmzps2bOHPq3Mmzp8+fQIMKHUq0qNGjSJMqXcq0qdOnUKNKnUq1qtWrWLNq3cq1 +q9evYMOKHUu2rNmzaNOqXcu2rdu3cOPKnUu3rt27ePPq3cu3r9+/gAMLHkw4LYYLDx40WMCYsYPE +GDgUnjzTQwUGAgBo3sy5s+YBDSxIpkzapIcLDDyrXs15gIMNpWN35NAgAOvbuAEIqCC7d0ULC3IL +z91gtO/jCi1kHs4cdwPk0AtiCN68+m0BGKJDd2C9O+4F2bXH/8aw3Lv51QzEk+Z+vv3qAOHVCx7g +vv7qB/IBbyhvv//m5/nxtYFt/hW42QAB6jWggQx+luBdCzbYIIIPzhWhhBNWGBcHBGIoIYAatkVf +gQIs0EBiKDJAXYEOhMhWavYx8EB8CXFwWYfuXeBiWhXUF0BxEwHno3E7jsVhewHgdxFt7i1QZFkr +eqfkRg20x9uTYVlw3gCweVQBjtUFQCSWXPFXXYshcTBidyCSuRUG5l05UpXe0egmVms2F0CXJdFp +nZN3ZvVAd3um5Gd1dgYqFQfe6ajSocwBqihVg1onp0p5MjfmpE+ZKVx6LoEpHJqcQnWBdQHAdGp1 +ApQaFYzNOf/6Eqy5MXCpq01ZR+pLjOI2QAWjcSArrkqt2hxNlXomgAPGWZCapMQmBWmtNXX2I58X +1MZZtEt5iluiL9HJgKwbOCAqAOByG1SvzLVak40DcfCAt/+pe5Sxw+1akwWZvmevUckOxydN+Aq3 +6b8+0ZqbuzchivBQ/d4GasPNTfnwT9VZXFPErGl8MU8O4zTtbdB+vNMG1R0sU8C5lWxyTnAem1OP +kb7cU8zM6YSzcC7bbNPOwulcnc87AZ2b0DITjZPRuCE9XM9Ky8T0bTqx/F3UOYV8k9UkY41TdcPW +pDBuE3tN07kd50TvfWbbFGXLWTd3a9swjcwahTYVnFu6dLP/xPVtKoc7dN8zTb0adjehfTjhNAkX +wGs4adlc2YwL/l4DsmKAeU1v5zZ35SwxbWu8DizHcEyGszYw6C61JqeN/Vowk92snc66Swss2+zY +m9ne0pHN6Xs7S8ZlK5zHK3F82+rDs1Su4qoxnxJ7zfnefPLW4b1S6qx9fn1KklfXJkrA6/l9TNCz +Nr5Jyt+2/vkq/Z2b7Ci1z5qY8MOUPmvCh2R/9/mDCc3YRJL9eIdyAWTJ2nLDpZBYYH+qSyBMuIeb +AHjvIryrmQRhQr0DBk4iD4Dgbfi2QZQscDgMIGFDQuie/pVQJSirz24+eBDNidBXL5TJAGXoAAtI +TyAYeIAD//7HHPzlMCa0Q1JjFkDERh1xJk30kHcu+ETsSdFALqxiS6J4ReG8T4sv4WIX1QfGm4hx +jJ1BXhmRiMbuUHGNL5FfGz1TKDjC7IZdRKAdb5LBOVpwjz6Zzhw7wwAaAvJdnbsi4g4plC+NcTeM +BNgJmxS2SBIFNQbSnSWbUgFtmWdZKtwkUjZQAQckUjUlekAlRVkVDLiyAii6gCsNycpa2vKWuMyl +LnfJy1768pfADKYwh0nMYhrzmGTKgAQigAAEGIAA0IwmAQ7QzAhEIAMdQKZPKKCAZ0rzm+D8ZgEQ +EAEKYCSc6AQnQyKQzna6M5zjRAAEJKABjWjgnfjEZzMVcP/Nj+Tzn+lsZgLKmU2eZCABAM0nAuhJ +kYRKc50OjWg4E2BOi2RAohiN5kILmpGMZtQAEKjnTSjgTY+2E6QcdQhGIWrSjCogAxS5aEsxmgCY +nnOmEjVARWVCUpzi8wA7ZchKF8JOn0oUASl1iEyN6lAE2LQiTI1oASYAkw4gIKr5VIBIFTJUhRQV +qwmNQESWCtZ/QsAiZU3oAbaqkgwUIK34lMBCupqQr8L1pxAh613daQC2QmSv+SxAUE8iAcC6U6xc +lShLDevOAvg1IXplLDwHq1LJulMBKVGAZdGJ2ITQFSF23Sw4HduQyIpWmnKNyGnTiVmTUGC13+ws +Qj57kND/whaapF2IaW/71Mre9ptnJcluRRtczyqWqL8F5wEYMtzVFiCpc03uN1MrkrdKV7YHoa1B +bJvc1kJWut9c7kPAK83nigQC5MWuQbRbEO4mt7cGaS5s1Wtc8kITASHpgH2LO9vjetW+0TSAQuTr +XOj2F8AEoOpHNJve6EZ0sQCmbnwRDE3vOhjAAv6IdTFqAAVQwMAZoAAEELBhfNKXIOwliHuTm+GD +EBi2vkWwhDVSWIw6FSIaYCY++Ztd/9Y1oiceSIh1bFL4Cjmi+F1IBzIQgQOYdMYHTuhCNMDkbpo0 +yRxhMJAtIgGEpjPIAknxQFbcTjAbZAIljaiFCfJicGK5/7RXxah4LwxQHHsZowa2SJoBauaHSMDJ +4DSzmAVC5i9LRMsOLQBC2vzNNzsE0Q5tiI8dooESJxTKF8lpRzSQgBLzeL2Tru2WD43Rx4KA0dJ0 +9KMxamRQR1oilZZoAjiCaml+msbeFHSotztqiez5n5iu9X0pYul/9nnXDSl0OlucEWFD89YbOaiu +H4xch/YZITW2touRTBH0qlmo1J5IsfNJa4mueSWDBoGyw3ntg9yT2xNuakyPCu5XTyTODjX1vKUK +k3SvO9BQhXdBnK3q8Qq8vlKmyL/B2ep9HxzdyFZxryVC73gntOAxBijGURxuiSz8mw2fiLOjeW6U ++Hviqv99uEAIHnB50/mfFfm4NEMuEf1mdK0sObm2G6ryU/e8ITZ3eWLt7XGJ0pziJlVAnkWi87BS +5N0OnbXFNU6RCUgU2hwnekTunFB9UwTfHlW6ySM+ZpT7WaL0ZflEuA5QBQ894eIm+0S8PVMEUBYk +TeczRX6dz2D/fMqlrjfcI/LaiDI7I4X3aQG0OpK8G3si2c73toUOEUA79PBRrvNE+I5PqXNk3C01 +gASWnmm5q9vsDEn85Rf9d4R0wPIOxXrWB/8Q2F/aI3THqt094vh8tlsgHYB0Qj0/8NZvF/T59Prs +Nf8QNGeU9BQJelkLAAHo/9X0MofmtTVAAbZHtOHOPkD/BsZP/vKTPwLep/zbma9bCHD+nxu/SO7T +euObdhy0hm+m/vffTOSvnvUUZn1hhmT8V4A+hWka4X9MpVOld3+iRmEI6HMIJnsFQWEEgHkcoXp7 +ZQBHt37sh38IhoFHBmBzJmkQOBLzt1dINRG9J113N4LkJYIIR14lGBLpd1e/NxAt+FvxJ4HglVsG +B2DKl2Wb1YOupnUPSF6Kpls0yIIARoEdIXx7BYSCR3tJKF1UCIDJRXzXR15cWBKRZ1iClXEfeIXJ +FYFsllxjyHPgVYMnoQG2B1gdCAI7KFoFgIZpeFtfmHLSZYQoqIBRlYU95oC8poZDmIendQAC+HKr +VXIr/3GDZSWDOoh9yeWHiHhaUFiFp7WGMhF8jLWHy1eGhbhaDDhWv4VzLbdaoFhVEACIOEVzdbiB +ePhdvyWIQShaCbCILiEBYAdW8ReLkVhTFoWFuliBRTiLNdEB7pdWIQeMPmUA8hQBh1haUlWAvShn +bHhX1TSHOnFQrvh3zshuMaF2BtF9JpWJRyiKW0EB19hSM6iOErdzL0GO7haHCcWNoUhuZBEB7xdR +LxiOAAcT9IgQkIhPkph5MGcWGdCO3zaISDiKeieQxicQBflOOUiHhCgWC3llCJmQ/yWPLjGQCWGP +gcWHVlgWFPCN6LSE6QiPZQeSLSGSCBFr5taFJ1kWcP+YUR2pjx/pdBKpfj0ZUbpoemKhkurkkDcZ +jz45jxNJEAyJT46IlB5ZFMI4EmGojgAZW+PYlDAolGTIk0VxVbk4Ev3YTjuJTxD2eD95cREhhVn1 +lWh5FHF2hyLxlO50lu+Ulr63lUCpZBjFkowYl0YBduIHEnZpllI5lSC4lCHJlQThliZmgg8ZFNco +dh1BknyFl3dZbYwZk445ENKXUID5jmBJFAyJjg4RmvCnmYgZlGrJlH3JEJD5TrNIlDvxlAUQAcWY +EBWZTtCWldJ0kSAhkwwBdf/ngaU5FIdJAIxXERoIUA0HnNEknB9BnAyxnOmEh7apE9h5gaMXER3Q +m+n/NJr5mJwQ+ZqNGZuph43IKZhhmVAdRgFDyE0etYrSqX18yZZ7x2rtmZdy+VH6pwD6Z5TttHT3 +SQDU6RHWyRBWV3GsiU5I0Z2S9YuUCJMssaAMQaDSZKAZCRQSyljKd6AJ2hEYuhAp+E9RuZ058aGA +RYEimp9UVxGqCVB5pqI4waJ35YYtqZhmuJdrGaMVMZuH9aDhFKE/aH0v+qOrOYwSRZ4DOJkeioXT +mKSwqZ8WgZkWmZjuSRTZB1a2qKVb2qORqaQKhRFX+U8YaKM44YmrhYqSCaUv2ZkX+pkJUZbtBGVq +mhNsallRSaRFypkRWaVAymUctqNhehR7uleFaZJJmBmngZqeVnoRGhpNbvekjWoU/AhXopeNl3p6 +FroSJeoQXTps5emfUOGNUbV7qdipXTqi5aaeEjGp0NRbeSoUGTBiJjVOyKiJPHqePiqoS5oRo0oA +b1arRcFkI4alAYYACsBQG5FuS2Z+0jqtuxkS03qt5TeND0EB48etIdat4Pqt4tpb2Fqu+CgV16pN +6rqu7Nqu7vquHxMQACH/C1NUQVJESVYgNS4wCQE+DwAAAwoAAAA7 + +--=_6xaiexiy7y80-- + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/Pdf.java b/trunk/AnaliseAcidentesTrabalho/src/pdf/Pdf.java new file mode 100644 index 00000000..231f8b4e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/pdf/Pdf.java @@ -0,0 +1,171 @@ +/* + * Pdf.java + * + * Created on November 13, 2007, 11:33 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package pdf; + +import beans.Acidentado; +import beans.AnaliseAcidente; +import com.evolute.utils.error.ErrorLogger; +import com.lowagie.text.Document; +import com.lowagie.text.Font; +import com.lowagie.text.FontFactory; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.BaseFont; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; +import db.providers.AnalisesDataProvider; +import java.awt.Color; +import java.io.FileOutputStream; +import javax.faces.context.FacesContext; + +/** + * + * @author lluis + */ +public class Pdf { + + PdfPCell cell = null; + Paragraph p = null; + private final static int FONT_SIZE = 5; + /** Creates a new instance of Pdf */ + public Pdf() { + } + + public void generatePdf(String folder, AnaliseAcidente a) + { + PdfPTable table = null; + FacesContext ctx = FacesContext.getCurrentInstance(); + ////HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); + Document document = new Document(); + ////response.setContentType("application/pdf"); + + try + { + ////PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream()); + PdfWriter.getInstance(document, new FileOutputStream(folder + "/" + a.getId().toString() + ".pdf")); + document.open(); + //document.add(new Paragraph("Hello World")); + //document.add(new Paragraph(new Date().toString())); + + table = createTableEmpresa(a); + document.add(table); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + document.close(); + } + + private PdfPTable createTableHeader(AnaliseAcidente a) + { + PdfPTable table = new PdfPTable(3); + return table; + } + + private PdfPTable createTableEmpresa(AnaliseAcidente a) + { + String empresa_str = ""; + String estabelecimento_str = ""; + String trabalhador_str = ""; +// AnalisesDataProvider adp = new AnalisesDataProvider(); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); + empresa_str = utils.Utils.unicodeToHTML(nome_empresa); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + estabelecimento_str = adp.getEstabelecimentoNome(a.getEstabelecimento_id()); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + Acidentado ac = null; + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + ac = adp.getAcidentado(a.getAcidentado_id()); + trabalhador_str = ac.getNome(); + } + catch(Exception ex) + { + ErrorLogger.logException( ex ); + } + + //TableEvents event = new TableEvents(); + + float[] widths = { 1f, 4f }; + PdfPTable table = new PdfPTable(widths); + table.getDefaultCell().setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP | Rectangle.BOTTOM); + //PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3")); + //cell.setColspan(3); + //table.addCell(cell); + + + + + cell = new PdfPCell(new Paragraph("Empresa:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(empresa_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)) )); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Estabelecimento:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(estabelecimento_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Trabalhador:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(trabalhador_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + table.getDefaultCell().setBackgroundColor(new Color(102, 133, 151)); + table.getDefaultCell().setPadding(0f); + table.setSpacingAfter(0f); + table.setSpacingBefore(0f); + return table; + } + + private PdfPTable createTableEmpresaHs(AnaliseAcidente a) + { + PdfPTable table = new PdfPTable(3); + return table; + } + + + + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/PdfGenerator.java b/trunk/AnaliseAcidentesTrabalho/src/pdf/PdfGenerator.java new file mode 100644 index 00000000..f970d1e1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/pdf/PdfGenerator.java @@ -0,0 +1,592 @@ +package pdf; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.URL; +import java.sql.Time; +import java.util.Calendar; +import java.util.Date; +import java.util.Vector; + +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.XMLOutputter; + +import beans.Acidentado; +import beans.AnaliseAcidente; +import beans.Causa; +import beans.Estabelecimento; +import beans.Medida; +import beans.Recomendacao; +import beans.Seccao; +import beans.Utilizador; + +import com.evolute.utils.fop.FOPCreator; +import com.evolute.utils.fop.PDFCreator; + +public class PdfGenerator +{ + protected final String imagePath; + protected final Estabelecimento estabelecimento; + protected final Utilizador tecnicoSuperior; + protected final Utilizador medico; + protected final AnaliseAcidente analiseAcidente; + protected final Acidentado acidentado; + protected final Seccao seccao; + protected final Recomendacao recomendacoes[]; + protected final Medida medidas[]; + protected final Causa causa; + protected final URL urlSiprp; + protected final URL urlAuchan; + //protected Vector imagens = new Vector(); + protected Vector imagens = new Vector(); + + public static void main( String args[] ) + throws Exception + { + AnaliseAcidente analise = new AnaliseAcidente(); + analise.setAnalise_nr( "12/3" ); + byte[] pdf = + new PdfGenerator( "/home/fpalma/Desktop", + new Estabelecimento(), + new Utilizador(), + new Utilizador(), + analise, + new Acidentado(), + new Seccao(), + new Recomendacao[ 0 ], + new Medida[ 0 ], + new Causa() ).generatePdf(); + File pdfFile = new File( "/home/fpalma/Desktop/siprp.pdf" ); + pdfFile.createNewFile(); + FileOutputStream fos = new FileOutputStream( pdfFile ); + fos.write( pdf ); + fos.close(); + System.out.println( "DONE" ); + } + + public PdfGenerator( + String imagePath, + Estabelecimento estabelecimento, + Utilizador tecnicoSuperior, + Utilizador medico, + AnaliseAcidente analiseAcidente, + Acidentado acidentado, + Seccao seccao, + Recomendacao recomendacoes[], + Medida medidas[], + Causa causa ) + { + this.imagePath = imagePath; + this.estabelecimento = estabelecimento; + this.tecnicoSuperior = tecnicoSuperior; + this.medico = medico; + this.analiseAcidente = analiseAcidente; + this.acidentado = acidentado; + this.seccao = seccao; + this.recomendacoes = recomendacoes; + this.medidas = medidas; + this.causa = causa; + this.urlSiprp = getClass().getResource( "siprp_logo.gif" ); + this.urlAuchan = getClass().getResource( "auchan_logo.gif" ); + carregarURLs(); + } + + protected void carregarURLs() + { + String fullPath = + imagePath + "/" + + analiseAcidente.getAnalise_nr().substring(0,2) + + analiseAcidente.getAnalise_nr().substring(3); + File dir = null; + try + { + dir = new File( fullPath ); + + if( dir == null || !dir.exists() || !dir.isDirectory() ) + { + + return; + } + File files[] = dir.listFiles(); + for( int f = 0; f < files.length; f++ ) + { + imagens.add( files[ f ].toURI().toURL() ); + } + } + catch( Exception ex ) + { + return; + } + } + + public byte[] generatePdf() + throws Exception + { + Document doc = new Document( createXml() ); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + new XMLOutputter().output( doc, baos ); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + InputStream xmlIn = new ByteArrayInputStream( baos.toByteArray() ); + InputStream xslStream = getClass().getClassLoader().getResourceAsStream( "pdf/analise_acidentes_trabalho.xsl" ); + FOPCreator.getFOPCreator().createFOfromXML( xmlIn, xslStream, out ); + return PDFCreator.getPDFCreator().createPdfFromFo( out.toByteArray() ); + } + + protected Element createXml() + { + Element rootElement = new Element( "AnaliseAcidente" ); + Element logoTipoSIPRPElement = new Element( "LogotipoSIPRP" ); + logoTipoSIPRPElement.setText( urlSiprp.toString() ); + rootElement.addContent( logoTipoSIPRPElement ); + Element logoTipoAuchanElement = new Element( "LogotipoAuchan" ); + logoTipoAuchanElement.setText( urlAuchan.toString() ); + rootElement.addContent( logoTipoAuchanElement ); + Element numeroElement = new Element( "Numero" ); + numeroElement.setText( analiseAcidente.getAnalise_nr() ); + rootElement.addContent( numeroElement ); + Date data = analiseAcidente.getData_acidente(); + rootElement.addContent( createDataElement( "Data", data ) ); + rootElement.addContent( createEntidadeEmpregadoraElement() ); + rootElement.addContent( createSeguroElement() ); + rootElement.addContent( createEmpresaSHSTElement() ); + rootElement.addContent( createAcidentadoElement() ); + rootElement.addContent( createAcidenteElement() ); + rootElement.addContent( createRecomendacoesSIPRPElement() ); + rootElement.addContent( createMedidasElement() ); + rootElement.addContent( createTomadaConhecimentoElement() ); + return rootElement; + } + + protected Element createEntidadeEmpregadoraElement() + { + Element entidadeEmpregadoraElement = new Element( "EntidadeEmpregadora" ); + Element identificacaoElement = new Element( "IdentificacaoCompleta" ); + identificacaoElement.setText( "Companhia Portuguesa de Hipermercados, S.A., com sede na Travessa Teixeira J\u00fanior, 1 - 1300-553 Lisboa" ); + entidadeEmpregadoraElement.addContent( identificacaoElement ); + Element actividadeElement = new Element( "Actividade" ); + actividadeElement.setText( "Com\u00e9rcio a Retalho em Supermercados e Hipermercados" ); + entidadeEmpregadoraElement.addContent( actividadeElement ); + Element lojaElement = new Element( "Loja" ); + lojaElement.setText( estabelecimento.getNome() ); + entidadeEmpregadoraElement.addContent( lojaElement ); + return entidadeEmpregadoraElement; + } + + protected Element createSeguroElement() + { + Element seguroElement = new Element( "Seguro" ); + Element empresaElement = new Element( "Empresa" ); + empresaElement.setText( "Mapfre Seguros Gerais, S.A." ); + seguroElement.addContent( empresaElement ); + Element apoliceElement = new Element( "Apolice" ); + apoliceElement.setText( "1500591100500" ); + seguroElement.addContent( apoliceElement ); + return seguroElement; + } + + protected Element createEmpresaSHSTElement() + { + Element empresaSHSTElement = new Element( "EmpresaSHST" ); + Element identificacaoElement = new Element( "IdentificacaoCompleta" ); + identificacaoElement.setText( + "SIPRP - Sociedade Ib\u00e9rica de Preven\u00e7\u00e3o de Riscos Profissionais Lda., " + + "com sede no Edif\u00edcio Atrium Saldanha, Pra\u00e7a Duque de Saldanha, 1 - 9\u00ba G" + + " - 1050-094 Lisboa " ); + empresaSHSTElement.addContent( identificacaoElement ); + Element tecnicoSuperiorHSTElement = new Element( "TecnicoSuperiorHST" ); + + Element nomeTecnicoSuperiorHSTElement = new Element( "Nome" ); + nomeTecnicoSuperiorHSTElement.setText( tecnicoSuperior.getNome() ); + tecnicoSuperiorHSTElement.addContent( nomeTecnicoSuperiorHSTElement ); + Element capElement = new Element( "CAP" ); + capElement.setText( tecnicoSuperior.getCap() ); + tecnicoSuperiorHSTElement.addContent( capElement ); + empresaSHSTElement.addContent( tecnicoSuperiorHSTElement ); + Element medicoTrabalhoElement = new Element( "MedicoTrabalho" ); + Element nomeMedicoTrabalhoElement = new Element( "Nome" ); + nomeMedicoTrabalhoElement.setText( medico.getNome() ); + medicoTrabalhoElement.addContent( nomeMedicoTrabalhoElement ); + Element cedulaElement = new Element( "Cedula" ); + cedulaElement.setText( medico.getNumero_cedula() ); + medicoTrabalhoElement.addContent( cedulaElement ); + empresaSHSTElement.addContent( medicoTrabalhoElement ); + return empresaSHSTElement; + } + + protected Element createAcidentadoElement() + { + Element acidentadoElement = new Element( "Acidentado" ); + Element nomeElement = new Element( "Nome" ); + nomeElement.setText( acidentado.getNome() ); + acidentadoElement.addContent( nomeElement ); + Element estabelecimentoOrigemElement = new Element( "EstabelecimentoOrigem" ); + Element nomeEstabelecimentoOrigemElement = new Element( "Nome" ); + nomeEstabelecimentoOrigemElement.setText( acidentado.getEstabelecimento_origem() ); + estabelecimentoOrigemElement.addContent( nomeEstabelecimentoOrigemElement ); + acidentadoElement.addContent( estabelecimentoOrigemElement ); + Date dataNascimento = acidentado.getData_nascimento(); + acidentadoElement.addContent( createDataElement( "DataNascimento", dataNascimento ) ); + Element biElement = new Element( "BilheteIdentidade" ); + Element numeroBiElement = new Element( "Numero" ); + numeroBiElement.setText( acidentado.getBilhete_identidade() ); + biElement.addContent( numeroBiElement ); + acidentadoElement.addContent( biElement ); + Element moradaElement = new Element( "Morada" ); + moradaElement.setText( acidentado.getMorada() + ", " + acidentado.getCod_postal() + " " + acidentado.getLocalidade() ); + acidentadoElement.addContent( moradaElement ); + Element telefoneElement = new Element( "Telefone" ); + telefoneElement.setText( acidentado.getContacto_telefonico() ); + acidentadoElement.addContent( telefoneElement ); + Date dataAdmissao = acidentado.getData_admissao(); + acidentadoElement.addContent( createDataElement( "DataAdmissao", dataAdmissao ) ); + Element funcaoElement = new Element( "Funcao" ); + funcaoElement.setText( acidentado.getFuncao() ); + acidentadoElement.addContent( funcaoElement ); + Element turnoElement = new Element( "Turno" ); + String turno = acidentado.getTurno(); + if( "m".equals( turno ) ) + { + turno = "Manh\u00e3"; + } + else if( "t".equals( turno ) ) + { + turno = "Tarde"; + } + else if( "n".equals( turno ) ) + { + turno = "Noite"; + } + turnoElement.setText( turno ); + acidentadoElement.addContent( turnoElement ); + Element superiorElement = new Element( "Superior" ); + Element nomeSuperiorElement = new Element( "Nome" ); + nomeSuperiorElement.setText( acidentado.getNome_superior_hierarquico() ); + superiorElement.addContent( nomeSuperiorElement ); + Element emailSuperiorElement = new Element( "Email" ); + emailSuperiorElement.setText( acidentado.getEmail_superior_hierarquico() ); + superiorElement.addContent( emailSuperiorElement ); + acidentadoElement.addContent( superiorElement ); + return acidentadoElement; + } + + protected Element createAcidenteElement() + { + Element acidenteElement = new Element( "Acidente" ); + Element averiguadorElement = new Element( "Averiguador" ); + Element nomeAveriguadorElement = new Element( "Nome" ); + nomeAveriguadorElement.setText( analiseAcidente.getAveriguador() ); + averiguadorElement.addContent( nomeAveriguadorElement ); + acidenteElement.addContent( averiguadorElement ); + Date dataOcorrencia = analiseAcidente.getData_acidente(); + acidenteElement.addContent( createDataElement( "DataOcorrencia", dataOcorrencia ) ); + Time horaOcorrencia = analiseAcidente.getHora_acidente(); + acidenteElement.addContent( createHoraElement( "HoraOcorrencia", horaOcorrencia ) ); + Element horasTrabalhadasElement = new Element( "HorasTrabalhadas" ); + horasTrabalhadasElement.setText( "" + analiseAcidente.getHoras_turno() ); + acidenteElement.addContent( horasTrabalhadasElement ); + Element localElement = new Element( "Local" ); + Element seccaoElement = new Element( "Seccao" ); + seccaoElement.setText( seccao.getDescricao() ); + localElement.addContent( seccaoElement ); + Element localEspecificoElement = new Element( "LocalEspecifico" ); + localEspecificoElement.setText( analiseAcidente.getLocal_trabalho() ); + localElement.addContent( localEspecificoElement ); + acidenteElement.addContent( localElement ); + Element actividadeElement = new Element( "Actividade" ); + Element descricaoActividadeElement = new Element( "Descricao" ); + descricaoActividadeElement.setText( analiseAcidente.getTarefa() ); + actividadeElement.addContent( descricaoActividadeElement ); + Element objectosActividadeElement = new Element( "Objectos" ); + objectosActividadeElement.setText( analiseAcidente.getSubstancias() ); + actividadeElement.addContent( objectosActividadeElement ); + Element condicoesActividadeElement = new Element( "Condicoes" ); + condicoesActividadeElement.setText( analiseAcidente.getCondicoes() ); + actividadeElement.addContent( condicoesActividadeElement ); + acidenteElement.addContent( actividadeElement ); + Element testemunhasElement = new Element( "Testemunhas" ); + testemunhasElement.setText( analiseAcidente.getTestemunhas() ); + acidenteElement.addContent( testemunhasElement ); + Element causasElement = new Element( "Causas" ); + causasElement.setText( causa.getCausa() ); + acidenteElement.addContent( causasElement ); + Element descricaoElement = new Element( "Descricao" ); + descricaoElement.setText( analiseAcidente.getDescricao() ); + acidenteElement.addContent( descricaoElement ); + Element imagensElement = new Element( "Imagens" ); + if( imagens.size() > 0 ) + { + Element temImagensElement = new Element( "TemImagens" ); + temImagensElement.setText( "y" ); + imagensElement.addContent( temImagensElement ); + for( int i = 0; i < imagens.size(); i++ ) + { + String imagem = imagens.get( i ).toString(); + Element imagemElement = new Element( "Imagem" ); + imagemElement.setText( imagem ); + imagensElement.addContent( imagemElement ); + } + } + acidenteElement.addContent( imagensElement ); + Element conclusoesElement = new Element( "Conclusoes" ); + conclusoesElement.setText( analiseAcidente.getConclusoes() ); + acidenteElement.addContent( conclusoesElement ); + Element accoesTomadasElement = new Element( "AccoesTomadas" ); + accoesTomadasElement.setText( analiseAcidente.getAccoes() ); + acidenteElement.addContent( accoesTomadasElement ); + Element formacaoSHSTElement = new Element( "FormacaoSHST" ); + Element teveFormacaoSHSTElement = new Element( "TeveFormacao" ); + teveFormacaoSHSTElement.setText( analiseAcidente.getFormacao_shst() ); + formacaoSHSTElement.addContent( teveFormacaoSHSTElement ); + Element motivoFormacaoSHSTElement = new Element( "Motivo" ); + motivoFormacaoSHSTElement.setText( analiseAcidente.getFormacao_shst_nao_porque() ); + formacaoSHSTElement.addContent( motivoFormacaoSHSTElement ); + acidenteElement.addContent( formacaoSHSTElement ); + Element outrasOcorrenciasMesmoPostoElement = new Element( "OutrasOcorrenciasMesmoPosto" ); + Element quantidadeOutrasOcorrenciasMesmoPostoElement = new Element( "Quantidade" ); + boolean outrasOcorrenciasMesmoPosto = "y".equals( analiseAcidente.getOutros_acidentes_com_colaborador() ); + quantidadeOutrasOcorrenciasMesmoPostoElement.setText( + outrasOcorrenciasMesmoPosto ? "" + analiseAcidente.getNr_acidentes_com_colaborador() : "0" ); + outrasOcorrenciasMesmoPostoElement.addContent( quantidadeOutrasOcorrenciasMesmoPostoElement ); + Element relatoriosOutrasOcorrenciasMesmoPostoElement = new Element( "Relatorios" ); + Integer relatorioMesmoPosto1 = analiseAcidente.getNr_relatorio_acidente_colaborador1(); + Integer relatorioMesmoPosto2 = analiseAcidente.getNr_relatorio_acidente_colaborador2(); + Integer relatorioMesmoPosto3 = analiseAcidente.getNr_relatorio_acidente_colaborador3(); + Integer relatorioMesmoPosto4 = analiseAcidente.getNr_relatorio_acidente_colaborador4(); + String numerosRelatoriosOutrasOcorrenciasMesmoPosto[] = + new String[]{ + relatorioMesmoPosto1 != null ? "" + relatorioMesmoPosto1 : null, + relatorioMesmoPosto2 != null ? "" + relatorioMesmoPosto2 : null, + relatorioMesmoPosto3 != null ? "" + relatorioMesmoPosto3 : null, + relatorioMesmoPosto4 != null ? "" + relatorioMesmoPosto4 : null + }; + for( int r = 0; r < numerosRelatoriosOutrasOcorrenciasMesmoPosto.length; r++ ) + { + if( numerosRelatoriosOutrasOcorrenciasMesmoPosto[ r ] == null ) + { + continue; + } + String numeroRelatorio = numerosRelatoriosOutrasOcorrenciasMesmoPosto[ r ]; + Element relatorioElement = new Element( "Relatorio" ); + relatorioElement.setText( numeroRelatorio ); + relatoriosOutrasOcorrenciasMesmoPostoElement.addContent( relatorioElement ); + } + outrasOcorrenciasMesmoPostoElement.addContent( relatoriosOutrasOcorrenciasMesmoPostoElement ); + acidenteElement.addContent( outrasOcorrenciasMesmoPostoElement ); + Element outrasOcorrenciasOutrosTrabalhadoresElement = new Element( "OutrasOcorrenciasOutrosTrabalhadores" ); + Element quantidadeOutrasOcorrenciasOutrosTrabalhadoresElement = new Element( "Quantidade" ); + boolean outrasOcorrenciasOutrosTrabalhadores = "y".equals( analiseAcidente.getAcidentes_outros_colaboradores() ); + quantidadeOutrasOcorrenciasOutrosTrabalhadoresElement.setText( + outrasOcorrenciasOutrosTrabalhadores ? "" + analiseAcidente.getNr_acidentes_outros_colaboradores() : "0" ); + outrasOcorrenciasOutrosTrabalhadoresElement.addContent( quantidadeOutrasOcorrenciasOutrosTrabalhadoresElement ); + Element relatoriosOutrasOcorrenciasOutrosTrabalhadoresElement = new Element( "Relatorios" ); + Integer relatorioOtrosTrabalhadores1 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores1(); + Integer relatorioOtrosTrabalhadores2 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores2(); + Integer relatorioOtrosTrabalhadores3 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores3(); + Integer relatorioOtrosTrabalhadores4 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores4(); + String numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores[] = + new String[]{ + relatorioOtrosTrabalhadores1 != null ? "" + relatorioOtrosTrabalhadores1 : null, + relatorioOtrosTrabalhadores2 != null ? "" + relatorioOtrosTrabalhadores2 : null, + relatorioOtrosTrabalhadores3 != null ? "" + relatorioOtrosTrabalhadores3 : null, + relatorioOtrosTrabalhadores4 != null ? "" + relatorioOtrosTrabalhadores4 : null + }; + for( int r = 0; r < numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores.length; r++ ) + { + if( numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores[ r ] == null ) + { + continue; + } + String numeroRelatorio = numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores[ r ]; + Element relatorioElement = new Element( "Relatorio" ); + relatorioElement.setText( numeroRelatorio ); + relatoriosOutrasOcorrenciasOutrosTrabalhadoresElement.addContent( relatorioElement ); + } + outrasOcorrenciasOutrosTrabalhadoresElement.addContent( relatoriosOutrasOcorrenciasOutrosTrabalhadoresElement ); + acidenteElement.addContent( outrasOcorrenciasOutrosTrabalhadoresElement ); + Element lesaoElement = new Element( "Lesao" ); + Element areasLesaoElement = new Element( "Areas" ); + boolean cabeca = "y".equals( analiseAcidente.getLesao_cabeca() ); + boolean pescoco = "y".equals( analiseAcidente.getLesao_pescoco() ); + boolean tronco = "y".equals( analiseAcidente.getLesao_tronco() ); + boolean superiorDireito = "y".equals( analiseAcidente.getLesao_membro_sup_dir() ); + String detalheSuperiorDireito = analiseAcidente.getEspecif1(); + boolean superiorEsquerdo = "y".equals( analiseAcidente.getLesao_membro_sup_esq() ); + String detalheSuperiorEsquerdo = analiseAcidente.getEspecif2(); + boolean inferiorDireito = "y".equals( analiseAcidente.getLesao_membro_inf_dir() ); + String detalheInferiorDireito = analiseAcidente.getEspecif3(); + boolean inferiorEsquerdo = "y".equals( analiseAcidente.getLesao_membro_inf_esq() ); + String detalheInferiorEsquerdo = analiseAcidente.getEspecif4(); + String areasLesao[][] = + new String[][]{ + cabeca ? new String[] { "Cabe\u00e7a", "" } : null, + pescoco ? new String[] { "Pesco\u00e7o", "" } : null, + tronco ? new String[] { "Tronco", "" } : null, + superiorDireito ? new String[] { "Membro Superior Direito", detalheSuperiorDireito } : null, + superiorEsquerdo ? new String[] { "Membro Superior Esquerdo", detalheSuperiorEsquerdo } : null, + inferiorDireito ? new String[] { "Membro Inferior Direito", detalheInferiorDireito } : null, + inferiorEsquerdo ? new String[] { "Membro Inferior Esquerdo", detalheInferiorEsquerdo } : null, + }; + for( int a = 0; a < areasLesao.length; a++ ) + { + if( areasLesao[ a ] == null ) + { + continue; + } + String area[] = areasLesao[ a ]; + Element areaLesaoElement = new Element( "Area" ); + Element nomeAreaLesaoElement = new Element( "Nome" ); + nomeAreaLesaoElement.setText( area[ 0 ] ); + areaLesaoElement.addContent( nomeAreaLesaoElement ); + Element detalheAreaLesaoElement = new Element( "Detalhe" ); + detalheAreaLesaoElement.setText( area[ 1 ] ); + areaLesaoElement.addContent( detalheAreaLesaoElement ); + areasLesaoElement.addContent( areaLesaoElement ); + } + lesaoElement.addContent( areasLesaoElement ); + Element tipoLesaoElement = new Element( "Tipo" ); + tipoLesaoElement.setText( analiseAcidente.getTipo_lesao() ); + lesaoElement.addContent( tipoLesaoElement ); + acidenteElement.addContent( lesaoElement ); + Element incapacidadeElement = new Element( "Incapacidade" ); + Element tipoIncapacidadeElement = new Element( "Tipo" ); + String tipoIncapacidade = analiseAcidente.getTipo_incapacidade(); + if( "n".equals( tipoIncapacidade ) ) + { + tipoIncapacidade = "Nenhuma"; + } + else if( "t".equals( tipoIncapacidade ) ) + { + tipoIncapacidade = "Tempor\u00e1ria"; + } + else if( "p".equals( tipoIncapacidade ) ) + { + tipoIncapacidade = "Permanente"; + } + tipoIncapacidadeElement.setText( tipoIncapacidade ); + incapacidadeElement.addContent( tipoIncapacidadeElement ); + Element coeficienteIncapacidadeElement = new Element( "Coeficiente" ); + coeficienteIncapacidadeElement.setText( "" + analiseAcidente.getCoef_incapacidade() ); + incapacidadeElement.addContent( coeficienteIncapacidadeElement ); + Date dataAvaliacao = analiseAcidente.getData_aval_incapacidade(); + incapacidadeElement.addContent( createDataElement( "DataAvaliacao", dataAvaliacao ) ); + Date dataRevisao = analiseAcidente.getData_rev_incapacidade(); + incapacidadeElement.addContent( createDataElement( "DataRevisao", dataRevisao ) ); + Element periodoIncapacidadeElement = new Element( "PeriodoIncapacidade" ); + Date inicioIncapacidade = analiseAcidente.getPeriodo_incapacidade_de(); + periodoIncapacidadeElement.addContent( createDataElement( "Inicio", inicioIncapacidade ) ); + Date fimIncapacidade = analiseAcidente.getPeriodo_incapacidade_a(); + periodoIncapacidadeElement.addContent( createDataElement( "Fim", fimIncapacidade ) ); + incapacidadeElement.addContent( periodoIncapacidadeElement ); + acidenteElement.addContent( incapacidadeElement ); + return acidenteElement; + } + + protected Element createRecomendacoesSIPRPElement() + { + Element recomendacoesSIPRPElement = new Element( "RecomendacoesSIPRP" ); + for( int r = 0; r < recomendacoes.length; r++ ) + { + Element recomendacaoElement = new Element( "Recomendacao" ); + recomendacaoElement.setText( recomendacoes[ r ].getRecomendacao() ); + recomendacoesSIPRPElement.addContent( recomendacaoElement ); + } + + return recomendacoesSIPRPElement; + } + + protected Element createMedidasElement() + { + Element medidasElement = new Element( "MedidasAdoptar" ); + for( int m = 0; m < medidas.length; m++ ) + { + Element medidaElement = new Element( "Medida" ); + medidaElement.setText( medidas[ m ].getMedida() ); + medidasElement.addContent( medidaElement ); + } + return medidasElement; + } + + protected Element createTomadaConhecimentoElement() + { + Element tomadaConhecimentoElement = new Element( "TomadaConhecimento" ); + tomadaConhecimentoElement.addContent( + createAssinaturaElement( "DepartamentoSeguranca", + analiseAcidente.getAveriguador(), + analiseAcidente.getData_inicio_processo() ) ); + tomadaConhecimentoElement.addContent( + createAssinaturaElement( "TecnicoHST", + analiseAcidente.getNome_resp_consolidacao(), + analiseAcidente.getData_consolidacao() ) ); + tomadaConhecimentoElement.addContent( + createAssinaturaElement( "ResponsavelSeguranca", + analiseAcidente.getNome_resp_seg(), + analiseAcidente.getData_assinatura_seg() ) ); + tomadaConhecimentoElement.addContent( + createAssinaturaElement( "ResponsavelRH", + analiseAcidente.getNome_resp_rh(), + analiseAcidente.getData_assinatura_rh() ) ); + tomadaConhecimentoElement.addContent( + createAssinaturaElement( "SuperiorHierarquico", + acidentado.getNome_superior_hierarquico(), + acidentado.getData_email_superior_hierarquico() ) ); + return tomadaConhecimentoElement; + } + + protected Element createAssinaturaElement( String nome, String nomeStr, Date data ) + { + Element assinaturaElement = new Element( nome ); + Element nomeElement = new Element( "Nome" ); + nomeElement.setText( nomeStr ); + assinaturaElement.addContent( nomeElement ); + assinaturaElement.addContent( createDataElement( "Data", data ) ); + return assinaturaElement; + } + + protected Element createDataElement( String nome, Date data ) + { + Element dataElement = new Element( nome ); + + Element anoElement = new Element( "Ano" ); + dataElement.addContent( anoElement ); + Element mesElement = new Element( "Mes" ); + dataElement.addContent( mesElement ); + Element diaElement = new Element( "Dia" ); + dataElement.addContent( diaElement ); + + if( data != null ) + { + Calendar cal = Calendar.getInstance(); + cal.setTime( data ); + anoElement.setText( "" + cal.get( Calendar.YEAR ) ); + int mes = cal.get( Calendar.MONTH ) + 1; + mesElement.setText( mes > 9 ? ( "" + mes ) : ( "0" + mes ) ); + int dia = cal.get( Calendar.DAY_OF_MONTH ); + diaElement.setText( dia > 9 ? ( "" + dia ) : ( "0" + dia ) ); + } + + return dataElement; + } + + protected Element createHoraElement( String nome, Date hora ) + { + Element horaElement = new Element( nome ); + Element horasElement = new Element( "Horas" ); + horaElement.addContent( horasElement ); + Element minutosElement = new Element( "Minutos" ); + horaElement.addContent( minutosElement ); + if( hora != null ) + { + Calendar cal = Calendar.getInstance(); + cal.setTime( hora ); + int horas = cal.get( Calendar.HOUR_OF_DAY ); + horasElement.setText( horas > 9 ? ( "" + horas ) : ( "0" + horas ) ); + int minutos = cal.get( Calendar.MINUTE ); + minutosElement.setText( minutos > 9 ? ( "" + minutos ) : ( "0" + minutos ) ); + } + return horaElement; + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/analise_acidentes_trabalho.xsl b/trunk/AnaliseAcidentesTrabalho/src/pdf/analise_acidentes_trabalho.xsl new file mode 100644 index 00000000..49436f02 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/pdf/analise_acidentes_trabalho.xsl @@ -0,0 +1,841 @@ + + + + + + + + + + + + + + + + Página + + + + de + + + + + + + + + + + + + + + + + + + + + + + ANÁLISE DE ACIDENTE DE TRABALHO + + + + + + + + + N.º + + + + + + DATA: + + / + + / + + + + + + + + + + + + + + + + + + + + + + + + IDENTIFICAÇÃO DA + ENTIDADE EMPREGADORA + + + + + + Identificação + completa: + + + + + + + + Actividade desenvolvida: + + + + + + + + Loja: + + + + + + + + + + + + + EMPRESA SEGURADORA + + + + + + Identificação + completa: + + + + + + + + Nº de Apólice: + + + + + + + + + + + + + + EMPRESA PRESTADORA DE + SERVIÇOS DE + SEGURANÇA, HIGIENE E + SAÚDE DO TRABALHO + + + + + + Identificação + completa: + + + + + + + + Técnico(a) Superior + de HST: + + + + + + C.A.P. nº: + + + + + + + + Médico(a) do + Trabalho: + + + + + + Cédula Prof. nº: + + + + + + + + + + + + + + ACIDENTADO (A) + + + + + + Nome: + + + + + + + + Estabelecimento de + origem: + + + + + + + + Data Nascimento: + + / + + / + + + + + + + + Bilhete de Identidade + N°: + + + + + + + + Morada: + + + + + + + + Contacto + telefónico: + + + + + + + + Data admissão: + + / + + / + + + + + + + + Função: + + + + + + + + Turno de Trabalho: + + + + + + + Identificação do superior + hierárquico/Responsável do + posto de trabalho + + + + + + Nome: + + + + + + E-mail: + + + + + + + + + + + + + + DADOS DO ACIDENTE DE + TRABALHO + + + + + + Averiguador: + + + + + + + + Data da ocorrência: + + / + + / + + + + + + Hora do acidente: + + h + + m + + + + + + + Nº horas trabalhadas no + turno: + + + + + + + + Secção: + + + + + + Local específico: + + + + + + + + Tarefa/Actividade que se + encontrava a realizar: + + + + + + + + Substâncias, + equipamentos, + ferramentas e objectos + utilizados: + + + + + + + + Condições que + contribuíram para o + acidente e respectiva + explicação da + sua existência: + + + + + + + + Testemunhas: + + + + + + + + Causas do acidente: + + + + + + + + Descrição do + acidente: + + + + + + + + Fotografia(s) e/ou + croqui(s) do local do + acidente: + + + Ver Anexo + + + Nenhum + + + + + + + + + + + + Conclusões: + + + + + + + + Acções Imediatas + tomadas: + + + + + + + + + + O colaborador + teve formação em SHST + + + O colaborador não + teve formação em SHST + + + + + + + Motivo: + + + + + + + + + + + + Verificaram-se outras + ocorrências/incidências + no mesmo posto de + trabalho com o + colaborador acidentado. + + + Não se verificaram outras + ocorrências/incidências + no mesmo posto de + trabalho com o + colaborador acidentado. + + + + + + + Quantidade: + + Relatórios de acidente nº: + + + ; + + + + + + + + + + + + Verificaram-se + ocorrências/incidentes + semelhantes com outros + colaboradores. + + + Não se verificaram + ocorrências/incidentes + semelhantes com outros + colaboradores. + + + + + + + Quantidade: + + Relatórios de acidente nº: + + + ; + + + + + + + + + + LESÃO + + + + + + + Áreas corporais + específicas + lesionadas: + + + + + + + : + + + + + + + + Tipo de Lesão: + + + + + + + + + INCAPACIDADE + + + + + + + Tipo de Incapacidade: + + + + + + Coeficiente de + Incapacidade + + % + + + + + + + Avaliação de + Incapacidade realizada + em + + / + + / + + + + + + Revisão de + Incapacidade + + / + + / + + + + + + + + Período da Incapacidade + Temporária: de + + / + + / + + a + + / + + / + + + + + + + + + + + + + + RECOMENDAÇÕES PROPOSTAS + pela SIPRP + + + + + + + + + + . + + + + + + + + + + + + + + + + MEDIDAS A ADOPTAR PELA + ENTIDADE EMPREGADORA + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + TOMADA DE CONHECIMENTO / + TERMO DE + RESPONSABILIDADE + + + + + + + + + Averiguado por + + (Departamento de Segurança) + a + + / + + / + + . + + + Verificado por + + (Técnico + de HST) a + + / + + / + + . + + + Verificado por + + (Responsável de Segurança) a + + / + + / + + . + + + Verificado por + + (Responsável de RH) a + + / + + / + + . + + + Com conhecimento de + + (Superior hierárquico) a + + / + + / + + . + + - processamento informático + - acesso autenticado - + + + + + + + + + + + + + ANEXO - Imagens + + + + Página + + + + de + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/auchan_logo.gif b/trunk/AnaliseAcidentesTrabalho/src/pdf/auchan_logo.gif new file mode 100644 index 00000000..92ef1c5b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/src/pdf/auchan_logo.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/siprp_logo.gif b/trunk/AnaliseAcidentesTrabalho/src/pdf/siprp_logo.gif new file mode 100644 index 00000000..073ad184 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/src/pdf/siprp_logo.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/teste.xml b/trunk/AnaliseAcidentesTrabalho/src/pdf/teste.xml new file mode 100644 index 00000000..de26bcab --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/pdf/teste.xml @@ -0,0 +1,384 @@ + + + + 1 + + + + 2008 + + + 01 + + + 01 + + + + + Companhia Portuguesa de Hipermercados, S.A., com sede na Travessa Teixeira + Júnior, 1 - 1300-553 Lisboa + + + Comércio a Retalho em Supermercados e Hipermercados + + + Jumbo Alfragide + + + + + Mapfre Seguros Gerais, S.A. + + + 1500591100500 + + + + + SIPRP - Sociedade Ibérica de Prevenção de Riscos Profissionais Lda., + com sede no Edifício Atrium Saldanha, Praça Duque de Saldanha, 1 - 9º G + - 1050-094 Lisboa + + + + Tecnico HST teste + + + C1A2P3 + + + + + Medico Trabalho teste + + + C123 + + + + + + Trablhador acidentado + + + + Jumbo de Alfragide + + + + + 1980 + + + 11 + + + 08 + + + + + 1112225585 + + + + Rua de Cima, 3º dto + + + 215465981 + + + + 2004 + + + 10 + + + 01 + + + + Varredor + + + Tarde + + + + António Pedro + + + apedro@hotmail.com + + + + + + + João António + + + + + 2007 + + + 12 + + + 23 + + + + + 12 + + + 35 + + + + 4 + + + + Congelados + + + Corredor Esquerdo + + + + + A varrer + + + Vassoura + + + Chão molhado + + + + Pedro Silva, Marco Pedro + + + Sono + + + Escorregou e caiu + + + + + + + + + Conclusao sem indicios nenhuns q a suportem + + + gritar. correr as voltas em panico + + + + y + + + + + + + 3 + + + + 3487 + + + 23424 + + + + + + 0 + + + + + + + + + + + + + Cabeça + + + + + Tronco + + + + + Membro Superior Direito + + + Mão + + + + + Grave + + + + + Permanente + + + 10 + + + + 2005 + + + 01 + + + 01 + + + + + 2007 + + + 01 + + + 01 + + + + + + + + + + + + + + + + + + + + + + + + + beber mta agua + + + fazer aerobica + + + + + despedir o trabalhador + + + lamber sabao + + + + + + Joao + + + + 2007 + + + 01 + + + 01 + + + + + + Pedro + + + + 2007 + + + 01 + + + 02 + + + + + + Simao + + + + 2007 + + + 01 + + + 03 + + + + + + Rafael + + + + 2007 + + + 01 + + + 04 + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATContextListener.java b/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATContextListener.java new file mode 100644 index 00000000..186d6a8d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATContextListener.java @@ -0,0 +1,80 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package phaselistener; + +import com.evolute.properties.EvoAbstractPropertiesLoader; +import com.evolute.utils.error.ErrorLogger; +import db.providers.EvoBaseProvider; +import java.text.SimpleDateFormat; +import java.util.Date; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import shst.companydataloaders.SIPRPPropertiesLoader; +import utils.AnaliseAcidentesTrabalhoLogger; + +/** + * + * @author dneves + */ +public class AATContextListener implements ServletContextListener +{ + + private long startedTime = 0L; + + @Override + public void contextInitialized( ServletContextEvent sce ) + { + startedTime = System.currentTimeMillis(); + System.out.println( "\n\ncontextInitialized : " + startedTime ); + + + + try + { + System.out.println( "\nReading app.properties ..." ); + EvoAbstractPropertiesLoader.forceEncryptedPropertiesFile = false; + SIPRPPropertiesLoader props = SIPRPPropertiesLoader.getInstance(); + props.load(); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + + try + { + System.out.println( "\nInitializing DB ... " ); + EvoBaseProvider.getInstance(); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + + try + { + System.out.println( "\nInitializing error logger ..." ); + AnaliseAcidentesTrabalhoLogger.init(); + } + catch ( Exception e ) + { + e.printStackTrace( System.out ); + } + + } + + @Override + public void contextDestroyed( ServletContextEvent sce ) + { + long endTime = System.currentTimeMillis(); + + SimpleDateFormat D_F = new SimpleDateFormat( "dd-MM-yyyy HH:mm:ss" ); + Date startDate = new Date( startedTime ); + Date endDate = new Date( endTime ); + + System.out.println( "\ncontextDestroyed : " + D_F.format( startDate ) + " -> " + D_F.format( endDate ) + " = " + ( (endTime - startedTime) / 1000 ) + " s" ); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATMainPhaseListener.java b/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATMainPhaseListener.java new file mode 100644 index 00000000..7228335d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATMainPhaseListener.java @@ -0,0 +1,91 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package phaselistener; + +import javax.faces.context.FacesContext; +import javax.faces.event.PhaseEvent; +import javax.faces.event.PhaseId; +import javax.faces.event.PhaseListener; +import analiseacidentestrabalho.SessionBean1; +import beans.Utilizador; +import com.evolute.utils.error.ErrorLogger; +import global.Global; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import javax.faces.component.UIViewRoot; +import javax.servlet.http.HttpServletRequest; +import utils.JSFUtils; +import utils.Logos; + +/** + * + * @author lluis + */ +public class AATMainPhaseListener implements PhaseListener +{ + private static final SimpleDateFormat DT_F = new SimpleDateFormat( "yyyy-MM-dd - HH:mm:ss.S", new Locale( "pt", "PT" ) ); + + @Override + public void afterPhase(PhaseEvent pe) + { + + } + + @Override + public void beforePhase( PhaseEvent pe ) + { + if ( pe.getPhaseId() == PhaseId.RENDER_RESPONSE ) + { + System.out.println( DT_F.format( new Date() ) ); + FacesContext fc = pe.getFacesContext(); + SessionBean1 session = JSFUtils.getSessionBean( fc ); + + HttpServletRequest req = ( HttpServletRequest ) fc.getExternalContext().getRequest(); + boolean sessionValid = req.isRequestedSessionIdValid(); + + UIViewRoot view = fc.getViewRoot(); + String viewID = view.getViewId(); + System.out.println( "\tView ID :" + viewID ); + + boolean loggedIn = session.isLoggedIn(); + System.out.println( "\tSessionValid : " + sessionValid ); + System.out.println( "\tLogged In : " + loggedIn ); + + Utilizador currentUser = session.getCurrentUser(); + System.out.println( "\tUtilizador: " + ( currentUser == null ? "null" : currentUser.getLogin() ) ); + + if ( sessionValid && loggedIn ) + { + //insert logos + String logourl = Logos.getInstance().getLogo( fc, new Integer( Global.AUCHAN ) ); + session.setLogoEmpresaUrl( logourl ); + } + else + { + if ( ! viewID.endsWith( "/Login.jsp" ) && ! viewID.endsWith( "/RecuperarPassword.jsp" ) ) + { + try + { + JSFUtils.redirect( fc.getCurrentInstance(), "faces/Login.jsp" ); + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + System.out.println( "\n\t\t\tERROR REDIRECTING TO LOGIN !" ); + } + } + } + } + } + + @Override + public PhaseId getPhaseId() + { + return PhaseId.ANY_PHASE; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATSessionListener.java b/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATSessionListener.java new file mode 100644 index 00000000..7ca3255b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/phaselistener/AATSessionListener.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package phaselistener; + +import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpSessionEvent; +import javax.servlet.http.HttpSessionListener; + +/** + * + * @author dneves + */ +public class AATSessionListener implements HttpSessionListener +{ + + @Override + public void sessionCreated( HttpSessionEvent se ) + { + HttpSession session = se.getSession(); + System.out.println( "AnaliseAcidentesTrabalho : new Session Created : " + session.getId() ); + } + + @Override + public void sessionDestroyed( HttpSessionEvent se ) + { + HttpSession session = se.getSession(); + System.out.println( "AnaliseAcidentesTrabalho : session destroyed : " + session.getId() ); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/utils/AnaliseAcidentesTrabalhoLogger.java b/trunk/AnaliseAcidentesTrabalho/src/utils/AnaliseAcidentesTrabalhoLogger.java new file mode 100644 index 00000000..f447dc65 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/utils/AnaliseAcidentesTrabalhoLogger.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package utils; + +import com.evolute.utils.error.ErrorLogger; +import com.evolute.utils.error.Logger; +import com.evolute.utils.error.LoggerProperties; +import com.evolute.utils.error.ProjectsEnum; +import com.evolute.utils.error.ws.WSLogger; +import java.util.HashMap; +import java.util.Map; + +/** + * + * @author dneves + */ +public class AnaliseAcidentesTrabalhoLogger +{ + + public static void init() throws Exception + { + Map< LoggerProperties, String > properties = new HashMap< LoggerProperties, String >(); + properties.put( LoggerProperties.SOFTWARE_NAME, "SIPRP - Analise Acidentes Trabalho" ); + properties.put( LoggerProperties.SOFTWARE_VERSION, "1" ); + properties.put( LoggerProperties.PROJECT, ProjectsEnum.ANALISE_ACIDENTES_TRABALHO.toString() ); + properties.put( LoggerProperties.PROJECT_NAME, ProjectsEnum.ANALISE_ACIDENTES_TRABALHO.toString() ); + properties.put( LoggerProperties.PROJECT_VERSION, "1" ); + + String user = ""; + String pass = ""; + String host = ""; + String port = ""; + +// EvoProxyObject.configSystemProxySelector(); +// EvoProxyObject.getProxy( user, pass, host, port ); + + Logger logger = new WSLogger( properties ); + ErrorLogger.initializeLogger( logger, true, false ); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/utils/JSFUtils.java b/trunk/AnaliseAcidentesTrabalho/src/utils/JSFUtils.java new file mode 100644 index 00000000..5ff04781 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/utils/JSFUtils.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package utils; + +import analiseacidentestrabalho.SessionBean1; +import java.util.Iterator; +import java.util.Map; +import javax.faces.application.Application; +import javax.faces.context.ExternalContext; +import javax.faces.context.FacesContext; +import javax.servlet.RequestDispatcher; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author lluis + */ +public class JSFUtils { + + +// public static SessionBean1 getSessionBean(FacesContext fc) +// { +// FacesContext context = fc.getCurrentInstance(); +// SessionBean1 session = (SessionBean1) context.getApplication().getELResolver().getValue(context.getELContext(), null, "SessionBean1"); +// return session; +// } + + // + // isPostBack - JSF 1.1 implementation + // +// public static boolean isPostBack(FacesContext fc) +// { +// Map parameterMap = fc.getExternalContext().getRequestParameterMap(); +// if(parameterMap.size() > 0) +// { +// return true; +// } +// return false; +// } + + public static SessionBean1 getSessionBean(FacesContext fc) + { + FacesContext context = fc.getCurrentInstance(); + //HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true); + //SessionBean1 session = (SessionBean1) context.getApplication().getELResolver().getValue(context.getELContext(), null, "SessionBean1"); + //SessionBean1 session = (SessionBean1) context.getApplication().; + + final StringBuffer valueBinding = new StringBuffer(); + valueBinding.append('#'); + valueBinding.append('{'); + valueBinding.append("SessionBean1"); + valueBinding.append('}'); + SessionBean1 session = (SessionBean1) fc.getApplication(). + createValueBinding(valueBinding.toString()).getValue(fc); + return session; + } + + public static boolean isPostBack(FacesContext fc) + { + Map parameterMap = fc.getExternalContext().getRequestParameterMap(); + + if(parameterMap.size() > 0) + { + Iterator iter = parameterMap.keySet().iterator(); + while(iter.hasNext()) + { + String par = (String) iter.next(); + } + return true; + } + return false; + } + + // + // isPostBack - JSF 1.2 implementation + // +// public static boolean isPostBack12(FacesContext fc) +// { +// ResponseStateManager rsm = fc.getRenderKit().getResponseStateManager(); +// if(rsm.isPostback(fc)) +// { +// return true; +// } +// return false; +// } + + public static void logout(FacesContext fc, boolean redirect ) throws Exception + { + ExternalContext ectx = fc.getCurrentInstance().getExternalContext(); + Utils.doLogout( ectx, redirect ); + } + + public static void navigateTo(FacesContext fc, String outcome) + { + FacesContext context = fc.getCurrentInstance(); + Application app = context.getApplication(); + app.getNavigationHandler().handleNavigation(context, null, outcome); + } + + public static void redirect(FacesContext context, String url) throws Exception + { + HttpServletResponse response = (HttpServletResponse) context.getCurrentInstance().getExternalContext().getResponse(); + response.sendRedirect(url); + context.responseComplete(); + } + + public static void dispatch(FacesContext context, String url) throws Exception + { + HttpServletResponse response = (HttpServletResponse) context.getCurrentInstance().getExternalContext().getResponse(); + HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest(); + RequestDispatcher rd = request.getRequestDispatcher(url); + rd.forward(request, response); + } + + public static String getRequestParameter(FacesContext fc, String parameter) + { + Map parameters = fc.getCurrentInstance().getExternalContext().getRequestParameterMap(); + return (String) parameters.get(parameter); + } + + public static boolean requestHasParameters(FacesContext fc) + { + int size = fc.getCurrentInstance().getExternalContext().getRequestParameterMap().size(); + if(size > 0) + { + return true; + } + return false; + } + + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/utils/Logos.java b/trunk/AnaliseAcidentesTrabalho/src/utils/Logos.java new file mode 100644 index 00000000..870d6380 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/utils/Logos.java @@ -0,0 +1,95 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package utils; + +import com.evolute.utils.error.ErrorLogger; +import db.providers.AnalisesDataProvider; +import global.Global; +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; +import javax.faces.context.FacesContext; +import javax.servlet.ServletContext; + +/** + * + * @author lluis + */ +public class Logos +{ + + private static Logos INSTANCE = null; + + private Logos() + { + + } + + public static synchronized Logos getInstance() + { + if ( INSTANCE == null ) + { + INSTANCE = new Logos(); + } + return INSTANCE; + } + + + public String getLogo( Integer empresaID ) + { + return null; + } + + + + private final Map< Integer, String > LOGOS = new HashMap< Integer, String >(); + + public String getLogo( FacesContext fc, Integer empresaID ) + { + if ( ! LOGOS.containsKey( empresaID ) ) + { + fetchLogoFromDB( fc, empresaID ); + } + String result = LOGOS.get( empresaID ); + System.out.println( "LOGO PATH : " + result ); + return result; + } + + + private void fetchLogoFromDB( FacesContext fc, Integer empresaID ) + { + String filepath = Global.LOGOS_FOLDER + "/logo_empresa" + empresaID + ".jpg"; + File f = new File( filepath ); + if ( ! f.isFile() ) + { + try + { + byte[] logo = AnalisesDataProvider.getInstance().getLogoByEmpresa( empresaID ); + if ( logo != null ) + { + int len = logo.length; + + ServletContext context = ( ServletContext ) fc.getExternalContext().getContext(); + File logoFolder = new File( context.getRealPath( Global.LOGOS_FOLDER ) ); + String logoFilename = logoFolder + "/logo_empresa" + empresaID.toString() + ".jpg"; + OutputStream outImej = new FileOutputStream( logoFilename ); + outImej.write( logo, 0, len ); + outImej.flush(); + outImej.close(); + + LOGOS.put( empresaID, filepath ); + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + } + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/utils/Strings.java b/trunk/AnaliseAcidentesTrabalho/src/utils/Strings.java new file mode 100644 index 00000000..1fbfc2d0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/utils/Strings.java @@ -0,0 +1,151 @@ +/* + * Strings.java + * + * Created on October 8, 2007, 9:17 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package utils; + +/** + * + * @author lluis + */ +public class Strings { + public static String unicodeToHTML( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + + String output = text; + output = output.replace( "\\u0009", " " ); + output = output.replace( "\\u000a", "
" ); + + output = output.replace( "\\u00a0", " " ); + output = output.replace( "\\u00aa", "ª" ); + output = output.replace( "\\u00ba", "º" ); + + output = output.replace( "\\u00c0", "À" ); + output = output.replace( "\\u00c1", "Á" ); + output = output.replace( "\\u00c2", "Â" ); + output = output.replace( "\\u00c3", "Ã" ); + output = output.replace( "\\u00c7", "Ç" ); + output = output.replace( "\\u00c8", "È" ); + output = output.replace( "\\u00c9", "É" ); + + output = output.replace( "\\u00ca", "Ê" ); + output = output.replace( "\\u00cc", "Ì" ); + output = output.replace( "\\u00cd", "Í" ); + output = output.replace( "\\u00ce", "Î" ); + output = output.replace( "\\u00d2", "ò" ); + output = output.replace( "\\u00d3", "ó" ); + output = output.replace( "\\u00d4", "ô" ); + output = output.replace( "\\u00d5", "õ" ); + output = output.replace( "\\u00d9", "Ù" ); + output = output.replace( "\\u00da", "Ú" ); + output = output.replace( "\\u00db", "Û" ); + + output = output.replace( "\\u00e0", "à" ); + output = output.replace( "\\u00e1", "á" ); + output = output.replace( "\\u00e2", "â" ); + output = output.replace( "\\u00e3", "ã" ); + output = output.replace( "\\u00e7", "ç" ); + output = output.replace( "\\u00e8", "è" ); + output = output.replace( "\\u00e9", "é" ); + output = output.replace( "\\u00ea", "ê" ); + output = output.replace( "\\u00ec", "ì" ); + output = output.replace( "\\u00ed", "í" ); + output = output.replace( "\\u00ee", "î" ); + output = output.replace( "\\u00f2", "ò" ); + output = output.replace( "\\u00f3", "ó" ); + output = output.replace( "\\u00f4", "ô" ); + output = output.replace( "\\u00f5", "õ" ); + output = output.replace( "\\u00f9", "ù" ); + output = output.replace( "\\u00fa", "ú" ); + output = output.replace( "\\u00fb", "û" ); + + output = output.replace( "\\u0153", "œ" ); + + output = output.replace( "\\u2013", "-" ); + output = output.replace( "\\u2014", "-" ); + output = output.replace( "\\u2018|\\u2019", "'" ); + output = output.replace( "\\u201c|\\u201d", "\"" ); + + output = output.replace( "\\u2022", "*" ); + output = output.replace( "\\u2026", "..." ); + + return output; + } + + public static String textToUnicode( String text ) + { + String output = text; + output = output.replace( "À", "\\u00c0" ); + output = output.replace( "Á", "\\u00c1" ); + output = output.replace( "Â", "\\u00c2" ); + output = output.replace( "Ã", "\\u00c3" ); + output = output.replace( "Ç", "\\u00c7" ); + output = output.replace( "È", "\\u00c8" ); + output = output.replace( "É", "\\u00c9" ); + + output = output.replace( "Ê", "\\u00ca" ); + output = output.replace( "Ì", "\\u00cc" ); + output = output.replace( "Í", "\\u00cd" ); + output = output.replace( "Î", "\\u00ce" ); + output = output.replace( "ò", "\\u00d2" ); + output = output.replace( "ó", "\\u00d3" ); + output = output.replace( "ô", "\\u00d4" ); + output = output.replace( "õ", "\\u00d5" ); + output = output.replace( "Ù", "\\u00d9" ); + output = output.replace( "Ú", "\\u00da" ); + output = output.replace( "Û", "\\u00db" ); + + output = output.replace( "à", "\\u00e0" ); + output = output.replace( "á", "\\u00e1" ); + output = output.replace( "â", "\\u00e2" ); + output = output.replace( "ã", "\\u00e3" ); + output = output.replace( "ç", "\\u00e7" ); + output = output.replace( "è", "\\u00e8" ); + output = output.replace( "é", "\\u00e9" ); + output = output.replace( "ê", "\\u00ea" ); + output = output.replace( "ì", "\\u00ec" ); + output = output.replace( "í", "\\u00ed" ); + output = output.replace( "î", "\\u00ee" ); + output = output.replace( "ò", "\\u00f2" ); + output = output.replace( "ó", "\\u00f3" ); + output = output.replace( "ô", "\\u00f4" ); + output = output.replace( "õ", "\\u00f5" ); + output = output.replace( "ù", "\\u00f9" ); + output = output.replace( "ú", "\\u00fa" ); + output = output.replace( "û", "\\u00fb" ); + + return output; + } + + public static String RTFToUnicode( String text ) + { + if( text == null || text.length() < 4 ) + { + return text; + } + String output = text; + output = output.replaceAll( "\\'", "\\u00" ); + return output; + } + + public static String unicodeToRTF( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + String output = text; + output = output.replaceAll( "\\\\u00", "\\\\'" ); + return output; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/utils/Utils.java b/trunk/AnaliseAcidentesTrabalho/src/utils/Utils.java new file mode 100644 index 00000000..365aed89 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/utils/Utils.java @@ -0,0 +1,596 @@ +/* + * Utils.java + * + * Created on October 12, 2007, 9:39 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package utils; + +import beans.Utilizador; +import com.evolute.utils.Singleton; +import com.evolute.utils.error.ErrorLogger; +import com.sun.rave.web.ui.component.DropDown; +import com.sun.rave.web.ui.model.Option; +import db.providers.AnalisesDataProvider; +import db.providers.EstatisticasDataProvider; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import javax.faces.context.ExternalContext; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpSession; + +/** + * + * @author lluis + */ +public class Utils { + + /** Creates a new instance of Utils */ + public Utils() { + } + + public static String unicodeToHTML( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + + String output = text; + output = output.replaceAll( "\\\\u0009", " " ); + output = output.replaceAll( "\\\\u000a", "
" ); + + output = output.replaceAll( "\\\\u00a0", " " ); + output = output.replaceAll( "\\\\u00aa", "ª" ); + output = output.replaceAll( "\\\\u00ba", "º" ); + + output = output.replaceAll( "\\\\u00c0", "À" ); + output = output.replaceAll( "\\\\u00c1", "Á" ); + output = output.replaceAll( "\\\\u00c2", "Â" ); + output = output.replaceAll( "\\\\u00c3", "Ã" ); + output = output.replaceAll( "\\\\u00c7", "Ç" ); + output = output.replaceAll( "\\\\u00c8", "È" ); + output = output.replaceAll( "\\\\u00c9", "É" ); + output = output.replaceAll( "\\\\u00d3", "Ó" ); + output = output.replaceAll( "\\\\u00d2", "Ò" ); + + output = output.replaceAll( "\\\\u00ca", "Ê" ); + output = output.replaceAll( "\\\\u00cc", "Ì" ); + output = output.replaceAll( "\\\\u00cd", "Í" ); + output = output.replaceAll( "\\\\u00ce", "Î" ); + output = output.replaceAll( "\\\\u00d2", "ò" ); + output = output.replaceAll( "\\\\u00d3", "ó" ); + output = output.replaceAll( "\\\\u00d4", "ô" ); + output = output.replaceAll( "\\\\u00d5", "õ" ); + output = output.replaceAll( "\\\\u00d9", "Ù" ); + output = output.replaceAll( "\\\\u00da", "Ú" ); + output = output.replaceAll( "\\\\u00db", "Û" ); + + output = output.replaceAll( "\\\\u00e0", "à" ); + output = output.replaceAll( "\\\\u00e1", "á" ); + output = output.replaceAll( "\\\\u00e2", "â" ); + output = output.replaceAll( "\\\\u00e3", "ã" ); + output = output.replaceAll( "\\\\u00e7", "ç" ); + output = output.replaceAll( "\\\\u00e8", "è" ); + output = output.replaceAll( "\\\\u00e9", "é" ); + output = output.replaceAll( "\\\\u00ea", "ê" ); + output = output.replaceAll( "\\\\u00ec", "ì" ); + output = output.replaceAll( "\\\\u00ed", "í" ); + output = output.replaceAll( "\\\\u00ee", "î" ); + output = output.replaceAll( "\\\\u00f2", "ò" ); + output = output.replaceAll( "\\\\u00f3", "ó" ); + output = output.replaceAll( "\\\\u00f4", "ô" ); + output = output.replaceAll( "\\\\u00f5", "õ" ); + output = output.replaceAll( "\\\\u00f9", "ù" ); + output = output.replaceAll( "\\\\u00fa", "ú" ); + output = output.replaceAll( "\\\\u00fb", "û" ); + + output = output.replaceAll( "\\\\u0153", "œ" ); + + output = output.replaceAll( "\\\\u2013", "-" ); + output = output.replaceAll( "\\\\u2014", "-" ); + output = output.replaceAll( "\\\\u2018|\\\\u2019", "'" ); + output = output.replaceAll( "\\\\u201c|\\\\u201d", "\"" ); + + output = output.replaceAll( "\\\\u2022", "*" ); + output = output.replaceAll( "\\\\u2026", "..." ); + + return output; + } + + public static String textToUnicode( String text ) + { + String output = text; + + output = output.replaceAll( "À", "\\\\\\\\\\\\\\\\u00c0" ); + output = output.replaceAll( "Á", "\\\\\\\\\\\\\\\\u00c1" ); + output = output.replaceAll( "Â", "\\\\\\\\\\\\\\\\u00c2" ); + output = output.replaceAll( "Ã", "\\\\\\\\\\\\\\\\u00c3" ); + output = output.replaceAll( "Ç", "\\\\\\\\\\\\\\\\u00c7" ); + output = output.replaceAll( "È", "\\\\\\\\\\\\\\\\u00c8" ); + output = output.replaceAll( "É", "\\\\\\\\\\\\\\\\u00c9" ); + output = output.replaceAll( "Ó", "\\\\\\\\\\\\\\\\u00d3" ); + output = output.replaceAll( "Ò", "\\\\\\\\\\\\\\\\u00d2" ); + + output = output.replaceAll( "Ê", "\\\\\\\\\\\\\\\\u00ca" ); + output = output.replaceAll( "Ì", "\\\\\\\\\\\\\\\\u00cc" ); + output = output.replaceAll( "Í", "\\\\\\\\\\\\\\\\u00cd" ); + output = output.replaceAll( "Î", "\\\\\\\\\\\\\\\\u00ce" ); + output = output.replaceAll( "ò", "\\\\\\\\\\\\\\\\u00d2" ); + output = output.replaceAll( "ó", "\\\\\\\\\\\\\\\\u00d3" ); + output = output.replaceAll( "ô", "\\\\\\\\\\\\\\\\u00d4" ); + output = output.replaceAll( "õ", "\\\\\\\\\\\\\\\\u00d5" ); + output = output.replaceAll( "Ù", "\\\\\\\\\\\\\\\\u00d9" ); + output = output.replaceAll( "Ú", "\\\\\\\\\\\\\\\\u00da" ); + output = output.replaceAll( "Û", "\\\\\\\\\\\\\\\\u00db" ); + + output = output.replaceAll( "à", "\\\\\\\\\\\\\\\\u00e0" ); + output = output.replaceAll( "á", "\\\\\\\\\\\\\\\\u00e1" ); + output = output.replaceAll( "â", "\\\\\\\\\\\\\\\\u00e2" ); + output = output.replaceAll( "ã", "\\\\\\\\\\\\\\\\u00e3" ); + output = output.replaceAll( "ç", "\\\\\\\\\\\\\\\\u00e7" ); + output = output.replaceAll( "è", "\\\\\\\\\\\\\\\\u00e8" ); + output = output.replaceAll( "é", "\\\\\\\\\\\\\\\\u00e9" ); + output = output.replaceAll( "ê", "\\\\\\\\\\\\\\\\u00ea" ); + output = output.replaceAll( "ì", "\\\\\\\\\\\\\\\\u00ec" ); + output = output.replaceAll( "í", "\\\\\\\\\\\\\\\\u00ed" ); + output = output.replaceAll( "î", "\\\\\\\\\\\\\\\\u00ee" ); + output = output.replaceAll( "ò", "\\\\\\\\\\\\\\\\u00f2" ); + output = output.replaceAll( "ó", "\\\\\\\\\\\\\\\\u00f3" ); + output = output.replaceAll( "ô", "\\\\\\\\\\\\\\\\u00f4" ); + output = output.replaceAll( "õ", "\\\\\\\\\\\\\\\\u00f5" ); + output = output.replaceAll( "ù", "\\\\\\\\\\\\\\\\u00f9" ); + output = output.replaceAll( "ú", "\\\\\\\\\\\\\\\\u00fa" ); + output = output.replaceAll( "û", "\\\\\\\\\\\\\\\\u00fb" ); + + return output; + } + + public static String textToHtml( String text ) + { + String output = text; + + output = output.replaceAll( "À", "À" ); + output = output.replaceAll( "Á", "Á" ); + output = output.replaceAll( "Â", "Â" ); + output = output.replaceAll( "Ã", "Ã" ); + output = output.replaceAll( "Ç", "Ç" ); + output = output.replaceAll( "È", "È" ); + output = output.replaceAll( "É", "É" ); + output = output.replaceAll( "Ó", "Ó" ); + output = output.replaceAll( "Ò", "Ò" ); + + output = output.replaceAll( "Ê", "Ê" ); + output = output.replaceAll( "Ì", "Ì" ); + output = output.replaceAll( "Í", "Í" ); + output = output.replaceAll( "Î", "Î" ); + output = output.replaceAll( "ò", "ò" ); + output = output.replaceAll( "ó", "ó" ); + output = output.replaceAll( "ô", "ô" ); + output = output.replaceAll( "õ", "õ" ); + output = output.replaceAll( "Ù", "Ù" ); + output = output.replaceAll( "Ú", "Ú" ); + output = output.replaceAll( "Û", "Û" ); + + output = output.replaceAll( "à", "à" ); + output = output.replaceAll( "á", "á" ); + output = output.replaceAll( "â", "â" ); + output = output.replaceAll( "ã", "ã" ); + output = output.replaceAll( "ç", "ç" ); + output = output.replaceAll( "è", "è" ); + output = output.replaceAll( "é", "é" ); + output = output.replaceAll( "ê", "ê" ); + output = output.replaceAll( "ì", "ì" ); + output = output.replaceAll( "í", "í" ); + output = output.replaceAll( "î", "î" ); + output = output.replaceAll( "ò", "ò" ); + output = output.replaceAll( "ó", "ó" ); + output = output.replaceAll( "ô", "ô" ); + output = output.replaceAll( "õ", "õ" ); + output = output.replaceAll( "ù", "ù" ); + output = output.replaceAll( "ú", "ú" ); + output = output.replaceAll( "û", "û" ); + + return output; + } + + public static String htmlToText(String text) + { + String output = text; + if (output != null) + { + output = output.replaceAll("À", "À"); + output = output.replaceAll("Á", "Á"); + output = output.replaceAll("Â", "Â"); + output = output.replaceAll("Ã", "Ã"); + output = output.replaceAll("Ç", "Ç"); + output = output.replaceAll("È", "È"); + output = output.replaceAll("É", "É"); + output = output.replaceAll("Ó", "Ó"); + output = output.replaceAll("Ò", "Ò"); + + output = output.replaceAll("Ê", "Ê"); + output = output.replaceAll("Ì", "Ì"); + output = output.replaceAll("Í", "Í"); + output = output.replaceAll("Î", "Î"); + output = output.replaceAll("ò", "ò"); + output = output.replaceAll("ó", "ó"); + output = output.replaceAll("ô", "ô"); + output = output.replaceAll("õ", "õ"); + output = output.replaceAll("Ù", "Ù"); + output = output.replaceAll("Ú", "Ú"); + output = output.replaceAll("Û", "Û"); + + output = output.replaceAll("à", "à"); + output = output.replaceAll("á", "á"); + output = output.replaceAll("â", "â"); + output = output.replaceAll("ã", "ã"); + output = output.replaceAll("ç", "ç"); + output = output.replaceAll("è", "è"); + output = output.replaceAll("é", "é"); + output = output.replaceAll("ê", "ê"); + output = output.replaceAll("ì", "ì"); + output = output.replaceAll("í", "í"); + output = output.replaceAll("î", "î"); + output = output.replaceAll("ò", "ò"); + output = output.replaceAll("ó", "ó"); + output = output.replaceAll("ô", "ô"); + output = output.replaceAll("õ", "õ"); + output = output.replaceAll("ù", "ù"); + output = output.replaceAll("ú", "ú"); + output = output.replaceAll("û", "û"); + } + return output; + } + + public static String getPageFrom(String referer) + { + String pageFrom = referer.substring(referer.lastIndexOf("/")+1); + return pageFrom; + } + + public static boolean isValidEmail(String email){ + boolean res = true; + System.out.println("IS VALID EMAIL"); + int indexOfAtChar=email.indexOf("@"); + + if(!isValidEmailCharacters(email)) + { + return false; + } + + if(indexOfAtChar > 0) + { + int indexOfDotChar = + email.indexOf(".",indexOfAtChar); + if(indexOfDotChar > 0) + { + res = true; + } + else + { + res = false; + } + } + else{ + res = false; + } + return res; + } + + private static boolean isValidEmailCharacters(String email) + { + if(email.indexOf("à") != -1) + { + return false; + } + else if(email.indexOf("á") != -1) + { + return false; + } + else if(email.indexOf("ã") != -1) + { + return false; + } + else if(email.indexOf("â") != -1) + { + return false; + } + else if(email.indexOf("è") != -1) + { + return false; + } + else if(email.indexOf("é") != -1) + { + return false; + } + else if(email.indexOf("ê") != -1) + { + return false; + } + else if(email.indexOf("ì") != -1) + { + return false; + } + else if(email.indexOf("í") != -1) + { + return false; + } + else if(email.indexOf("ò") != -1) + { + return false; + } + else if(email.indexOf("ó") != -1) + { + return false; + } + else if(email.indexOf("ô") != -1) + { + return false; + } + else if(email.indexOf("õ") != -1) + { + return false; + } + else if(email.indexOf("ù") != -1) + { + return false; + } + else if(email.indexOf("ú") != -1) + { + return false; + } + else if(email.indexOf("û") != -1) + { + return false; + } + else if(email.indexOf("ç") != -1) + { + return false; + } + else if(email.indexOf("À") != -1) + { + return false; + } + else if(email.indexOf("Á") != -1) + { + return false; + } + else if(email.indexOf("Ã") != -1) + { + return false; + } + else if(email.indexOf("Â") != -1) + { + return false; + } + else if(email.indexOf("È") != -1) + { + return false; + } + else if(email.indexOf("É") != -1) + { + return false; + } + else if(email.indexOf("Ê") != -1) + { + return false; + } + else if(email.indexOf("Ì") != -1) + { + return false; + } + else if(email.indexOf("Í") != -1) + { + return false; + } + else if(email.indexOf("Ò") != -1) + { + return false; + } + else if(email.indexOf("Ó") != -1) + { + return false; + } + else if(email.indexOf("Ô") != -1) + { + return false; + } + else if(email.indexOf("Õ") != -1) + { + return false; + } + else if(email.indexOf("Ù") != -1) + { + return false; + } + else if(email.indexOf("Ú") != -1) + { + return false; + } + else if(email.indexOf("Û") != -1) + { + return false; + } + else if(email.indexOf("Ç") != -1) + { + return false; + } + return true; + } + + public static String dateToYYYYMMDD(Date ddate) + { + Calendar cal = new GregorianCalendar(); + cal.setTime(ddate); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); + String date_str = dateFormat.format(cal.getTime()); + return date_str; + } + + public static String timeToHHMM(String ttime) throws Exception + { + SimpleDateFormat formatter = new SimpleDateFormat("HH:mm"); + //String s = formatter.format(date); + Date date = (Date)formatter.parse(ttime); + return formatter.format(date); + } + + + public static void doLogin( ExternalContext ec, Utilizador u ) + { + if ( u != null ) + { + Singleton.setInstance( Singleton.USERNAME, u.getLogin() ); + + HttpSession session = ( HttpSession ) ec.getSession( true ); + ServletContext thisContext = session.getServletContext().getContext( "/AnaliseAcidentesTrabalho" ); + + Map< String, Object > mapData = new HashMap< String, Object >(); + mapData.put( "sessionID", session.getId() ); + mapData.put( "userID", u.getId() ); + mapData.put( "session", session ); + + thisContext.setAttribute( session.getId(), mapData ); + } + else + { + ErrorLogger.logException( new Exception( "Utils.doLogin() : Utilizador is null !" ) ); + } + } + + public static void doLogout( ExternalContext ec, boolean redirect ) + { + Singleton.setInstance( Singleton.USERNAME, null ); + + HttpSession session = ( HttpSession ) ec.getSession( true ); + String sessionID = session.getId(); + + ServletContext aatContext = session.getServletContext().getContext( "/AnaliseAcidentesTrabalho" ); + ServletContext paContext = aatContext.getContext( "/PlanosActuacao" ); + + aatContext.removeAttribute( sessionID ); + + if ( paContext != null ) + { + Map< String, Object > mapData = ( Map< String, Object > ) paContext.getAttribute( sessionID ); + if ( mapData != null ) + { + HttpSession paSession = ( HttpSession ) mapData.get( "session" ); + paSession.invalidate(); + } + paContext.removeAttribute( sessionID ); + } + + try + { + session.invalidate(); + } + catch ( IllegalStateException e ) + { +// ErrorLogger.logException( e ); + System.out.println( "Session already invalidated." ); + } + + if ( redirect ) + { + try + { + ec.redirect( "Login.jsp" ); + } + catch ( IOException ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + public static Integer getDefaultSelectedYear() + { + Integer result = null; + + java.util.Calendar calendar = java.util.Calendar.getInstance(); + calendar.setTime( new Date() ); + result = calendar.get( java.util.Calendar.YEAR ); + + return result; + } + + public static Option[] getYearDropValues() + { + Calendar calendar = Calendar.getInstance(); + calendar.setTime( new Date() ); + Integer currentYear = calendar.get( Calendar.YEAR ); + + Option[] opts = null; + try + { + int start = 0; + List< Integer > anosList = AnalisesDataProvider.getInstance().getDistinctYears( null ); + if ( anosList.contains( currentYear ) ) + { + opts = new Option[ anosList.size() ]; + } + else + { + opts = new Option[ anosList.size() + 1 ]; + opts[ start++ ] = new Option( currentYear, currentYear.toString() ); + } + Iterator< Integer > it = anosList.iterator(); + for ( ; it.hasNext(); start++ ) + { + Integer ano = it.next(); + opts[ start ] = new Option( ano, ano.toString() ); + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + return opts; + } + + public static void fillEstabelecimentos( DropDown ... drops ) + { + try + { + Option[] estabelecimentos = EstatisticasDataProvider.getInstance().getEstabelecimentos(); + if ( estabelecimentos != null ) + { + for ( DropDown drop : drops ) + { + drop.setItems( estabelecimentos ); + } + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + } + + public static Integer getSelectedID( DropDown drop ) + { + Integer selectedID = null; + if ( drop.getSelected() != null ) + { + String value = ( String ) drop.getSelected(); + if ( value != null ) + { + try { selectedID = Integer.parseInt( value ); } + catch ( Exception e ) { } + } + } + return selectedID; + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/web/META-INF/MANIFEST.MF b/trunk/AnaliseAcidentesTrabalho/web/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/activation.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/activation.jar new file mode 100644 index 00000000..589b6749 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/activation.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/appbase.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/appbase.jar new file mode 100644 index 00000000..cfca6d0a Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/appbase.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/ashwood-2.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/ashwood-2.0.jar new file mode 100644 index 00000000..55fcc9b1 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/ashwood-2.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/avalon-framework-4.2.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/avalon-framework-4.2.0.jar new file mode 100644 index 00000000..b1aa6d7c Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/avalon-framework-4.2.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/batik-all-1.7.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/batik-all-1.7.jar new file mode 100644 index 00000000..58932858 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/batik-all-1.7.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils-1.8.3.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils-1.8.3.jar new file mode 100644 index 00000000..218510bc Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils-1.8.3.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils.jar new file mode 100644 index 00000000..98bfbb7d Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-codec-1.3.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-codec-1.3.jar new file mode 100644 index 00000000..957b6752 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-codec-1.3.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections-3.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections-3.1.jar new file mode 100644 index 00000000..41e230fe Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections-3.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections.jar new file mode 100644 index 00000000..bf8bcd02 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester-1.8.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester-1.8.jar new file mode 100644 index 00000000..1110f0aa Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester-1.8.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester.jar new file mode 100644 index 00000000..3656eb93 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-el-1.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-el-1.0.jar new file mode 100644 index 00000000..608ed796 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-el-1.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-fileupload-1.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-fileupload-1.0.jar new file mode 100644 index 00000000..cf0f5547 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-fileupload-1.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-httpclient-3.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-httpclient-3.1.jar new file mode 100644 index 00000000..7c59774a Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-httpclient-3.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-io-1.4.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-io-1.4.jar new file mode 100644 index 00000000..133dc6cb Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-io-1.4.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-lang-2.4.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-lang-2.4.jar new file mode 100644 index 00000000..532939ec Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-lang-2.4.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging-1.1.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging-1.1.1.jar new file mode 100644 index 00000000..1deef144 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging-1.1.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging.jar new file mode 100644 index 00000000..ef43682b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-validator-1.3.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-validator-1.3.1.jar new file mode 100644 index 00000000..55b12b1a Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-validator-1.3.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-vfs-1.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-vfs-1.0.jar new file mode 100644 index 00000000..7992d21b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-vfs-1.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/dataprovider.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/dataprovider.jar new file mode 100644 index 00000000..a12b68ad Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/dataprovider.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/defaulttheme.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/defaulttheme.jar new file mode 100644 index 00000000..e3c261c5 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/defaulttheme.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/dom4j-1.6.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/dom4j-1.6.1.jar new file mode 100644 index 00000000..c8c4dbb9 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/dom4j-1.6.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/errorhandler.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/errorhandler.jar new file mode 100644 index 00000000..47806032 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/errorhandler.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/evologger.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/evologger.jar new file mode 100644 index 00000000..bf2ef5f2 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/evologger.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/evolute.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/evolute.jar new file mode 100644 index 00000000..d68c41b6 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/evolute.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/fop.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/fop.jar new file mode 100644 index 00000000..3e640f9c Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/fop.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/httpclient-4.0.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/httpclient-4.0.1.jar new file mode 100644 index 00000000..e9c961f1 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/httpclient-4.0.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/iText-2.0.8.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/iText-2.0.8.jar new file mode 100644 index 00000000..aaf6296a Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/iText-2.0.8.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jai_imageio.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jai_imageio.jar new file mode 100644 index 00000000..359551eb Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jai_imageio.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jakarta-oro-2.0.8.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jakarta-oro-2.0.8.jar new file mode 100644 index 00000000..23488d26 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jakarta-oro-2.0.8.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jdbcappender.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jdbcappender.jar new file mode 100644 index 00000000..fe9d3e67 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jdbcappender.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jdom.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jdom.jar new file mode 100644 index 00000000..288e64cb Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jdom.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsf-api.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsf-api.jar new file mode 100644 index 00000000..b1a01839 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsf-api.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsf-impl.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsf-impl.jar new file mode 100644 index 00000000..17b01526 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsf-impl.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsfcl.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsfcl.jar new file mode 100644 index 00000000..524dc8af Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jsfcl.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jstl.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jstl.jar new file mode 100644 index 00000000..0e64b5fb Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/jstl.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/log4j-1.2.15.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/log4j-1.2.15.jar new file mode 100644 index 00000000..c930a6ab Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/log4j-1.2.15.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/mail.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/mail.jar new file mode 100644 index 00000000..e6f70832 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/mail.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.beans-3.0.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.beans-3.0.0.jar new file mode 100644 index 00000000..37b9abe7 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.beans-3.0.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.context-3.0.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.context-3.0.0.jar new file mode 100644 index 00000000..7869adbb Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.context-3.0.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.core-3.0.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.core-3.0.0.jar new file mode 100644 index 00000000..8f0134ee Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/org.springframework.core-3.0.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/poi-3.5-beta6-20090622.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/poi-3.5-beta6-20090622.jar new file mode 100644 index 00000000..64182229 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/poi-3.5-beta6-20090622.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/poi-ooxml-3.5-beta6-20090622.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/poi-ooxml-3.5-beta6-20090622.jar new file mode 100644 index 00000000..206d9920 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/poi-ooxml-3.5-beta6-20090622.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar new file mode 100644 index 00000000..63e54165 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/rowset-1.0.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/rowset-1.0.1.jar new file mode 100644 index 00000000..079d4a63 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/rowset-1.0.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/serializer-2.7.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/serializer-2.7.0.jar new file mode 100644 index 00000000..7cd80696 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/serializer-2.7.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/shst.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/shst.jar new file mode 100644 index 00000000..5905b22f Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/shst.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-core-1.5.9.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-core-1.5.9.jar new file mode 100644 index 00000000..8c944048 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-core-1.5.9.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-core-tiger-1.5.9.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-core-tiger-1.5.9.jar new file mode 100644 index 00000000..8dabf02e Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-core-tiger-1.5.9.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-support-1.5.9.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-support-1.5.9.jar new file mode 100644 index 00000000..82796229 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-ws-support-1.5.9.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-xml-1.5.9.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-xml-1.5.9.jar new file mode 100644 index 00000000..10a8905b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/spring-xml-1.5.9.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/sqlx.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/sqlx.jar new file mode 100644 index 00000000..2b341bb3 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/sqlx.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/standard.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/standard.jar new file mode 100644 index 00000000..ab559dd1 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/standard.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/tomahawk-1.1.10.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/tomahawk-1.1.10.jar new file mode 100644 index 00000000..36ef09f5 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/tomahawk-1.1.10.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/truelicense.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/truelicense.jar new file mode 100644 index 00000000..8c56bd12 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/truelicense.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/webui.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/webui.jar new file mode 100644 index 00000000..5c509527 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/webui.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xalan-2.7.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xalan-2.7.0.jar new file mode 100644 index 00000000..979ee761 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xalan-2.7.0.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xercesImpl-2.7.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xercesImpl-2.7.1.jar new file mode 100644 index 00000000..eac75ae8 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xercesImpl-2.7.1.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xml-apis-1.3.04.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xml-apis-1.3.04.jar new file mode 100644 index 00000000..d42c0ea6 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xml-apis-1.3.04.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xml-apis-ext-1.3.04.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xml-apis-ext-1.3.04.jar new file mode 100644 index 00000000..a7869d68 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xml-apis-ext-1.3.04.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xmlParserAPIs-2.0.2.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xmlParserAPIs-2.0.2.jar new file mode 100644 index 00000000..eae78043 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xmlParserAPIs-2.0.2.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xmlgraphics-commons-1.3.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xmlgraphics-commons-1.3.1.jar new file mode 100644 index 00000000..81a485dc Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/xmlgraphics-commons-1.3.1.jar differ