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.  [ 5 posts ] 
Author Message
 Post subject: Entity reference encoding
PostPosted: Wed Dec 08, 2004 11:41 am 
Newbie

Joined: Wed Dec 08, 2004 11:31 am
Posts: 3
I'm having trouble with persisting content which contains entity references e.g. Â

Hibernate appears to be automagically encoding the & as & which is not the behaviour I want.

Is there a config setting which disables this behaviour?

Thanks

Tom


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 11:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
What are you talking about? Hibernate is surely not doing anything like that.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 12:03 pm 
Newbie

Joined: Wed Dec 08, 2004 11:31 am
Posts: 3
It may not be hibernate, here's what I am doing:

JDBC connection to DB A to grab data

Code:
ResultSet rs = stmt.executeQuery("SELECT * FROM PRODUCTS WHERE ISBN='" + request.getParameter("gwAddIsbn") +"'");


This is then copied into another DB using hibernate:

Code:
   Books book = new Books();
   book.setIsbn(request.getParameter("gwAddIsbn"));
   book.setAuthorId(Integer.decode(request.getParameter("authorId")));
   book.setTitle(rs.getString("TITLE"));
        book.setDescription(" ");
   book.setDisplayLabel(" ");
   book.setExtract(" ");
               
   bookService.addBook(book);


If the TITLE field of the book contains entity references then the resulting field in the hibernate DB has the & of the entity ref encoded as &


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 12:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Surely not done by Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 08, 2004 12:30 pm 
Newbie

Joined: Wed Dec 08, 2004 11:31 am
Posts: 3
My mistake

It must be happening in the JSP layer that displays the entries.

Thanks for your help

Tom


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

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.