From: Gavin K. <Gav...@ex...> - 2003-01-01 23:44:42
|
Yick. The biggest design problem with Hibernate at present is the fact that we have no single class responsible for rendering SQL. (As I have mentioned before, Hibernate models SQL=20 statements using StringBuffer...) So little things like this=20 that should be *very* easy turn out to be way more tricky than you expect. However there are a couple of methods that are responsible for dealing with SQL quoted identifiers so you may be able to hook in there. We *do* need to fix this problem of StringBuffer being used everywhere. > -----Original Message----- > From: Mark Woon [mailto:mor...@SM...]=20 > Sent: Wednesday, 1 January 2003 10:33 AM > To: Hibernate Mailing List > Subject: [Hibernate] Length of Hibernate-generated aliases in SQL >=20 >=20 >=20 > Does Hibernate do any checking on the length of the aliases=20 > it generates=20 > when it creates it's SQL queries? I'm getting "identifier is=20 > too long"=20 > errors against Oracle 9.2 at the moment because Hibernate=20 > tacks on some=20 > extra text to some column names. >=20 > If not, would it be terribly difficult to add this=20 > functionality? Which=20 > classes should I be looking at to figure this out? >=20 > Thanks, > -Mark >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > hibernate-devel mailing list hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel >=20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: Gavin K. <Gav...@ex...> - 2003-01-02 07:18:03
|
Max, it would happen whenever you have a column name that approaches the limit for the database. Hibernate needs to add an _0, etc at the end when rendering aiases. > -----Original Message----- > From: max [mailto:ma...@ac...]=20 > Sent: Thursday, 2 January 2003 6:11 PM > To: Hibernate Mailing List > Subject: Re: [Hibernate] Length of Hibernate-generated aliases in SQL >=20 >=20 > Could you give an hbm.xml and query example that gives that=20 > error ? (it=20 > would be nice to have some test scenario :) > (especially, since it would be nice to know what one could do=20 > to avoid=20 > such a thing....- it would also be a problem on db2 since it also has=20 > some "weird" low limitations) >=20 > /max >=20 > >Yick. The biggest design problem with Hibernate at present=20 > is the fact=20 > >that we have no single class responsible for rendering SQL.=20 > (As I have=20 > >mentioned before, Hibernate models SQL statements using=20 > >StringBuffer...) So little things like this that should be=20 > *very* easy=20 > >turn out to be way more tricky than you expect. However there are a=20 > >couple of methods that are responsible for dealing with SQL quoted=20 > >identifiers so you may be able to hook in there. > > > >We *do* need to fix this problem of StringBuffer being used=20 > everywhere. > > > > =20 > > > >>-----Original Message----- > >>From: Mark Woon [mailto:mor...@SM...] > >>Sent: Wednesday, 1 January 2003 10:33 AM > >>To: Hibernate Mailing List > >>Subject: [Hibernate] Length of Hibernate-generated aliases in SQL > >> > >> > >> > >>Does Hibernate do any checking on the length of the aliases > >>it generates=20 > >>when it creates it's SQL queries? I'm getting "identifier is=20 > >>too long"=20 > >>errors against Oracle 9.2 at the moment because Hibernate=20 > >>tacks on some=20 > >>extra text to some column names. > >> > >>If not, would it be terribly difficult to add this > >>functionality? Which=20 > >>classes should I be looking at to figure this out? > >> > >>Thanks, > >>-Mark > >> > >> > >> > >>------------------------------------------------------- > >>This sf.net email is sponsored by:ThinkGeek > >>Welcome to geek heaven. > >>http://thinkgeek.com/sf > >>_______________________________________________ > >>hibernate-devel mailing list hib...@li... > >>https://lists.sourceforge.net/lists/listinfo/hibernate-devel > >> > >> =20 > >> >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf=20 > _______________________________________________ > hibernate-devel mailing list hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel >=20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |
From: max <ma...@ac...> - 2003-01-02 07:31:43
|
Gavin King wrote: >Max, it would happen whenever you have a column name that approaches >the limit for the database. Hibernate needs to add an _0, etc at >the end when rendering aiases. > I know, would just be easier if he got a clean example :) But Ok - I've fought with these kind of troubles before and at that time we just limited our selfes to use shorter column names :) (the easy solution - and is "ok" as long as we are using the column names and not the propertynames in the SQL generated by HQL) Another one is to rewrite the code that produces those aliases (and as I remember - the logic are well-defined but unfortunatly not in a single method). That alias generation should of course use the Dialect class which would have an getMaxColumnNameLength and getMaxTableNameLength. If the aliases generated exceeds that amount "do something" :) Maybe we should just postfix the names with 0_ instead of prefixing them with _0 (and then chop them of with the dialects max lengths..) - that would make them unique ....and avoid name colisions (as long as the max lenght is not near 3-4 chars ....) Just some thoughts.... /max > > |
From: Mark W. <mor...@SM...> - 2003-01-04 04:53:33
|
max wrote: > Another one is to rewrite the code that produces those aliases (and as > I remember - the logic are well-defined but unfortunatly not in a > single method). > > That alias generation should of course use the Dialect class which > would have an getMaxColumnNameLength and getMaxTableNameLength. > If the aliases generated exceeds that amount "do something" :) > > Maybe we should just postfix the names with 0_ instead of prefixing > them with _0 (and then chop them of with the dialects max lengths..) - > that would > make them unique ....and avoid name colisions (as long as the max > lenght is not near 3-4 chars ....) I think you meant prefix the names with 0_ and postfixing them with _0... ;) But yeah, I think this is an extremely simple solution to the problem. And I'd be more than happy to implement the fix, if I can just figure out which methods are actually producing the offending SQL. I'll try looking at it later tonight. I'm getting really tired of renaming my db columns... -Mark |
From: Mark W. <mor...@SM...> - 2003-01-05 07:48:39
|
Mark Woon wrote: > And I'd be more than happy to implement the fix, if I can just figure > out which methods are actually producing the offending SQL. I'll try > looking at it later tonight. I'm getting really tired of renaming my > db columns... I think I've got a reasonable fix for this problem. Patch submitted to SourceForge (http://sourceforge.net/tracker/index.php?func=detail&aid=662501&group_id=40712&atid=428708). -Mark |
From: max <ma...@ac...> - 2003-01-02 07:11:06
|
Could you give an hbm.xml and query example that gives that error ? (it would be nice to have some test scenario :) (especially, since it would be nice to know what one could do to avoid such a thing....- it would also be a problem on db2 since it also has some "weird" low limitations) /max >Yick. The biggest design problem with Hibernate at present is >the fact that we have no single class responsible for rendering >SQL. (As I have mentioned before, Hibernate models SQL >statements using StringBuffer...) So little things like this >that should be *very* easy turn out to be way more tricky >than you expect. However there are a couple of methods that >are responsible for dealing with SQL quoted identifiers so >you may be able to hook in there. > >We *do* need to fix this problem of StringBuffer being used >everywhere. > > > >>-----Original Message----- >>From: Mark Woon [mailto:mor...@SM...] >>Sent: Wednesday, 1 January 2003 10:33 AM >>To: Hibernate Mailing List >>Subject: [Hibernate] Length of Hibernate-generated aliases in SQL >> >> >> >>Does Hibernate do any checking on the length of the aliases >>it generates >>when it creates it's SQL queries? I'm getting "identifier is >>too long" >>errors against Oracle 9.2 at the moment because Hibernate >>tacks on some >>extra text to some column names. >> >>If not, would it be terribly difficult to add this >>functionality? Which >>classes should I be looking at to figure this out? >> >>Thanks, >>-Mark >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf >>_______________________________________________ >>hibernate-devel mailing list hib...@li... >>https://lists.sourceforge.net/lists/listinfo/hibernate-devel >> >> >> |
From: Pablo I. L. <pi...@gm...> - 2003-01-03 03:16:13
|
Same problem on Interbase/Firebird. pil m> Could you give an hbm.xml and query example that gives that error ? (it m> would be nice to have some test scenario :) m> (especially, since it would be nice to know what one could do to avoid m> such a thing....- it would also be a problem on db2 since it also has m> some "weird" low limitations) m> /max >>Yick. The biggest design problem with Hibernate at present is >>the fact that we have no single class responsible for rendering >>SQL. (As I have mentioned before, Hibernate models SQL >>statements using StringBuffer...) So little things like this >>that should be *very* easy turn out to be way more tricky >>than you expect. However there are a couple of methods that >>are responsible for dealing with SQL quoted identifiers so >>you may be able to hook in there. >> >>We *do* need to fix this problem of StringBuffer being used >>everywhere. >> >> >> >>>-----Original Message----- >>>From: Mark Woon [mailto:mor...@SM...] >>>Sent: Wednesday, 1 January 2003 10:33 AM >>>To: Hibernate Mailing List >>>Subject: [Hibernate] Length of Hibernate-generated aliases in SQL >>> >>> >>> >>>Does Hibernate do any checking on the length of the aliases >>>it generates >>>when it creates it's SQL queries? I'm getting "identifier is >>>too long" >>>errors against Oracle 9.2 at the moment because Hibernate >>>tacks on some >>>extra text to some column names. >>> >>>If not, would it be terribly difficult to add this >>>functionality? Which >>>classes should I be looking at to figure this out? >>> >>>Thanks, >>>-Mark >>> >>> >>> >>>------------------------------------------------------- >>>This sf.net email is sponsored by:ThinkGeek >>>Welcome to geek heaven. >>>http://thinkgeek.com/sf >>>_______________________________________________ >>>hibernate-devel mailing list hib...@li... >>>https://lists.sourceforge.net/lists/listinfo/hibernate-devel >>> >>> >>> m> ------------------------------------------------------- m> This sf.net email is sponsored by:ThinkGeek m> Welcome to geek heaven. m> http://thinkgeek.com/sf m> _______________________________________________ m> hibernate-devel mailing list m> hib...@li... m> https://lists.sourceforge.net/lists/listinfo/hibernate-devel |