]
Gail Badner resolved HHH-4903.
------------------------------
Assignee: Gail Badner
Resolution: Duplicate
Ambiguous column in field list
------------------------------
Key: HHH-4903
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4903
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-4
Environment: O.S.: Linux 2.6.28-18-generic #59-Ubuntu SMP Thu Jan 28 01:40:19 UTC
2010 x86_64 GNU/Linux
Java.: Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
Web server: jetty-hightide-7.0.1.v20091125
DB Server: mysql Ver 14.14 Distrib 5.1.31, for debian-linux-gnu (x86_64) using EditLine
wrapper
Reporter: Luis Eduardo Villares Matta
Assignee: Gail Badner
Priority: Blocker
When executing entityManager.find(ClassName.class, pk) caught the exception below.
Entities involved in the query below do not have any inheritance relationship (just
composition), but they all contain a field named "private" (column name
"_private")
Hibernate:
select
libraryite0_.id as id2_2_,
libraryite0_.active as active2_2_,
libraryite0_.createdDate as createdD3_2_2_,
libraryite0_.deleted as deleted2_2_,
libraryite0_.updatedDate as updatedD5_2_2_,
libraryite0_.defaultLocale as defaultL6_2_2_,
libraryite0_.name as name2_2_,
libraryite0_.parentId as parentId2_2_,
_private as column8_2_2_,
libraryite0_.typeId as typeId2_2_,
libraryite1_.id as id2_0_,
libraryite1_.active as active2_0_,
libraryite1_.createdDate as createdD3_2_0_,
libraryite1_.deleted as deleted2_0_,
libraryite1_.updatedDate as updatedD5_2_0_,
libraryite1_.defaultLocale as defaultL6_2_0_,
libraryite1_.name as name2_0_,
libraryite1_.parentId as parentId2_0_,
_private as column8_2_0_,
libraryite1_.typeId as typeId2_0_,
libraryite2_.id as id5_1_,
libraryite2_.active as active5_1_,
libraryite2_.createdDate as createdD3_5_1_,
libraryite2_.deleted as deleted5_1_,
libraryite2_.updatedDate as updatedD5_5_1_,
libraryite2_.folderish_ as folderish6_5_1_,
libraryite2_.libraryId as libraryId5_1_,
libraryite2_.name as name5_1_,
libraryite2_.xsd_ as xsd8_5_1_,
libraryite2_.xpaths_ as xpaths9_5_1_
from
TKBMLibraryItem libraryite0_
left outer join
TKBMLibraryItem libraryite1_
on libraryite0_.parentId=libraryite1_.id
left outer join
TKBMLibraryItemType libraryite2_
on libraryite1_.typeId=libraryite2_.id
where
libraryite0_.id=?
174363 [qtp1469937134-21] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error:
1052, SQLState: 23000
174363 [qtp1469937134-21] ERROR org.hibernate.util.JDBCExceptionReporter - Column
'_private' in field list is ambiguous
174363 [qtp1469937134-21] INFO org.hibernate.event.def.DefaultLoadEventListener - Error
performing load command
org.hibernate.exception.ConstraintViolationException: could not load an entity:
[com.totvs.kbm.model.LibraryItemModel#10128]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:95)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1916)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
at
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3212)
at
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:437)
at
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:418)
at
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
at
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223)
at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:538)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:513)
at com.totvs.kbm.service.KnowledgeService.getLibraryItem(KnowledgeService.java:476)
at
org.apache.jsp.html.kbm.rootitemsnavigation_jsp._jspService(org.apache.jsp.html.kbm.rootitemsnavigation_jsp:179)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
at com.totvs.kbm.core.web.RequestPipeline.doFilter(RequestPipeline.java:132)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:457)
at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:334)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Column '_private' in field list is ambiguous
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2228)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1827)
at org.hibernate.loader.Loader.doQuery(Loader.java:714)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1902)
... 45 more
2010-02-10 14:48:50.375:WARN::/html/kbm/rootitemsnavigation.jsp
javax.persistence.PersistenceException:
org.hibernate.exception.ConstraintViolationException: could not load an entity:
[com.totvs.kbm.model.LibraryItemModel#10128]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1197)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:558)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:513)
at com.totvs.kbm.service.KnowledgeService.getLibraryItem(KnowledgeService.java:476)
at
org.apache.jsp.html.kbm.rootitemsnavigation_jsp._jspService(org.apache.jsp.html.kbm.rootitemsnavigation_jsp:179)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
at com.totvs.kbm.core.web.RequestPipeline.doFilter(RequestPipeline.java:132)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:457)
at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:334)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:619)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: