I'm a newbee of Hibernate..
I create the User Table.
-----------------------------------------------------
create table User
(
name char(8) not null,
pass char(30) not null,
id char(8) not null,
primary key(id)
);
-----------------------------------------------------
Persistent Object is the following.
-----------------------------------------------------
public User
{
private name, pass,id;
public String getName(){};
public String getPass(){};
public String getId(){};
public void setName(String name){};
public void setPass(String pass){};
public void setId(String id){};
}
-----------------------------------------------------
I want to put new user like the following..
Inert into User (name, pass, id) values (?, password(?), id)
password(...) is the db-function of mysql.
like preceding,
I want to encrypt user password by sql-function, password().
I cannot find any solution for this...
Property formula was no effect on inserting.(But for loading, it is effective..)
Any Advices to this problem will help me...
neosuper@cyber-r.com
-----------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="User" table="User">
<id name="id" column="id">
<generator class="assigned" />
</id>
<property name="name" not-null="false" />
<property name="pass" not-null="false" formula="passsword(pass)"/>
</class>
</hibernate-mapping>
-----------------------------------------------------