<div dir="ltr">Hi,<div><br></div><div>I've forwarded your mail to hibernate-dev. Our mailing list is open, you can register at [1].</div><div><br></div><div>--Gunnar</div><div><br></div><div>[1] <a href="https://lists.jboss.org/mailman/listinfo/hibernate-dev">https://lists.jboss.org/mailman/listinfo/hibernate-dev</a></div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/20 Jess Sightler <span dir="ltr"><<a href="mailto:jsightle@redhat.com" target="_blank">jsightle@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agree, but I am not on hibernate-dev, unfortunately, and this seems like an issue that could affect a lot of people if it goes into the Wildfly final release.<br>
<br>
I believe that you have misunderstood the issue here. The issue is not putting quotes around it (although I guess that might work around the bug).<br>
<br>
The issue is that if you have a table starting with "and" (eg, "androidvariant"), then this code will think it starts with " and" (note the space). It will then proceed to rip off the first 4 characters, turning your table name into "oidvariant".<br>
<br>
Note how the code also does not do what the comment describing it says it will do. Ie, it tries to remove " and" and "and ", but only checks for "and" (no spaces) before doing the trimming.<br>
<div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
> From: "Tomaž Cerar" <<a href="mailto:tomaz.cerar@gmail.com">tomaz.cerar@gmail.com</a>><br>
> To: "Jess Sightler" <<a href="mailto:jsightle@redhat.com">jsightle@redhat.com</a>><br>
> Cc: <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> Sent: Monday, January 20, 2014 10:28:40 AM<br>
> Subject: Re: [wildfly-dev] Hibernate Bug (tables starting with "and")...<br>
><br>
> Question would be more suitable for hibernate-dev mailing list.<br>
> but in any case i am pretty sure your fix is wrong, given that you can<br>
> achieve what you want different way.<br>
><br>
> see<br>
> <a href="http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-quotedidentifiersfor" target="_blank">http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-quotedidentifiersfor</a><br>
> more details.<br>
> or even<br>
> <a href="http://stackoverflow.com/questions/9463240/how-to-configure-hibernate-to-put-quotes-around-table-names" target="_blank">http://stackoverflow.com/questions/9463240/how-to-configure-hibernate-to-put-quotes-around-table-names</a><br>
><br>
> --<br>
> tomaz<br>
><br>
><br>
> On Mon, Jan 20, 2014 at 4:08 PM, Jess Sightler <<a href="mailto:jsightle@redhat.com">jsightle@redhat.com</a>> wrote:<br>
><br>
> > Is there any chance of getting a fix for this into the 8.0.0.Final release?<br>
> > <a href="https://github.com/hibernate/hibernate-orm/pull/658" target="_blank">https://github.com/hibernate/hibernate-orm/pull/658</a><br>
> ><br>
> > It seems to break a lot of generated queries on tables starting with "and".<br>
> > _______________________________________________<br>
> > wildfly-dev mailing list<br>
> > <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
> ><br>
><br>
<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a></div></div></blockquote></div><br></div>