2 Replies Latest reply on Feb 17, 2009 2:46 PM by safa said

    Seam ans mapping from database

    safa said Newbie

      I want to understand  samething about seam:
      when i map my tables from the database, the associations betwwen 2 tables who have only fraign keys are not mapped, but if they  have an extra attribut it will be mapped!!
      Am I doing samething wrong in my project, Or is it normal that this type of associations are not mapped???
      If is normal, how could I acced to this association???
      thx

        • 1. Re: Seam ans mapping from database
          Gregory Nikle Apprentice

          can u show you source code?

          • 2. Re: Seam ans mapping from database
            safa said Newbie

            there is no source code, I only want to know if it is normal that my association are not mapped from the database to java classes??


            Maybe you would see my component.xml:



            <?xml version="1.0" encoding="UTF-8"?>
            <components xmlns="http://jboss.com/products/seam/components"
                        xmlns:core="http://jboss.com/products/seam/core"
                        xmlns:persistence="http://jboss.com/products/seam/persistence"
                        xmlns:drools="http://jboss.com/products/seam/drools"
                        xmlns:bpm="http://jboss.com/products/seam/bpm"
                        xmlns:security="http://jboss.com/products/seam/security"
                        xmlns:mail="http://jboss.com/products/seam/mail"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation=
                            "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd 
                             http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd 
                             http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
                             http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
                             http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                             http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
                             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
            
               <core:init debug="true" jndi-pattern="@jndiPattern@"/>
                 
               <core:manager concurrent-request-timeout="500" 
                             conversation-timeout="120000" 
                             conversation-id-parameter="cid"
                             parent-conversation-id-parameter="pid"/>
            
            
            
            
               <persistence:managed-persistence-context name="entityManager" 
                                                 auto-create="true"
                                      entity-manager-factory="#{SigpnEntityManagerFactory}"/>
            
               <persistence:entity-manager-factory name="SigpnEntityManagerFactory" 
                                  persistence-unit-name="Sigpn"/>
               
               <drools:rule-base name="securityRules">
                   <drools:rule-files><value>/security.drl</value></drools:rule-files>
               </drools:rule-base>
            
               <security:identity authenticate-method="#{authenticator.authenticate}"
                                       security-rules="#{securityRules}"
                                          remember-me="true"/>
                                          
               <event type="org.jboss.seam.security.notLoggedIn">
                   <action execute="#{redirect.captureCurrentView}"/>
               </event>
               <event type="org.jboss.seam.security.loginSuccessful">
                   <action execute="#{redirect.returnToCapturedView}"/>
               </event>
               
               < mail:mail-session host="localhost" port="2525" username="test" password="test" >
                    
            
                  
            </components>



            and my hibernate-console.properties



            hibernate.connection.password=admin
            hibernate.connection.username=admin
            hibernate.connection.driver_class=org.postgresql.Driver
            hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
            hibernate.connection.url=jdbc:postgresql:sigpn2
            
            hibernate.connection.provider_class=org.hibernate.connection.DriverManagerConnectionProvider
            hibernate.datasource=
            hibernate.transaction.manager_lookup_class=