From: Stephen F. (JIRA) <no...@at...> - 2006-03-16 15:37:51
|
one-to-many fails on oracle if field starts with underscore ----------------------------------------------------------- Key: HHH-1573 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH= -1573 Project: Hibernate3 Type: Bug Components: core =20 Versions: 3.1.2 =20 Reporter: Stephen Friedrich Hibernate generates SQL that is invalid on Oracle, because it has fields in= the select clause that start with an underscore. This is my field declaration: @OneToMany(cascade =3D CascadeType.ALL, fetch =3D FetchType.EAGER, mapp= edBy =3D "_user") private Set<Permission> _permissions =3D new HashSet<Permission>(); And this is the generated SQL: select =09_permissio0_.user_id as user4_2_, =09_permissio0_.id as id2_,=20 =09_permissio0_.id as id40_1_,=20 =09_permissio0_.version as version40_1_,=20 =09_permissio0_.guid as guid40_1_,=20 =09_permissio0_.user_id as user4_40_1_,=20 =09_permissio0_2_.company_reference_id as company2_42_1_,=20 case =09when _permissio0_1_.permission_id is not null then 1=20 =09when _permissio0_2_.permission_id is not null then 2=20 =09when _permissio0_.id is not null then 0 end as =09clazz_1_, =09companyref1_.id as id43_0_, =09companyref1_.version as version43_0_, =09companyref1_.guid as guid43_0_, =09companyref1_.db_user_name as db4_43_0_,=20 =09companyref1_.company_name as company5_43_0_=20 from=20 =09permissions _permissio0_=20 =09left outer join admin_permissions _permissio0_1_ on _permissio0_.id=3D_p= ermissio0_1_.permission_id=20 =09left outer join company_permissions _permissio0_2_ on _permissio0_.id=3D= _permissio0_2_.permission_id=20 =09left outer join company_references companyref1_ on _permissio0_2_.compan= y_reference_id=3Dcompanyref1_.id=20 where _permissio0_.user_id=3D? When executed Oracle gives this error: "ORA-00911: Ung=C2=B3ltiges Zeichen"= ("invalid character" in german) If I remove the underscore in front of every occurence of "_permissio..." t= hen I can execute the SQL fine on the command line ("?" replaced by 1). This has been reported on the forum, but nobody answered. See last post in= =20 http://forums.hibernate.org/viewtopic.php?t=3D929011&highlight=3Dora00911&s= id=3Dc501920d028c78899884f5bfac8e827e --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |