These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: some way to resolve this with ant or other tool
PostPosted: Thu Dec 13, 2007 8:28 pm 
Newbie

Joined: Mon Mar 12, 2007 8:47 pm
Posts: 5
hello guys

i am in hell with this
i work with xdoclet and pls see this situtation
Code:
/**
  * @hibernate.property column="precioUnitarioVenta" [b]length="6"[/b] not-null="true"                                           
*/
public [b]BigDecimal[/b] getPrecioUnitarioVenta() {
   return precioUnitarioVenta;
}


if i go to my mapping file i see this
Code:
   <property
            name="precioUnitarioVenta"
            type="java.math.BigDecimal"
            update="true"
            insert="true"
            column="precioUnitarioVenta"
          [b]  length="6" [/b]
            not-null="true"
        />


it seems fine,
but if i see the type of each column of the table in the db
i see this
decimal(19,2)

here
http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html#mapping-declaration-property

i can see this
Code:
<property
        name="propertyName"                                          (1)
        column="column_name"                                         (2)
        type="typename"                                              (3)
        update="true|false"                                          (4)
        insert="true|false"                                          (4)
        formula="arbitrary SQL expression"                           (5)
        access="field|property|ClassName"                            (6)
        lazy="true|false"                                            (7)
        unique="true|false"                                          (8)
        not-null="true|false"                                        (9)
        optimistic-lock="true|false"                                 (10)
        generated="never|insert|always"                              (11)
        node="element-name|@attribute-name|element/@attribute|."
        index="index_name"
        unique_key="unique_key_id"
        length="L"
   [b]     precision="P"
        scale="S" [/b]
/>

bold part sadly are not supported by xdoclet 1
and if in my java code i write anyway this

Code:
/**
* @hibernate.property not-null="true"
*             [b]precision="9"
*               scale="2" [/b]
*               column="precioUnitario"
*                                                             
*/
public BigDecimal getPrecioUnitario() {
   return precioUnitario;
}
public void setPrecioUnitario(BigDecimal precioUnitario) {
   this.precioUnitario = precioUnitario;
}


with the ant task i dont recieve any error but , in the mapping file appear

Code:
<property
            name="precioUnitario"
            type="java.math.BigDecimal"
            update="true"
            insert="true"
            column="precioUnitario"
            not-null="true"
        />

of course length value was not written with xdoclet but the desired properties not appear
precision,scale

exists a way with ant after to create the mapping files (hbm.xml)
replace
Code:
<property
            name="precioUnitario"
            [b]type="java.math.BigDecimal"[/b]
            update="true"
            insert="true"
            column="precioUnitario"
            not-null="true"
        />

by

Code:
<property
            name="precioUnitario"
         [b]   type="java.math.BigDecimal"
            precision="9"
       scale="2" [/b]
            update="true"
            insert="true"
            column="precioUnitario"
            not-null="true"
        />


just how work with a txt document,
i can do this manually maybe for one property but for 500 properties i see this a suicide

exists a way to do this approcach with ant or other tool?

thanks in advanced


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.