-->
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.  [ 6 posts ] 
Author Message
 Post subject: Alias names too long for DB2
PostPosted: Mon Apr 18, 2005 10:08 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
Hi there,

I seem to have a problem with alias names that are too long:


Hibernate version:3.0


DB2 Version 7

[4/18/05 15:33:33:363 CEST] 7738cb43 SystemOut O Hibernate: select porexclusi0_.ID as ID1_, porexclusi0_.ADEXLLABUEXCLPCOM as ADEXLLAB2_32_1_, porexclusi0_.ADEXLEXGRAPAYCOM as ADEXLEXG3_32_1_, porexclusi0_.ADEXFINPOLACCCOM as ADEXFINP4_32_1_, porexclusi0_.ADEXLGRPOLCONCOM as ADEXLGRP5_32_1_, porexclusi0_.ADEXLHIDEDPOLCOM as ADEXLHID6_32_1_, porexclusi0_.ADEXLLPORTRACOM as ADEXLLPO7_32_1_, porexclusi0_.ADEXLOBLRICOM as ADEXLOBL8_32_1_, porexclusi0_.ADEXLPOOCOM as ADEXLPOO9_32_1_, porexclusi0_.ADEXLRETCOVCOM as ADEXLRE10_32_1_, porexclusi0_.ADEXLSWDATRECCOM as ADEXLSW11_32_1_, porexclusi0_.ADEXLUMBPOLCOM as ADEXLUM12_32_1_, porexclusi0_.ADEXLUWAUTDELCOM as ADEXLUW13_32_1_, porexclusi0_.GENEXLCIVWARCOM as GENEXLC14_32_1_, porexclusi0_.GENEXLNUCCOM as GENEXLN15_32_1_, porexclusi0_.GENEXLSTRRIOCIVCOM as GENEXLS16_32_1_, porexclusi0_.GENEXLTERSABCOM as GENEXLT17_32_1_, porexclusi0_.GENEXLWARCOM as GENEXLW18_32_1_, porexclusi0_.WRDEXLTABCOM as WRDEXLT19_32_1_, porexclusi0_.ADEXLEXCTROBLCOM as ADEXLEX20_32_1_, porexclusi0_.ADEXLLABUEXCLPEXI as ADEXLLA21_32_1_, porexclusi0_.ADEXLEXGRALOPOEXI as ADEXLEX22_32_1_, porexclusi0_.ADEXFINPOLACCEXI as ADEXFIN23_32_1_, porexclusi0_.ADEXLEXGRAPAYEXI as ADEXLEX24_32_1_, porexclusi0_.ADEXLGRPOLCONEXI as ADEXLGR25_32_1_, porexclusi0_.ADEXLHIDEDPOLEXI as ADEXLHI26_32_1_, porexclusi0_.ADEXLLPORTRAEXI as ADEXLLP27_32_1_, porexclusi0_.ADEXLOBLRIEXI as ADEXLOB28_32_1_, porexclusi0_.ADEXLPOOEXI as ADEXLPO29_32_1_, porexclusi0_.ADEXLRETCOVEXI as ADEXLRE30_32_1_, porexclusi0_.ADEXLSWDATRECEXI as ADEXLSW31_32_1_, porexclusi0_.ADEXLUMBPOLEXI as ADEXLUM32_32_1_, porexclusi0_.ADEXLUWAUTDELEXI as ADEXLUW33_32_1_, porexclusi0_.GENEXLCIVWAREXI as GENEXLC34_32_1_, porexclusi0_.GENEXLNUCEXI as GENEXLN35_32_1_, porexclusi0_.GENEXLSTRRIOCIVEXI as GENEXLS36_32_1_, porexclusi0_.GENEXLTERSABEXI as GENEXLT37_32_1_, porexclusi0_.GENEXLWAREXI as GENEXLW38_32_1_, porexclusi0_.ADEXLEXCTROBLEXI as ADEXLEX39_32_1_, porexclusi0_.WRDSRSIGDAT as WRDSRSI40_32_1_, porexclusi0_.WRDCEDSIGDAT as WRDCEDS41_32_1_, porexclusi0_.LSTENDSIGSRDAT as LSTENDS42_32_1_, porexclusi0_.LSTENDSIGCEDDAT as LSTENDS43_32_1_, porexclusi0_.WRDEXPBYDAT as WRDEXPB44_32_1_, porexclusi0_.ENDEXPBYDAT as ENDEXPB45_32_1_, porexclusi0_.UPD_TS as UPD46_32_1_, porexclusi0_.CMUEFFDT as CMUEFFDT32_1_, porexclusi0_.CMUFLEXCSRDT as CMUFLEX48_32_1_, porexclusi0_.CMUFLEXCCLDT as CMUFLEX49_32_1_, porexclusi0_.WRIEVDCVGRCVSNTDT as WRIEVDC50_32_1_, porexclusi0_.PRLMCTCNA as PRLMCTCNA32_1_, porexclusi0_.PRLMCTCRCVDNTDT as PRLMCTC52_32_1_, porexclusi0_.PRLMCTCSIGSRDT as PRLMCTC53_32_1_, porexclusi0_.PRLMCTSIGCEDDT as PRLMCTS54_32_1_, porexclusi0_.WRD4MORMDDT as WRD55_32_1_, porexclusi0_.WRD6MORMDDT as WRD56_32_1_, porexclusi0_.WRD8MORMDDT as WRD57_32_1_, porexclusi0_.WRDRCVSNTDT as WRDRCVS58_32_1_, porexclusi0_.ADDRCVSNTDT as ADDRCVS59_32_1_, porexclusi0_.PRLCONTXDT as PRLCONTXDT32_1_, porexclusi0_.WORDCHKBENCH as WORDCHK61_32_1_, porexclusi0_.BCTCONPARCOMMENT as BCTCONP62_32_1_, porexclusi0_.BCTSCOPCVRCOMMENT as BCTSCOP63_32_1_, porexclusi0_.BCTCVRPERILCOMMENT as BCTCVRP64_32_1_, porexclusi0_.BCTGEOSCOPECOMMENT as BCTGEOS65_32_1_, porexclusi0_.BCTDEFINFABCOMMENT as BCTDEFI66_32_1_, porexclusi0_.BCTPERCOMMENT as BCTPERC67_32_1_, porexclusi0_.BCTBASCVRCOMMENT as BCTBASC68_32_1_, porexclusi0_.BCTCVRSHARECOMMENT as BCTCVRS69_32_1_, porexclusi0_.BCTRETENCOMMENT as BCTRETE70_32_1_, porexclusi0_.BCTPARTSHRCOMMENT as BCTPART71_32_1_, porexclusi0_.BCTBASCESCOMMENT as BCTBASC72_32_1_, porexclusi0_.BCTSUMINSCOMMENT as BCTSUMI73_32_1_, porexclusi0_.BCTAALCOMMENT as BCTAALC74_32_1_, porexclusi0_.BCTEVNTLIMCOMMENT as BCTEVNT75_32_1_, porexclusi0_.BCTLAYERSTRCOMMENT as BCTLAYE76_32_1_, porexclusi0_.BCTAALRINBRCOMMENT as BCTAALR77_32_1_, porexclusi0_.BCTRISKCOMMENT as BCTRISK78_32_1_, porexclusi0_.BCTLOSOCDEFCOMMENT as BCTLOSO79_32_1_, porexclusi0_.BCTEVNTDEFCOMMENT as BCTEVNT80_32_1_, porexclusi0_.BCTWRISKDEFCOMMENT as BCTWRIS81_32_1_, porexclusi0_.BCTORGPREMCOMMENT as BCTORGP82_32_1_, porexclusi0_.BCTCOMMCOMMENT as BCTCOMM83_32_1_, porexclusi0_.BCTPRFCOMMCOMMENT as BCTPRFC84_32_1_, porexclusi0_.BCTOTHDEDUCCOMMENT as BCTOTHD85_32_1_, porexclusi0_.BCTESTGNPICOMMENT as BCTESTG86_32_1_, porexclusi0_.BCTPREMRATECOMMENT as BCTPREM87_32_1_, porexclusi0_.BCTMINPREMCOMMENT as BCTMINP88_32_1_, porexclusi0_.BCTPREMPAYCOMMENT as BCTPREM89_32_1_, porexclusi0_.BCTRIPREMCOMMENT as BCTRIPR90_32_1_, porexclusi0_.BCTPAYWRNTCOMMENT as BCTPAYW91_32_1_, porexclusi0_.BCTPREMPFTYCOMMENT as BCTPREM92_32_1_, porexclusi0_.BCTLOSSRSVYCOMMENT as BCTLOSS93_32_1_, porexclusi0_.BCTCASCLLIMCOMMENT as BCTCASC94_32_1_, porexclusi0_.BCTCLMNOTIFCOMMENT as BCTCLMN95_32_1_, porexclusi0_.BCTCLMCOOPCOMMENT as BCTCLMC96_32_1_, porexclusi0_.BCTAPPLAWCOMMENT as BCTAPPL97_32_1_, porexclusi0_.BCTSOACOMMENT as BCTSOAC98_32_1_, porexclusi0_.BCTWRDCOMMENT as BCTWRDC99_32_1_, porexclusi0_.BCTITMBROCOMMENT as BCTITM100_32_1_, porexclusi0_.BCTINTCLREFCOMMENT as BCTINT101_32_1_, porexclusi0_.BCTIXCLSREFCOMMENT as BCTIXC102_32_1_, porexclusi0_.BCTDEPOSITSCOMMENT as BCTDEP103_32_1_, porexclusi0_.BCTTEXT1 as BCTTEXT104_32_1_, porexclusi0_.BCTTEXT1COMMENT as BCTTEXT105_32_1_, porexclusi0_.BCTTEXT2 as BCTTEXT106_32_1_, porexclusi0_.BCTTEXT2COMMENT as BCTTEXT107_32_1_, porexclusi0_.BCTTEXT3 as BCTTEXT108_32_1_, porexclusi0_.BCTTEXT3COMMENT as BCTTEXT109_32_1_, porexclusi0_.BCTTEXT4 as BCTTEXT110_32_1_, porexclusi0_.BCTTEXT4COMMENT as BCTTEXT111_32_1_, porexclusi0_.BCTTEXT5 as BCTTEXT112_32_1_, porexclusi0_.BCTTEXT5COMMENT as BCTTEXT113_32_1_, porexclusi0_.BCTTEXT6 as BCTTEXT114_32_1_, porexclusi0_.BCTTEXT6COMMENT as BCTTEXT115_32_1_, porexclusi0_.BCTTEXT7 as BCTTEXT116_32_1_, porexclusi0_.BCTTEXT7COMMENT as BCTTEXT117_32_1_, porexclusi0_.BCTTEXT8 as BCTTEXT118_32_1_, porexclusi0_.BCTTEXT8COMMENT as BCTTEXT119_32_1_, porexclusi0_.BCTTEXT9 as BCTTEXT120_32_1_, porexclusi0_.BCTTEXT9COMMENT as BCTTEXT121_32_1_, porexclusi0_.WRDELAPTY as WRDELAPTY32_1_, porexclusi0_.PNDREA_ID as PNDREA123_32_1_, porexclusi0_.PRLMCTCEL_ID as PRLMCTCEL124_32_1_, porexclusi0_.PRLMCTPNDREA_ID as PRLMCT125_32_1_, porexclusi0_.WRDPNDREA_ID as WRDPNDREA126_32_1_, porexclusi0_.ADDPNDREA_ID as ADDPNDREA127_32_1_, porexclusi0_.ADDEXCMREA_ID as ADDEXCMREA128_32_1_, porexclusi0_.WRDEXPREA_ID as WRDEXPREA129_32_1_, porexclusi0_.BCTCONPARDETAILS as BCTCON130_32_1_, porexclusi0_.BCTSCOPCVRDETAILS as BCTSCO131_32_1_, porexclusi0_.BCTCVRPERILDETAILS as BCTCVR132_32_1_, porexclusi0_.BCTGEOSCOPEDETAILS as BCTGEO133_32_1_, porexclusi0_.BCTDEFINTABDETAILS as BCTDEF134_32_1_, porexclusi0_.BCTPERDETAILS as BCTPER135_32_1_, porexclusi0_.BCTBASCVRDETAILS as BCTBAS136_32_1_, porexclusi0_.BCTCVRSHAREDETAILS as BCTCVR137_32_1_, porexclusi0_.BCTRETENDETAILS as BCTRET138_32_1_, porexclusi0_.BCTPARTSHRDETAILS as BCTPAR139_32_1_, porexclusi0_.BCTBASCESDETAILS as BCTBAS140_32_1_, porexclusi0_.BCTSUMINSDETAILS as BCTSUM141_32_1_, porexclusi0_.BCTAALDETAILS as BCTAAL142_32_1_, porexclusi0_.BCTEVNTLIMDETAILS as BCTEVN143_32_1_, porexclusi0_.BCTLAYERSTRDETAILS as BCTLAY144_32_1_, porexclusi0_.BCTAALRINBRDETAILS as BCTAAL145_32_1_, porexclusi0_.BCTRISKDETAILS as BCTRIS146_32_1_, porexclusi0_.BCTLOSOCDEFDETAILS as BCTLOS147_32_1_, porexclusi0_.BCTEVNTDEFDETAILS as BCTEVN148_32_1_, porexclusi0_.BCTWRISKDEFDETAILS as BCTWRI149_32_1_, porexclusi0_.BCTORGPREMDETAILS as BCTORG150_32_1_, porexclusi0_.BCTCOMMDETAILS as BCTCOM151_32_1_, porexclusi0_.BCTPRFCOMMDETAILS as BCTPRF152_32_1_, porexclusi0_.BCTOTHDEDUCDETAILS as BCTOTH153_32_1_, porexclusi0_.BCTESTGNPIDETAILS as BCTEST154_32_1_, porexclusi0_.BCTPREMRATEDETAILS as BCTPRE155_32_1_, porexclusi0_.BCTMINPREMDETAILS as BCTMIN156_32_1_, porexclusi0_.BCTPREMPAYDETAILS as BCTPRE157_32_1_, porexclusi0_.BCTRIPREMDETAILS as BCTRIP158_32_1_, porexclusi0_.BCTPAYWRNTDETAILS as BCTPAY159_32_1_, porexclusi0_.BCTPREMPFTYDETAILS as BCTPRE160_32_1_, porexclusi0_.BCTLOSSRSVYDETAILS as BCTLOS161_32_1_, porexclusi0_.BCTCASCLLIMDETAILS as BCTCAS162_32_1_, porexclusi0_.BCTCLMNOTIFDETAILS as BCTCLM163_32_1_, porexclusi0_.BCTCLMCOOPDETAILS as BCTCLM164_32_1_, porexclusi0_.BCTAPPLAWDETAILS as BCTAPP165_32_1_, porexclusi0_.BCTSOADETAILS as BCTSOA166_32_1_, porexclusi0_.BCTWRDDETAILS as BCTWRD167_32_1_, porexclusi0_.BCTITMBRODETAILS as BCTITM168_32_1_, porexclusi0_.BCTINTCLREFDETAILS as BCTINT169_32_1_, porexclusi0_.BCTIXCLSREFDETAILS as BCTIXC170_32_1_, porexclusi0_.BCTDEPOSITSDETAILS as BCTDEP171_32_1_, porexclusi0_.BCTTEXT1DETAILS as BCTTEXT172_32_1_, porexclusi0_.BCTTEXT2DETAILS as BCTTEXT173_32_1_, porexclusi0_.BCTTEXT3DETAILS as BCTTEXT174_32_1_, porexclusi0_.BCTTEXT4DETAILS as BCTTEXT175_32_1_, porexclusi0_.BCTTEXT5DETAILS as BCTTEXT176_32_1_, porexclusi0_.BCTTEXT6DETAILS as BCTTEXT177_32_1_, porexclusi0_.BCTTEXT7DETAILS as BCTTEXT178_32_1_, porexclusi0_.BCTTEXT8DETAILS as BCTTEXT179_32_1_, porexclusi0_.BCTTEXT9DETAILS as BCTTEXT180_32_1_, porbusines1_.ID as ID0_, porbusines1_.ADMSYSTEMID as ADMSYSTE2_183_0_, porbusines1_.LAYER as LAYER183_0_, porbusines1_.BUSVAR as BUSVAR183_0_, porbusines1_.PREFBUS as PREFBUS183_0_, porbusines1_.REFERENCE as REFERENCE183_0_, porbusines1_.CLIENT_REF as CLIENT7_183_0_, porbusines1_.BUSINESS_NAME as BUSINESS8_183_0_, porbusines1_.OFFSHRPCT as OFFSHRPCT183_0_, porbusines1_.CANDAT as CANDAT183_0_, porbusines1_.RATINGSYSTEMID as RATINGS11_183_0_, porbusines1_.SETINFORCEUSER as SETINFO12_183_0_, porbusines1_.SETINFORCEON as SETINFO13_183_0_, porbusines1_.OPPEXISTED as OPPEXISTED183_0_, porbusines1_.EXTSTATUS_TS as EXTSTATUS15_183_0_, porbusines1_.MIG_SOURCE as MIG16_183_0_, porbusines1_.UPD_TS as UPD17_183_0_, porbusines1_.AMDVALFROMDAT as AMDVALF18_183_0_, porbusines1_.AMDVALTODAT as AMDVALT19_183_0_, porbusines1_.AMDNUMBER as AMDNUMBER183_0_, porbusines1_.CANCOMMENT as CANCOMMENT183_0_, porbusines1_.OTHREATEXT as OTHREATEXT183_0_, porbusines1_.PUBID_BUS as PUBID23_183_0_, porbusines1_.OTHERREASN as OTHERREASN183_0_, porbusines1_.DWNGRDPRVIND as DWNGRDP25_183_0_, porbusines1_.ACTIVE_YN as ACTIVE26_183_0_, porbusines1_.OP_ID as OP27_183_0_, porbusines1_.CR_TP_1 as CR28_183_0_, porbusines1_.CR_TP_2 as CR29_183_0_, porbusines1_.TYPEOFBUSINESS as TYPEOFB30_183_0_, porbusines1_.ADMSYSTEM as ADMSYSTEM183_0_, porbusines1_.BUSINESS_STATUS as BUSINESS32_183_0_, porbusines1_.NOVELTY as NOVELTY183_0_, porbusines1_.CANPTY as CANPTY183_0_, porbusines1_.RATINGSYSTEM as RATINGS35_183_0_, porbusines1_.PRICING_ID as PRICING36_183_0_, porbusines1_.CVRSTR_ID as CVRSTR37_183_0_, porbusines1_.CVRLMT_ID as CVRLMT38_183_0_, porbusines1_.COST_ID as COST39_183_0_, porbusines1_.COMM_ID as COMM40_183_0_, porbusines1_.XLPRM_ID as XLPRM41_183_0_, porbusines1_.IDXHDR_ID as IDXHDR42_183_0_, porbusines1_.NEGO_ID as NEGO43_183_0_, porbusines1_.THREAT_ID as THREAT44_183_0_, porbusines1_.ACC_ID as ACC45_183_0_, porbusines1_.EXCL_ID as EXCL46_183_0_, porbusines1_.CANCELTYPE as CANCELTYPE183_0_, porbusines1_.EXTSTATUS as EXTSTATUS183_0_, porbusines1_.ADDPROV_ID as ADDPROV49_183_0_, porbusines1_.ADDTERM_ID as ADDTERM50_183_0_, porbusines1_.AM_SRC_BUS_ID as AM51_183_0_, porbusines1_.OTHREAKEY as OTHREAKEY183_0_, porbusines1_.DECBY as DECBY183_0_, porbusines1_.CANPRVKEY as CANPRVKEY183_0_, porbusines1_.BUSREAKEY as BUSREAKEY183_0_, porbusines1_.PRICINGFSBG_ID as PRICING56_183_0_, porbusines1_.MAJORCLSKEY as MAJORCL57_183_0_, porbusines1_.CANRIGHTSKEY as CANRIGH58_183_0_, porbusines1_.CANTERMSKEY as CANTERM59_183_0_, porbusines1_.PRIMELOB as PRIMELOB183_0_, porbusines1_.STATUSB4REVISION as STATUSB61_183_0_ from IUF31S.TEXCLUSIONS porexclusi0_ left outer join IUF31S.TBUSINESS porbusines1_ on porexclusi0_.ID=porbusines1_.EXCL_ID where porexclusi0_.ID=?
[4/18/05 15:33:33:628 CEST] 7738cb43 SystemOut O 15:33:33,628 WARN JDBCExceptionReporter:57 - SQL Error: -107, SQLState: 42622
15:33:33,628 ERROR JDBCExceptionReporter:58 - [IBM][CLI Driver][DB2] SQL0107N The name "ADDEXCMREA128_32_1_" is too long. The maximum length is "18". SQLSTATE=42622


Top
 Profile  
 
 Post subject: Re: Alias names too long for DB2
PostPosted: Tue Apr 19, 2005 3:15 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
I also tried the new maintenance release 3.0.1 and it has the same problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 7:46 am 
Newbie

Joined: Mon Apr 18, 2005 10:02 am
Posts: 14
Location: Zürich, Switzerland
I did a fix myself in Column.java:

public String getAlias() {
String alias = name;
String unique = Integer.toString(uniqueInteger) + '_';
int lastLetter = StringHelper.lastIndexOfLetter(name);
if ( lastLetter == -1 ) {
alias = "column";
}
else if ( lastLetter < name.length()-1 ) {
alias = name.substring(0, lastLetter+1);
}
if ( alias.length() > 8 ) {
alias = alias.substring( 0, 8 - unique.length() );
}
if ( name.equals(alias) ) {
return alias;
}
else {
return alias + unique;
}
}


Top
 Profile  
 
 Post subject: Very helpful solution
PostPosted: Thu Feb 09, 2006 6:34 am 
Newbie

Joined: Wed Feb 08, 2006 10:07 am
Posts: 2
Location: Constance / Lake Constance, Germany
Hi Jürg,

I had the same problem. Thank you for solution.

Uwe


Top
 Profile  
 
 Post subject: Re: Very helpful solution
PostPosted: Fri Feb 09, 2007 6:52 am 
Newbie

Joined: Thu Mar 23, 2006 9:32 am
Posts: 1
renzland wrote:
Hi Jürg,

I had the same problem. Thank you for solution.

Uwe


Hi,

same problem too,

We use DB2 7.2 on mainframe with Hibernate 3.1
is this problem resolved in a new version of hibernate ?

I don't find anything in the JIRA exept that it's seems to be fixed in the 2.1.
We have don't have any possibility to update the database which is ever used by others projects.
we have 220 fields in the table (big objects ;)

SELECT ... photoum0_.XCUMQTEHUI_F2 as XCUMQTEHUI121_13_0_ ...

is it possible to configure generation of the alias without modifying internal hibernate code ?

or any other solution ?

Thanks in advance,

Matthieu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 11:02 am 
Regular
Regular

Joined: Fri May 12, 2006 4:05 am
Posts: 106
This might not be of too much use for you now, but some small light at the end of the tunnel:
I don't know if a new version of hibernate might help, but Version 8 of DB2 might solve the problem, since the maximum length of column-names is increased form 18 to 30 between V7 and V8. So you could also hope that your company migrates to DB2 V8 soon...

Greets

piet


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