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: SAPDB Char problem when using Native Query
PostPosted: Sat Feb 24, 2007 8:37 am 
Newbie

Joined: Tue Nov 07, 2006 5:29 pm
Posts: 3
Hello,

I am currently working on a web projekt with the purpose of displaying data from a legacy database within a web application. The Database I am using is SAPDB version 7.5.0 . As I do only have to create read-only access to the legacy DB and show the result as simple HTML-Tables I didn' t write hibernate mapping files, but usednative SQL-Queries to retrieve the data.

I am using the AliasToEntityMapResultTransformer to create a "list of maps" that menas every row ist automaticaly transfered to a Map.

Now I have a strange problem concerning columns of type "CHAR". Only the first character of a char column is displayed. Example:

Table of legacy Database: CLIENT

Columns:

NAME Varchar(200)
CLIENTNO CHAR(3)

The native SQL Query:

SELECT NAME as "Name", CLIENTNO AS "CNO" FROM CLIENT

Testdata:

NAME: TEST plc
CLIENTNO: D21

The result of the Query is stored inside the Map:

Name: Test plc (That's OK)
CNO: D (Why only one Character instead of three? Why "D" instead of "D21"?)

This problem only occurs for the column type CHAR - all other types work perfectly...

I have ported the same example to MySQL 5.0 and everything works perfect!

Has anybody faced similar problems? Is there any solution?

Thank you in advance, Greetings

Aldan

Hibernate Version: 3.2.2 GA


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.