Hi,

  I am using XDoclet to create my hbm.xml mapping
files, and my db schema.
  I have this on my java class :

public class State implements java.io.Serializable {

...

/**
*  @hibernate.id generator-class="assigned"
column="COD_STATE"
*/

public java.lang.Long getIdState()  {
  return idState;
}

...

/**
*  @hibernate.property column="STATE_NAME" 
*/

public java.lang.String getState()  {
  return State;
}

  This create this db schema :

create table STATE (
   COD_STATE NUMERIC(18,0) not null,
   STATE_NAME VARCHAR(255),
   primary key (COD_STATE)
);

  This is ok. 

  But I need to set the sql-type of the fields.
COD_STATE must be INTEGER and STATE_NAME must be
CHAR(50)

  So I make this :

/**
*  @hibernate.id generator-class="assigned" 
*  @hibernate.column name="COD_STATE"
sql-type="INTEGER"
*/

public java.lang.Long getIdState()  {
  return idState;
}

...

/**
*  @hibernate.property
*  @hibernate.column name="STATE_NAME"
sql-type="CHAR(50)"
*/

public java.lang.String getState()  {
  return state;
}

And the sql to crate the table was :

create table STATE (
   idState NUMERIC(18,0) not null,
   STATE_NAME CHAR(50),
   primary key (idState)
);

  To the state name it is working ok.
  But I can not change the db type of my primary key
field.
  I try many combinations of tags on this key field. 
  But without success.

  Any help ?

--
Andre Selton


        
                
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to