At some point my HBM files (generated via Xdoclet) could no longer generate a schema. I don't know exactly when because SchemaExport wasn't causing an ant failure when it failed to reconstruct the tables and my focus was defining several new tables. (These tables are for a related project that has only modest intersection with the existing schema.)

I haven't changed hibernate, xdoclet or the build process, or a number of the files which now cause problems. Some of the errors, "unknown type" (or something like that) were eliminated by replacing 'type="string"' with 'type="java.lang.String"' and 'type="long"' with 'type="java.lang.Long"'.

Has anyone else seen this type of behavior or know of a workaround?



The specific error messages I'm getting on one representative file is:

[java] (cfg.Configuration 153 ) Mapping file: /home/bgiles/work/focus/build/ejb/gen/com/energywindow/persistence/Company.hbm.xml
[java] at net.sf.hibernate.cfg.Binder.bindCollectionSecondPass(Binder.java:1044)
[java] at net.sf.hibernate.cfg.Binder.bindSetSecondPass(Binder.java:922)
[java] (cfg.Binder 178 ) Mapping class: com.energywindow.persistence.Company -> companies
[java] at net.sf.hibernate.cfg.Binder$SetSecondPass.secondPass(Binder.java:1186)
[java] at net.sf.hibernate.cfg.Binder$SecondPass.doSecondPass(Binder.java:1134)
[java] (cfg.Binder 456 ) Mapping collection: com.energywindow.persistence.Company.holdingCompany -> holding_companies
[java] at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:497)
[java] (cfg.Binder 456 ) Mapping collection: com.energywindow.persistence.Company.operatingCompanies -> holding_companies
[java] at net.sf.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:352)
[java] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:51)


and the hbm file itself is attached.
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd";>

<hibernate-mapping>
    <class
        name="com.energywindow.persistence.Company"
        table="companies"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="id"
            type="java.lang.Long"
            unsaved-value="null"
        >
            <generator class="sequence">
            </generator>
        </id>

        <property
            name="name"
            type="java.lang.String"
            update="true"
            insert="true"
            column="name"
            not-null="true"
            unique="false"
        />

        <property
            name="address"
            type="java.lang.String"
            update="true"
            insert="true"
            column="address"
            not-null="false"
            unique="false"
        />

        <property
            name="city"
            type="java.lang.String"
            update="true"
            insert="true"
            column="city"
            length="60"
            not-null="false"
            unique="false"
        />

        <property
            name="state"
            type="java.lang.String"
            update="true"
            insert="true"
            column="state"
            not-null="false"
        />

        <property
            name="zipCode"
            type="java.lang.String"
            update="true"
            insert="true"
            column="postal_code"
            not-null="false"
        />

        <property
            name="country"
            type="java.lang.String"
            update="true"
            insert="true"
            column="country"
            not-null="false"
        />

        <property
            name="phoneNumber"
            type="java.lang.String"
            update="true"
            insert="true"
            column="phone"
            length="120"
            not-null="false"
            unique="false"
        />

        <set
            name="phoneNumbers"
            table="phone_numbers"
            lazy="true"
            inverse="false"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="owner_id"
              />

              <one-to-many
                  class="com.energywindow.persistence.PhoneNumber"
              />
        </set>

        <property
            name="website"
            type="java.lang.String"
            update="true"
            insert="true"
            column="website"
            not-null="false"
            unique="false"
        />

        <property
            name="taxId"
            type="java.lang.String"
            update="true"
            insert="true"
            column="tax_id"
            length="24"
            not-null="false"
            unique="false"
        />

        <property
            name="duns"
            type="java.lang.String"
            update="true"
            insert="true"
            column="duns"
            length="12"
            not-null="false"
            unique="false"
        />

        <property
            name="cik"
            type="java.lang.String"
            update="true"
            insert="true"
            column="cik"
            length="12"
            not-null="false"
            unique="false"
        />

        <property
            name="stockSymbol"
            type="java.lang.String"
            update="true"
            insert="true"
            column="symbol"
            length="8"
            not-null="false"
            unique="false"
        />

        <property
            name="creditRating"
            type="java.lang.String"
            update="true"
            insert="true"
            column="credit_rating"
            length="40"
            not-null="false"
            unique="false"
        />

        <set
            name="holdingCompany"
            table="holding_companies"
            lazy="true"
            inverse="true"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="child_id"
              />

              <element
                  column="parent_id"
                  type="long"
                  not-null="false"
                  unique="false"
              />

        </set>

        <set
            name="operatingCompanies"
            table="holding_companies"
            lazy="true"
            inverse="true"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="parent_id"
              />

              <element
                  column="child_id"
                  type="long"
                  not-null="false"
                  unique="false"
              />

        </set>

        <set
            name="supplierInfo"
            table="supplier_info"
            lazy="true"
            inverse="false"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="company_id"
              />

              <one-to-many
                  class="com.energywindow.persistence.SupplierInfo"
              />
        </set>

        <set
            name="ldcInfo"
            table="ldc_info"
            lazy="true"
            inverse="false"
            cascade="none"
            sort="unsorted"
        >

              <key
                  column="company_id"
              />

              <one-to-many
                  class="com.energywindow.persistence.LdcInfo"
              />
        </set>

        <property
            name="comments"
            type="java.lang.String"
            update="true"
            insert="true"
            column="comments"
            not-null="false"
            unique="false"
        />

    <!-- merged file -->

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-Company.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>

Reply via email to