Update of /cvsroot/xdoclet/xdoclet/samples/src/java/test/hibernate30
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17663/samples/src/java/test/hibernate30

Modified Files:
        Product.java Human.java 
Log Message:
XDT-1257: joined-subclass and many subelements aligned with hibernate 3.0 DTD

Index: Product.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/samples/src/java/test/hibernate30/Product.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Product.java        17 May 2005 16:49:10 -0000      1.2
--- Product.java        20 May 2005 15:00:19 -0000      1.3
***************
*** 1 ****
! package test.hibernate30;

import java.math.BigDecimal;

/**
 * @hibernate.class table="PRODUCTS" discriminator-value="null"
 *                  dynamic-update="true"
 * @hibernate.discriminator column="PRODUCT_TYPE" type="string" length="16"
 *                          not-null="false"
 * 
 * @author Administrator
 */
public class Product extends Persistent implements Updateable {
        
        private String description;
        private String code;
        private BigDecimal price;
        private byte[] image;
        private String updateComment;

        /**
         * Constructor for Product.
         */
        public Product() {
                super();
        }

        /**
         * @hibernate.property node="description" access="property" 
         *                     type="string" column="description" length="512"
         *                     precision="5" scale="2" not-null="false" 
         *                     unique="false" update="true" insert="true"
         *                     optimistic-lock="true" formula="xyzzy"
         *                     index="ix-product-description" lazy="true"
         * @hibernate.meta attribute="scope-set" value="protected"
         * @hibernate.meta attribute="scope-get" value="public"
         * @hibernate.column name="description" length="512" precision="5" 
         *                   scale="2" not-null="false"
         *                   unique="false" unique-key="unique-key"
         *                   sql-type="varchar" index="ix-product-description"
         *                   check="sql expression"
         * @hibernate.formula value="formula 1"
         * @hibernate.formula value="formula 2"
         * @hibernate.type name="my.custom.type"
         * @hibernate.param name="param1" value="0"
         * @hibernate.param name="param2" value="text"
         */
        public String getDescription() {
                return description;
        }

        public void setDescription(String name) {
                this.description = name;
        }

        /**
         * @hibernate.property length="16" unique="true" update="false"
         * @hibernate.meta attribute="testatt" value="attvalue"
         * @hibernate.formula value="formula 3"
         * @hibernate.param name="param3" value="1"
         */
        public String getCode() {
                return code;
        }

        /**
         * Sets the code.
         * @param code The code to set
         */
        public void setCode(String code) {
                this.code = code;
        }

        /**
         * @hibernate.property length="4096"
         * @hibernate.column name="image1"
         * @hibernate.column name="image2"
         */
        public byte[] getImage() {
                return image;
        }

        /**
         * @hibernate.property
         * Returns the price.
         * @return BigDecimal
         */
        public BigDecimal getPrice() {
                return price;
        }

        /**
         * Sets the image.
         * @param image The image to set
         */
        public void setImage(byte[] image) {
                this.image = image;
        }

        /**
         * Sets the price.
         * @param price The price to set
         */
        public void setPrice(BigDecimal price) {
                this.price = price;
        }

        public String getUpdateComment() {
                return updateComment;
        }

        public void setUpdateComment(String string) {
                updateComment = string;
        }

}

\ No newline at end of file
--- 1 ----
! package test.hibernate30;

import java.math.BigDecimal;

/**
 * @hibernate.class table="PRODUCTS" discriminator-value="null"
 *                  dynamic-update="true"
 * @hibernate.discriminator column="PRODUCT_TYPE" type="string" length="16"
 *                          not-null="false"
 * 
 * @author Administrator
 */
public class Product extends Persistent implements Updateable {
        
        private String description;
        private String code;
        private BigDecimal price;
        private byte[] image;
        private String updateComment;

        /**
         * Constructor for Product.
         */
        public Product() {
                super();
        }

        /**
         * @hibernate.property node="description" access="property" 
         *                     type="string" column="description" length="512"
         *                     precision="5" scale="2" not-null="false" 
         *                     unique="false" update="true" insert="true"
         *                     optimistic-lock="true" formula="xyzzy"
         *                     index="ix-product-description" lazy="true"
         * @hibernate.meta attribute="scope-set" value="protected"
         * @hibernate.meta attribute="scope-get" value="public"
         * @hibernate.column name="description" length="512" precision="5" 
         *                   scale="2" not-null="false"
         *                   unique="false" unique-key="unique-key"
         *                   sql-type="varchar" index="ix-product-description"
         *                   check="sql expression"
         * @hibernate.formula "formula 1"
         * @hibernate.formula "formula 2"
         * @hibernate.type name="my.custom.type"
         * @hibernate.param name="param1" value="0"
         * @hibernate.param name="param2" value="text"
         */
        public String getDescription() {
                return description;
        }

        public void setDescription(String name) {
                this.description = name;
        }

        /**
         * @hibernate.property length="16" unique="true" update="false"
         * @hibernate.meta attribute="testatt" value="attvalue"
         * @hibernate.formula value="formula 3"
         * @hibernate.param name="param3" value="1"
         */
        public String getCode() {
                return code;
        }

        /**
         * Sets the code.
         * @param code The code to set
         */
        public void setCode(String code) {
                this.code = code;
        }

        /**
         * @hibernate.property length="4096"
         * @hibernate.column name="image1"
         * @hibernate.column name="image2"
         */
        public byte[] getImage() {
                return image;
        }

        /**
         * @hibernate.property
         * Returns the price.
         * @return BigDecimal
         */
        public BigDecimal getPrice() {
                return price;
        }

        /**
         * Sets the image.
         * @param image The image to set
         */
        public void setImage(byte[] image) {
                this.image = image;
        }

        /**
         * Sets the price.
         * @param price The price to set
         */
        public void setPrice(BigDecimal price) {
                this.price = price;
        }

        public String getUpdateComment() {
                return updateComment;
        }

        public void setUpdateComment(String string) {
                updateComment = string;
        }

}

\ No newline at end of file

Index: Human.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/samples/src/java/test/hibernate30/Human.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Human.java  2 May 2005 14:36:59 -0000       1.1
--- Human.java  20 May 2005 15:00:19 -0000      1.2
***************
*** 1,58 ****
! package test.hibernate30;

! 

! /**

!  * @author Administrator

!  *

!  * @hibernate.joined-subclass

!  *  table="HUMANS"

!  *  dynamic-update="true"

!  * @hibernate.joined-subclass-key

!  *  column="ANIMAL_ID"

!  */

! public class Human extends Animal {

! 

!       private Name name;

!       private String occupation;

! 

!       /**

!        * Constructor for Human.

!        */

!       public Human() {

!               super();

!       }

!       

!       /**

!        * @hibernate.component

!        * Returns the name.

!        * @return Name

!        */

!       public Name getName() {

!               return name;

!       }

! 

!       /**

!        * Sets the name.

!        * @param name The name to set

!        */

!       public void setName(Name name) {

!               this.name = name;

!       }

! 

!       /**

!        * @hibernate.property

!        * Returns the occupation.

!        * @return String

!        */

!       public String getOccupation() {

!               return occupation;

!       }

! 

!       /**

!        * Sets the occupation.

!        * @param occupation The occupation to set

!        */

!       public void setOccupation(String occupation) {

!               this.occupation = occupation;

!       }

! 

! }

--- 1 ----
! package test.hibernate30;

/**
 * @hibernate.joined-subclass entity-name="HUMANS"
 *                            proxy="test.hibernate30.Human" 
 *                            table="HUMANS" 
 *                            schema="THINGS"
 *                            catalog="CAT"
 *                            subselect="sql expression"
 *                            dynamic-update="true"
 *                            dynamic-insert="true"
 *                            select-before-update="true"
 *                            extends="test.hibernate30.Animal"
 *                            lazy="true"
 *                            abstract="false"
 *                            persister="my.PersisterClass"
 *                            check="sql expression 2"
 *                            batch-size="10"
 *                            node="human"
 * @hibernate.key column="ANIMAL_ID" property-ref="property ref"
 *                foreign-key="FOREIGN_KEY" on-delete="cascade"
 *                not-null="true" update="true" unique="true"
 * @hibernate.column name="KEY_COLUMN_1"
 * @hibernate.column name="KEY_COLUMN_2"
 * @hibernate.meta attribute="meta attribute" value="meta value"
 * @hibernate.subselect "subselect sql expression"
 * @hibernate.synchronize table="SYNC_TABLE_1"
 * @hibernate.synchronize table="SYNC_TABLE_2"
 * @hibernate.loader query-ref="query ref"
 * @hibernate.sql-insert callable="true" value="sql insert"
 * @hibernate.sql-delete callable="true" value="sql delete"
 * @hibernate.sql-update value="sql update"
 */
public class Human extends Animal {

        private Name name;
        private String occupation;

        /**
         * Constructor for Human.
         */
        public Human() {
                super();
        }
        
        /**
         * @hibernate.component
         * Returns the name.
         * @return Name
         */
        public Name getName() {
                return name;
        }

        /**
         * Sets the name.
         * @param name The name to set
         */
        public void setName(Name name) {
                this.name = name;
        }

        /**
         * @hibernate.property
         * Returns the occupation.
         * @return String
         */
        public String getOccupation() {
                return occupation;
        }

        /**
         * Sets the occupation.
         * @param occupation The occupation to set
         */
        public void setOccupation(String occupation) {
                this.occupation = occupation;
        }

}

\ No newline at end of file



-------------------------------------------------------
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=7412&alloc_id=16344&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to