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

Modified Files:
        Product.java 
Log Message:
Factor out property element into it's own XDT file and add missing attributes 
for Hibernate 3

Index: Product.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/samples/src/java/test/hibernate30/Product.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Product.java        2 May 2005 14:36:59 -0000       1.1
--- Product.java        17 May 2005 16:49:10 -0000      1.2
***************
*** 1,114 ****
! 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.jcs-cache

!  *  usage="read-only"

!  * 

!  * @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

!        *  length="512"

!        * @return String

!        */

!       public String getDescription() {

!               return description;

!       }

! 

!       /**

!        * Sets the name.

!        * @param name The name to set

!        */

!       public void setDescription(String name) {

!               this.description = name;

!       }

! 

!       /**

!        * @hibernate.property

!        *  length="16"

!        *  unique="true"

!        *  update="false"

!        * @return String

!        */

!       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"

!        * Returns the image.

!        * @return byte[]

!        */

!       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;

!       }

! 

! }

--- 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



-------------------------------------------------------
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