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

Modified Files:
        Product.java 
Log Message:
Show use of @hibernate.properties

Index: Product.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/samples/src/java/test/hibernate30/Product.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Product.java        20 May 2005 15:00:19 -0000      1.3
--- Product.java        19 Jul 2005 19:13:09 -0000      1.4
***************
*** 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
--- 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"
 *                          
 * @hibernate.properties name="legacyprops" element-id="legacyprops"
 * 
 * @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"
         *                     parent-element="legacyprops"
         * @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 parent-element="legacyprops"
         * 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



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to