Hi aslak,

    Yes, i know you hadn't try Jboss...  :-)  

[EMAIL PROTECTED] wrote:
Great news. I've never tried JBoss myself ;-)

  
------>8---------  build.xml ------
        <jboss
           version="3.0"
           xmlencoding="UTF-8"
           destdir="${build.ejb.dir}/META-INF"
           validatexml="false"
           datasource="java:/${name}_DS"
           typemapping="${database.datasource-mapping}"
    

I think typemapping only applies to jaws (deprecated JBoss CMP stuff, 
no?). I think that since you're on JBoss 3.0, you shouldn't need this.
There is a merge point for jbosscmp-jdbc-typemappings.xml. See
http://xdoclet.sourceforge.net/jboss.html
  
I also not deep in CMP...  when i using Jboss 2.4.x...  i writting BMP from my own codding.. (very hard... i mean my finger tip feeling hard... get/set...  ba.la...ba..la...),
now JBOSS turn to 3.0 and support CMP 2.0, right?... i think that time to try CMP....  when i read JBOSS doc... i think i should search a Right Tool [Middlegen!!!] to do those job... :-)

Ok...  back to question.  About typemapping....  i learn from Jboss CMP doc 's example... so i try it....
I think it should some problem in 'jbosscmp-jdbc.xml'....   i am not sure...
I show you what Middlegen generate 'jbosscmp-jdbc.xml' for me... it short...

-------->8--------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">

<jbosscmp-jdbc>
   <defaults>
     <datasource>java:/airline_DS</datasource>
     <datasource-mapping>PostgreSQL 7.2</datasource-mapping>
   </defaults>

   <enterprise-beans>

      <entity>
         <ejb-name>Person</ejb-name>
         <table-name>PERSONS</table-name>

          <!-- merge point: jbosscmp-jdbc-load-{0}.xml -->

      </entity>

      <entity>
         <ejb-name>Reservation</ejb-name>
         <table-name>RESERVATIONS</table-name>

          <!-- merge point: jbosscmp-jdbc-load-{0}.xml -->

      </entity>

      <entity>
         <ejb-name>Flight</ejb-name>
         <table-name>FLIGHTS</table-name>

          <!-- merge point: jbosscmp-jdbc-load-{0}.xml -->

      </entity>

   </enterprise-beans>

<!-- merge point: jbosscmp-jdbc-dvc.xml -->

</jbosscmp-jdbc>
-------->8--------------
The <merge point:> should be something here? missing , right?

------>8---------

And the bad news, i couldn't compile the web... it got following 
error :

    

The struts actions expect the person+flight EJBs to use Integer as PK. 
Middlegen will choose simple classes (java.lang.Integer, 
java.lang.Long, java.lang.String etc.) for PK class when the table's PK 
consists of only one column (in other words when there is no need for a 
compound PK). It's strange that your person+flight EJBs have been 
generated to use custom PK classes since these fall into this category. 
It can be:

a) You're on JDK 1.4 and you have an airline-prefs.xml lying around 
that specifies PersonPK and FlightPK instead of java.lang.Integer

b) There is something strange with how your JDBC driver reports primary 
keys for your tables.

I'd be grateful if you could send me a snapshot of the GUI (make sure 
you delete airline-prefs.xml first) and the generated PersonBean.java
You are right, i am using JDK 1.4.... and i read from the  postgresql's JDBC mailling, someone also report got problem the driver return wrong DB info....

I try delete the airline-prefs.xml, and re-generate as following (problem in JDBC ?, no mapping) :
-------------------------->8----------
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>

<preferences EXTERNAL_XML_VERSION="1.0">
  <root type="user">
    <map />
    <node name="middlegen">
      <map />
      <node name="airline">
        <map />
        <node name="tables">
          <map />
          <node name="FLIGHTS">
            <map />
            <node name="bmp20">
              <map>
                <entry key="base-class-name" value="Flight" />
              </map>
            </node>
            <node name="cmp20">
              <map>
                <entry key="base-class-name" value="Flight" />
              </map>
            </node>
            <node name="jdo">
              <map>
                <entry key="base-class-name" value="Flight" />
              </map>
            </node>
          </node>
          <node name="PERSONS">
            <map />
            <node name="bmp20">
              <map>
                <entry key="base-class-name" value="Person" />
              </map>
            </node>
            <node name="cmp20">
              <map>
                <entry key="base-class-name" value="Person" />
              </map>
            </node>
            <node name="jdo">
              <map>
                <entry key="base-class-name" value="Person" />
              </map>
            </node>
          </node>
          <node name="RESERVATIONS">
            <map />
            <node name="bmp20">
              <map>
                <entry key="base-class-name" value="Reservation" />
              </map>
            </node>
            <node name="cmp20">
              <map>
                <entry key="base-class-name" value="Reservation" />
              </map>
            </node>
            <node name="jdo">
              <map>
                <entry key="base-class-name" value="Reservation" />
              </map>
            </node>
          </node>
        </node>
      </node>
    </node>
  </root>
</preferences>
-------------------------->8----------

May be i try the development version of JDBC and report you again.

Gordon

  

  

Reply via email to