Hibernate version:
2.1.7
Mapping documents:
<hibernate-mapping>
<class name="model.User" table="users">
<id name="id" column="id" type="integer">
<generator class="native"/>
</id>
<property name="name" type="string" column="name"/>
<property name="surname" type="string" column="surname"/>
<property name="login" type="string" column="login"/>
<property name="password" type="string" length="16" column="password"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
session.save(user);
Full stack trace of any exception that occurs:
2005-02-24 11:37:52,070 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Error: 0, SQLState: null>
2005-02-24 11:37:52,071 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <Batch entry 0 insert into users (name, surname, login, password, id) values (a, a, duzet, 13a7675f336b9930bddc4cceba93fe52, 1) was aborted. Call getNextException to see the cause.>
Name and version of the database you are using:
postgresql 8.0
I have a problem with saving new user to my database. user has property surname of type string. When i issue session.save it generates sql query like this: insert into .... values (..., user_surname ,...). The problem is that user_surnmae is not surrounded by apostrophes and postgresql returns an error.
_________________ Tomasz Lewandowski
d124110@atos.wmid.amu.edu.pl
|