Galera,
To desenvolvendo uma Aplicação utilizando:
-> JSF implementação da SUN
-> Spring 1.2.3
-> Hibernate 3
-> Java 1.4
-> Tomcat 5.0.28
Na estrutura da minha aplicação tenho uma Classe de Socios que se relaciona com outras classes como profissão, setor, funcao, etc.
Tenho dois graves problemas:
-
Quando vou carregar uma página com uma h:dataTable(recebendo uma lista de sócios), ele fica dando select feito louco, como se tivesse carregando os objetos relacionados(setor, profissao…, etc.)
-
Quando vou para a página de editar, selecionando um Sócio na h:dataTable ele fica que nem louco carregando todas as classes relacionadas até que estoura a memória heap.
Ob. : Putz já tentei de tudo e não consegui resolver.
Arquivos de configuração do Spring(applicationContext-hibernate.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>${jdbc.driverClassName}</value></property>
<property name="url"><value>${jdbc.url}</value></property>
<property name="username"><value>${jdbc.username}</value></property>
<property name="password"><value>${jdbc.password}</value></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource"/></property>
<property name="mappingResources">
<list>
<value>br/com/simcaweb/model/mapping/Regime.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Funcao.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/GrupoUsuario.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Instancia.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Profissao.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Secretaria.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Setor.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Socio.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/SocioHistorico.hbm.xml</value>
<value>br/com/simcaweb/model/mapping/Usuario.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.query.substitutions">true 'S', false 'N'</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="regimeDAO" class="br.com.simcaweb.dao.hibernate.RegimeDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="funcaoDAO" class="br.com.simcaweb.dao.hibernate.FuncaoDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="grupoUsuarioDAO" class="br.com.simcaweb.dao.hibernate.GrupoUsuarioDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="instanciaDAO" class="br.com.simcaweb.dao.hibernate.InstanciaDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="profissaoDAO" class="br.com.simcaweb.dao.hibernate.ProfissaoDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="secretariaDAO" class="br.com.simcaweb.dao.hibernate.SecretariaDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="setorDAO" class="br.com.simcaweb.dao.hibernate.SetorDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="socioDAO" class="br.com.simcaweb.dao.hibernate.SocioDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="socioHistoricoDAO" class="br.com.simcaweb.dao.hibernate.SocioHistoricoDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="usuarioDAO" class="br.com.simcaweb.dao.hibernate.UsuarioDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
</beans>
Arquivo de Configuração do Spring (applicationContext.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:jdbc.properties</value>
</property>
</bean>
<!-- Transaction template for Managers, from:
http://blog.exis.com/colin/archives/2004/07/31/concise-transaction-definitions-spring-11/ -->
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="regimeManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.RegimeManagerImpl">
<property name="regimeDAO"><ref bean="regimeDAO"/></property>
</bean>
</property>
</bean>
<bean id="funcaoManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.FuncaoManagerImpl">
<property name="funcaoDAO"><ref bean="funcaoDAO"/></property>
</bean>
</property>
</bean>
<bean id="grupoUsuarioManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.GrupoUsuarioManagerImpl">
<property name="grupoUsuarioDAO"><ref bean="grupoUsuarioDAO"/></property>
</bean>
</property>
</bean>
<bean id="instanciaManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.InstanciaManagerImpl">
<property name="instanciaDAO"><ref bean="instanciaDAO"/></property>
</bean>
</property>
</bean>
<bean id="profissaoManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.ProfissaoManagerImpl">
<property name="profissaoDAO"><ref bean="profissaoDAO"/></property>
</bean>
</property>
</bean>
<bean id="secretariaManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.SecretariaManagerImpl">
<property name="secretariaDAO"><ref bean="secretariaDAO"/></property>
</bean>
</property>
</bean>
<bean id="setorManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.SetorManagerImpl">
<property name="setorDAO"><ref bean="setorDAO"/></property>
</bean>
</property>
</bean>
<bean id="socioManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.SocioManagerImpl">
<property name="socioDAO"><ref bean="socioDAO"/></property>
</bean>
</property>
</bean>
<bean id="socioHistoricoManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.SocioHistoricoManagerImpl">
<property name="socioHistoricoDAO"><ref bean="socioHistoricoDAO"/></property>
</bean>
</property>
</bean>
<bean id="usuarioManager" parent="txProxyTemplate">
<property name="target">
<bean class="br.com.simcaweb.service.impl.UsuarioManagerImpl">
<property name="usuarioDAO"><ref bean="usuarioDAO"/></property>
</bean>
</property>
</bean>
</beans>
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>simcaweb</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<!-- Define the basename for a resource bundle for I18N -->
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>messages</param-value>
</context-param>
<!-- Multiple Config Files
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-navigation.xml</param-value>
</context-param>
-->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<filter>
<filter-name>filtroSeguranca</filter-name>
<filter-class>br.com.simcaweb.web.FiltroSeguranca</filter-class>
</filter>
<filter>
<filter-name>messageFilter</filter-name>
<filter-class>br.com.simcaweb.web.MessageFilter</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter>
<filter-name>HibernateFilter</filter-name>
<!--<filter-class>br.com.simcaweb.web.filter.OpenSessionInViewFilter</filter-class>-->
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>filtroSeguranca</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>messageFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>HibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
</web-app>
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-facesconfig_1_2.xsd"
version="1.2">
<!-- Spring VariableResolver for JSF -->
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<locale-config>
<default-locale>pt</default-locale>
<supported-locale>pt</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<message-bundle>messages</message-bundle>
</application>
<!-- Navigation Schema -->
<navigation-rule>
<description>Pagina de Login no Sistema</description>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>loginOk</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>loginFail</from-outcome>
<to-view-id>/login.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Funcoes</description>
<from-view-id>/funcaoList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/funcaoForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/funcaoForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Funcoes</description>
<from-view-id>/funcaoForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/funcaoList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/funcaoList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/funcaoList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Lista de Grupos de Usuarios</description>
<from-view-id>/grupoUsuarioList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/grupoUsuarioForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/grupoUsuarioForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Formulario de Grupos de Usuarios</description>
<from-view-id>/grupoUsuarioForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/grupoUsuarioList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/grupoUsuarioList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/grupoUsuarioList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Usuarios</description>
<from-view-id>/usuarioList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/usuarioForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/usuarioForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Usuarios</description>
<from-view-id>/usuarioForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/usuarioList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/usuarioList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/usuarioList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Lista de Instancias</description>
<from-view-id>/instanciaList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/instanciaForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/instanciaForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Formulario de Instancias</description>
<from-view-id>/instanciaForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/instanciaList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/instanciaList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/instanciaList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Profissoes</description>
<from-view-id>/profissaoList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/profissaoForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/profissaoForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Profissoes</description>
<from-view-id>/profissaoForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/profissaoList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/profissaoList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/profissaoList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Secretarias</description>
<from-view-id>/secretariaList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/secretariaForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/secretariaForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Secretarias</description>
<from-view-id>/secretariaForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/secretariaList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/secretariaList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/secretariaList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Setores</description>
<from-view-id>/setorList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/setorForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/setorForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Setores</description>
<from-view-id>/setorForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/setorList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/setorList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/setorList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Regimes</description>
<from-view-id>/regimeList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/regimeForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/regimeForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Regimes</description>
<from-view-id>/regimeForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/regimeList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/regimeList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/regimeList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Lista de Socios</description>
<from-view-id>/socioList.jsp</from-view-id>
<navigation-case>
<from-outcome>add</from-outcome>
<to-view-id>/socioForm.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/socioForm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Pagina de Formulario de Socios</description>
<from-view-id>/socioForm.jsp</from-view-id>
<navigation-case>
<from-outcome>cancel</from-outcome>
<to-view-id>/socioList.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/socioList.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>list</from-outcome>
<to-view-id>/socioList.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
<!-- Beans -->
<managed-bean>
<description>BackingBean da pagina da Lista de Usuarios</description>
<managed-bean-name>usuarioList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.UsuarioList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>usuarioManager</property-name>
<value>#{usuarioManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Usuarios</description>
<managed-bean-name>usuarioForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.UsuarioForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>usuarioManager</property-name>
<value>#{usuarioManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Lista de Funcoes</description>
<managed-bean-name>funcaoList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.FuncaoList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>funcaoManager</property-name>
<value>#{funcaoManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Funcoes</description>
<managed-bean-name>funcaoForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.FuncaoForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>funcaoManager</property-name>
<value>#{funcaoManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>grupoUsuarioList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.GrupoUsuarioList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>grupoUsuarioManager</property-name>
<value>#{grupoUsuarioManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>grupoUsuarioForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.GrupoUsuarioForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>grupoUsuarioManager</property-name>
<value>#{grupoUsuarioManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackinBean da Lista de Instâncias</description>
<managed-bean-name>instanciaList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.InstanciaList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>instanciaManager</property-name>
<value>#{instanciaManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>instanciaForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.InstanciaForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>instanciaManager</property-name>
<value>#{instanciaManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Lista de Profissoes</description>
<managed-bean-name>profissaoList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.ProfissaoList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>profissaoManager</property-name>
<value>#{profissaoManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Profissoes</description>
<managed-bean-name>profissaoForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.ProfissaoForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>profissaoManager</property-name>
<value>#{profissaoManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Lista de Secretarias</description>
<managed-bean-name>secretariaList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.SecretariaList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>secretariaManager</property-name>
<value>#{secretariaManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Secretarias</description>
<managed-bean-name>secretariaForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.SecretariaForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>secretariaManager</property-name>
<value>#{secretariaManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Lista de Setores</description>
<managed-bean-name>setorList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.SetorList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>setorManager</property-name>
<value>#{setorManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Setores</description>
<managed-bean-name>setorForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.SetorForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>setorManager</property-name>
<value>#{setorManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Lista de Regimes</description>
<managed-bean-name>regimeList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.RegimeList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>regimeManager</property-name>
<value>#{regimeManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Regimes</description>
<managed-bean-name>regimeForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.RegimeForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>regimeManager</property-name>
<value>#{regimeManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Lista de Socios</description>
<managed-bean-name>socioList</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.SocioList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>valorPesquisado</property-name>
<value>#{param.valorPesquisado}</value>
</managed-property>
<managed-property>
<property-name>criterioDePesquisa</property-name>
<value>#{param.criterioDePesquisa}</value>
</managed-property>
<managed-property>
<property-name>rowsPerPage</property-name>
<value>5</value>
</managed-property>
<managed-property>
<property-name>socioManager</property-name>
<value>#{socioManager}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>BackingBean da pagina da Formulario de Socio</description>
<managed-bean-name>socioForm</managed-bean-name>
<managed-bean-class>br.com.simcaweb.web.SocioForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>socioManager</property-name>
<value>#{socioManager}</value>
</managed-property>
</managed-bean>
</faces-config>
HBM de Sócios
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping default-lazy="true">
<class name="br.com.simcaweb.model.pojo.Socio" table="public.socios">
<id name="id" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">funcoes_seq</param>
</generator>
</id>
<property name="nome" type="java.lang.String" not-null="true"/>
<property name="matricula" type="java.lang.String"/>
<property name="sexo" type="java.lang.String"/>
<property name="formaTratamento" type="java.lang.String" column="formatratamento"/>
<property name="nascimento" type="java.sql.Date"/>
<property name="email" type="java.lang.String"/>
<property name="recebeEmail" type="java.lang.String" column="recebeemailsn"/>
<property name="dataFiliacao" type="java.sql.Timestamp" column="datafiliacao"/>
<property name="dataRecebimento" type="java.sql.Timestamp" column="datarecebimento"/>
<property name="ativo" type="java.lang.String" column="ativosn"/>
<property name="licenca" type="java.lang.String" column="licencasn"/>
<property name="ipe" type="java.lang.String" column="ipesn"/>
<property name="dataCadastro" type="java.sql.Timestamp" column="datacadastro"/>
<property name="dataAtualizacao" type="java.sql.Timestamp" column="dataatualizacao"/>
<property name="dataDesativado" type="java.sql.Timestamp" column="datadesativado"/>
<property name="caminhoFoto" type="java.lang.String" column="caminhofoto"/>
<property name="cargaHoraria" type="java.lang.String" column="cargahoraria"/>
<property name="endereco" type="java.lang.String"/>
<property name="cidade" type="java.lang.String"/>
<property name="uf" type="java.lang.String"/>
<property name="cep" type="java.lang.String"/>
<property name="fone" type="java.lang.String"/>
<property name="celular" type="java.lang.String"/>
<property name="obs" type="java.lang.String"/>
<!-- Associations -->
<!-- bi-directional many-to-one association to Instancia -->
<many-to-one
name="instancia"
class="br.com.simcaweb.model.pojo.Instancia"
not-null="true"
not-found="ignore"
>
<column name="instancia" />
</many-to-one>
<!-- bi-directional many-to-one association to Setore -->
<many-to-one
name="setor"
class="br.com.simcaweb.model.pojo.Setor"
not-null="true"
not-found="ignore"
>
<column name="setor" />
</many-to-one>
<!-- bi-directional many-to-one association to Funcoe -->
<many-to-one
name="funcao"
class="br.com.simcaweb.model.pojo.Funcao"
not-null="true"
not-found="ignore"
>
<column name="funcao" />
</many-to-one>
<!-- bi-directional many-to-one association to Regime -->
<many-to-one
name="regime"
class="br.com.simcaweb.model.pojo.Regime"
not-null="true"
not-found="ignore"
>
<column name="regime" />
</many-to-one>
<!-- bi-directional many-to-one association to Secretaria -->
<many-to-one
name="secretaria"
class="br.com.simcaweb.model.pojo.Secretaria"
not-null="true"
not-found="ignore"
>
<column name="secretaria" />
</many-to-one>
<!-- bi-directional many-to-one association to Profissoe -->
<many-to-one
name="profissao"
class="br.com.simcaweb.model.pojo.Profissao"
not-null="true"
not-found="ignore"
>
<column name="profissao" />
</many-to-one>
</class>
</hibernate-mapping>
HBM de Setor
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="br.com.simcaweb.model.pojo" default-lazy="true">
<class name="Setor" table="public.setores">
<id name="id" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">setores_seq</param>
</generator>
</id>
<property name="descricao" type="java.lang.String" not-null="true"/>
<!-- Associations -->
<!-- bi-directional one-to-many association to Socio -->
<bag
name="socios"
inverse="true"
cascade="all"
>
<key>
<column name="setor" />
</key>
<one-to-many
class="Socio"
/>
</bag>
</class>
</hibernate-mapping>