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-propertyi 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,scaleexists 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