> Using 'assigned' as generator class lets the application set the
> "natural" key. Search in that direction,
I found something like that and I try it before You wrote this post :) and
still something is wrong
Now I've simple table countries (country_code varchar(2), country_name
varchar(100)),
My hbm.xml file:
<hibernate-mapping package="...">
<class name="Country" table="countries" lazy="false">
<id name="code" type="string">
<column name="country_code" sql-type="char(2)" />
<generator class="assigned"/>
</id>
<property name="name" column="country_name" />
</class>
</hibernate-mapping>
in my test I create new Country object:
and if I run test, in line CountryDAO.save(country) I have NullPointer, but
if I do country.toString(), i have:
....Country [
code=PL
name=Poland
]
probably problem is in my dao, thanks for Your help
RoB