-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problem with apostrophes
PostPosted: Thu Feb 24, 2005 7:26 am 
Newbie

Joined: Thu Feb 24, 2005 7:06 am
Posts: 1
Location: Poland
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.