Update of 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11407/src/test/java/org/xdoclet/plugin/hibernate/pojo

Modified Files:
        ComponentMapping.hbm.xml ComponentMapping.java 
        Relation.hbm.xml SetMapping.java Simple.hbm.xml Simple.java 
Added Files:
        CompositeMapping.hbm.xml CompositeMapping.java 
Log Message:
(XDP-54) Implemented 'composite-element' support. Also added @hibernate.parent 
support

Index: Simple.hbm.xml
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo/Simple.hbm.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Simple.hbm.xml      26 Apr 2005 07:00:17 -0000      1.13
--- Simple.hbm.xml      13 May 2005 07:50:46 -0000      1.14
***************
*** 8,12 ****
          table="simple-table" batch-size="239" dynamic-insert="false" 
name="org.xdoclet.plugin.hibernate.pojo.Simple" mutable="false">
          <meta inherit="true" attribute="attribute">blurge</meta>
!         <id unsaved-value="yahoo" name="id" type="long">
              <meta inherit="true" attribute="attribute">blurge</meta>
              <column name="blurge" sql-type="foobar"/>
--- 8,12 ----
          table="simple-table" batch-size="239" dynamic-insert="false" 
name="org.xdoclet.plugin.hibernate.pojo.Simple" mutable="false">
          <meta inherit="true" attribute="attribute">blurge</meta>
!         <id unsaved-value="yahoo" name="id">
              <meta inherit="true" attribute="attribute">blurge</meta>
              <column name="blurge" sql-type="foobar"/>

Index: Relation.hbm.xml
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo/Relation.hbm.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Relation.hbm.xml    6 May 2005 07:37:26 -0000       1.12
--- Relation.hbm.xml    13 May 2005 07:50:46 -0000      1.13
***************
*** 5,9 ****
  <hibernate-mapping default-cascade="none" auto-import="true">
      <class name="org.xdoclet.plugin.hibernate.pojo.Relation">
!         <id name="id" type="long" unsaved-value="blurge">
              <generator class="native"/>
          </id>
--- 5,9 ----
  <hibernate-mapping default-cascade="none" auto-import="true">
      <class name="org.xdoclet.plugin.hibernate.pojo.Relation">
!         <id name="id" unsaved-value="blurge">
              <generator class="native"/>
          </id>

--- NEW FILE: CompositeMapping.java ---
/*
 * Copyright (c) 2003
 * XDoclet Team
 * All rights reserved.
 */
package org.xdoclet.plugin.hibernate.pojo;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Anatol Pomozov
 * @hibernate.class table="`CompositeMapping`"
 */
public class CompositeMapping {
    /**
     * @hibernate.list fetch="join"
     * @hibernate.key column="userName"
     * @hibernate.list-index column="displayOrder" base="1"
     * @hibernate.composite-element 
class="org.xdoclet.plugin.hibernate.pojo.CompositeMapping$Email"
     */
    private List emailAddresses;

    /**
     * @hibernate.list
     * @hibernate.key column="userName"
     * @hibernate.list-index column="displayOrder" base="1"
     * @hibernate.composite-element 
class="org.xdoclet.plugin.hibernate.pojo.CompositeMapping$Permission" 
node="@test"
     */
    private List permissions;

    /**
     * @hibernate.id generator-class="native"
     */
    private Long userName;
    /**
     * @hibernate.map
     * @hibernate.key column="userName"
     * @hibernate.map-key column="attributeName" type="string"
     * @hibernate.element column="attributeValue" type="serializable" 
not-null="true"
     */
    private Map sessionData;

    public class Email {
        /**
         * @hibernate.property
         */
        private String address;
    }

    /**
     * @hibernate.meta attribute="meta" inherit="false"
     */
    public class Permission {
        /**
         * @hibernate.parent
         */
        private Date parent;

        /**
         * @hibernate.property column="permissionType"
         */
        private String type;
    }
}
Index: ComponentMapping.hbm.xml
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo/ComponentMapping.hbm.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ComponentMapping.hbm.xml    7 May 2005 18:22:21 -0000       1.6
--- ComponentMapping.hbm.xml    13 May 2005 07:50:46 -0000      1.7
***************
*** 3,12 ****
  <hibernate-mapping default-cascade="none" auto-import="true">
      <class name="org.xdoclet.plugin.hibernate.pojo.ComponentMapping" 
table="component-table">
          <component name="component" insert="true" class="foo.bar.Baz" 
update="false">
              <meta inherit="true" attribute="blurge">bang</meta>
!             <parent name="blam"/>
              <property name="foo" access="field" column="col"/>
          </component>
          <component name="prefixedComponent" class="foo.bar.Baz">
              <property name="foo" column="prfx_col" access="field"/>
          </component>
--- 3,16 ----
  <hibernate-mapping default-cascade="none" auto-import="true">
      <class name="org.xdoclet.plugin.hibernate.pojo.ComponentMapping" 
table="component-table">
+         <id access="field" name="id">
+           <generator class="native"/>
+         </id>
          <component name="component" insert="true" class="foo.bar.Baz" 
update="false">
              <meta inherit="true" attribute="blurge">bang</meta>
!             <parent name="xyz"/>
              <property name="foo" access="field" column="col"/>
          </component>
          <component name="prefixedComponent" class="foo.bar.Baz">
+             <parent name="xyz"/>
              <property name="foo" column="prfx_col" access="field"/>
          </component>
***************
*** 17,20 ****
--- 21,25 ----
          </component>
          <component access="field" name="field">
+             <parent name="xyz"/>
              <property name="foo" access="field" column="col"/>
          </component>

Index: Simple.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo/Simple.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Simple.java 11 May 2005 06:55:42 -0000      1.16
--- Simple.java 13 May 2005 07:50:46 -0000      1.17
***************
*** 20,23 ****
--- 20,24 ----
      private Object _fullBlown;
      private String _name;
+ 
      /**
       * property defined on field level

Index: ComponentMapping.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo/ComponentMapping.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ComponentMapping.java       11 May 2005 06:55:42 -0000      1.7
--- ComponentMapping.java       13 May 2005 07:50:46 -0000      1.8
***************
*** 16,19 ****
--- 16,20 ----
       */
      AnotherClass classComponent;
+ 
      /**
       * @hibernate.component
***************
*** 22,26 ****
  
      /**
!      * @hibernate.component class="foo.bar.Baz" update="false" insert="true" 
parent="blam"
       * @hibernate.meta attribute="blurge" value="bang"
       */
--- 23,32 ----
  
      /**
!      * @hibernate.id generator-class="native"
!      */
!     private Long id;
! 
!     /**
!      * @hibernate.component class="foo.bar.Baz" update="false" insert="true"
       * @hibernate.meta attribute="blurge" value="bang"
       */
***************
*** 46,49 ****
--- 52,60 ----
      public class Simple {
          /**
+          * @hibernate.parent
+          */
+         ComponentMapping xyz;
+ 
+         /**
           * @hibernate.property column="col"
           */

--- NEW FILE: CompositeMapping.hbm.xml ---
<?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>
    <class name="org.xdoclet.plugin.hibernate.pojo.CompositeMapping" 
table="`CompositeMapping`">
        <id access="field" name="userName">
            <generator class="native"/>
        </id>
        <list name="emailAddresses" fetch="join">
            <key column="userName"/>
            <list-index column="displayOrder" base="1"/>
            <composite-element 
class="org.xdoclet.plugin.hibernate.pojo.CompositeMapping$Email">
                <property name="address" access="field"/>
            </composite-element>
        </list>
        <list name="permissions">
            <key column="userName"/>
            <list-index column="displayOrder" base="1"/>
            <composite-element 
class="org.xdoclet.plugin.hibernate.pojo.CompositeMapping$Permission" 
node="@test">
                <meta attribute="meta" inherit="false"/>
                <parent name="parent"/>
                <property name="type" column="permissionType" access="field"/>
            </composite-element>
        </list>
        <map name="sessionData">
            <key column="userName"/>
            <map-key column="attributeName" type="string"/>
            <element column="attributeValue" type="serializable" 
not-null="true"/>
        </map>
    </class>
</hibernate-mapping>

Index: SetMapping.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/test/java/org/xdoclet/plugin/hibernate/pojo/SetMapping.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** SetMapping.java     11 May 2005 06:55:42 -0000      1.10
--- SetMapping.java     13 May 2005 07:50:46 -0000      1.11
***************
*** 15,18 ****
--- 15,19 ----
  public class SetMapping {
      private Set _set;
+ 
      /**
       * test one-to-many set using multiple key-column



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to