I have a table named "test" under DB2
table test
id identity integer
aid formular 'a'||char(id) parmary key
name character(10)
when I ran the sql follows:
insert into test(name) values('name')
if id is generated to 2,the column must be 'a2'
column id is not exist in my hbm file now(because it is identitied).Here is my hbm file:
<class name="test" table="ADMINISTRATOR.test">
<id name="aid" column="AID" type="string">
<generator class="native"/>
</id>
<!--<property name="id" column="ID" type="integer" not-null="true" />-->
<property name="name" column="NAME" type="string" not-null="true" />
</class>
when I create an new object Test and saved by a instance
of Session, I get the attribute aid of value 2(it the value of column id but not column aid).My question is how can I make the hbm file that I can save an new object Test and get the attribute aid start by 'a'
|