-->
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.  [ 2 posts ] 
Author Message
 Post subject: EntityMode.DOM4J and bytea
PostPosted: Wed Mar 02, 2011 10:43 pm 
Newbie

Joined: Fri Feb 05, 2010 11:34 pm
Posts: 7
EntityMode.DOM4J gives me a strange encoding for binary data from PostgreSQL. The data type in PostgreSQL is bytea, and the data type of the POJO is byte[].

Using EntityMode.POJO, Query.list() gives me POJOs with correct byte[] field values.

Using EntityMode.DOM4J, Query.list() returns this encoding of my sample data in an XML structure:

binary data ==> xml element content
0x000102 ==> 808182
0x303132333435 ==> b0b1b2b3b4b5

Does anybody know where this encoding is defined and documented? It's not the PostgreSQL "escaped" binary encoding, nor is it any XML binary encoding I've seen.

Thanks,
--Steve


Top
 Profile  
 
 Post subject: Re: EntityMode.DOM4J and bytea
PostPosted: Thu Mar 03, 2011 3:45 pm 
Newbie

Joined: Fri Feb 05, 2010 11:34 pm
Posts: 7
OK, I missed an obvious pattern here. With a little more data it becomes very clear.

binary data ==> xml element content
0x000102 ==> 808182
0x303132333435 ==> b0b1b2b3b4b5
0x7e7f808182 ==> feff000102

This smells like a bug.

--Steve


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.