Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink-MONGODB search not working(EclipseLink-MONGODB search not working)
EclipseLink-MONGODB search not working [message #1382892] Mon, 26 May 2014 05:51
Chandre Gowda is currently offline Chandre GowdaFriend
Messages: 35
Registered: April 2013
Member
Hello,

Iam using Eclipselink-MONGODB to persist and retrieve models in my application.
Currently I have RepositoryItem class which has childrens like Model, Folder etc.
But whenever I do search using Criteriabuilder, for model or folder, i always end up in below exception

<code>
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<RepositoryItem> criteriaQuery = criteriaBuilder.createQuery(RepositoryItem.class);
final Root<RepositoryItem> root = criteriaQuery.from(RepositoryItem.class);
final Predicate dbColumnName = criteriaBuilder.equal(root.get("name"), "Model-22");
criteriaQuery.where(dbColumnName);
final List<RepositoryItem> resultList = entityManager.createQuery(criteriaQuery).getResultList();
</code>

<Excpetion detail>

Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-90000] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.eis.EISException
Internal Exception: java.lang.IllegalArgumentException: can't serialize class org.eclipse.persistence.internal.helper.DatabaseField
Error Code: 000
Call: Executing MappedInteraction()
spec => null
properties => {mongo.collection=REPOSITORYITEM, mongo.operation=FIND}
input => [DatabaseRecord(
$and => [DatabaseRecord(
REPOSITORYITEM.NAME => Model-22), DatabaseRecord(
$and => [DatabaseRecord(
MODEL._id => REPOSITORYITEM._id), DatabaseRecord(
REPOSITORYITEM.DTYPE => Model)])])]
Query: ReadAllQuery(referenceClass=RepositoryItem )
at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:377)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:260)
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:468)
at com.DAOService.getQueryObject(DAOService.java:261)
at com.DAOService.main(DAOService.java:162)
Caused by: Exception [EclipseLink-90000] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.eis.EISException
Internal Exception: java.lang.IllegalArgumentException: can't serialize class org.eclipse.persistence.internal.helper.DatabaseField
Error Code: 000
Call: Executing MappedInteraction()
spec => null
properties => {mongo.collection=REPOSITORYITEM, mongo.operation=FIND}
input => [DatabaseRecord(
$and => [DatabaseRecord(
REPOSITORYITEM.NAME => Model-22), DatabaseRecord(
$and => [DatabaseRecord(
MODEL._id => REPOSITORYITEM._id), DatabaseRecord(
REPOSITORYITEM.DTYPE => Model)])])]
Query: ReadAllQuery(referenceClass=RepositoryItem )
at org.eclipse.persistence.eis.EISException.resourceException(EISException.java:65)
at org.eclipse.persistence.eis.EISException.resourceException(EISException.java:74)
at org.eclipse.persistence.eis.EISException.resourceException(EISException.java:78)
at org.eclipse.persistence.eis.EISAccessor.basicExecuteCall(EISAccessor.java:212)
at org.eclipse.persistence.eis.EISAccessor.executeCall(EISAccessor.java:112)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1995)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromConcreteTable(ExpressionQueryMechanism.java:2705)
at org.eclipse.persistence.descriptors.InheritancePolicy.selectAllRowUsingDefaultMultipleTableSubclassRead(InheritancePolicy.java:1394)
at org.eclipse.persistence.descriptors.InheritancePolicy.selectAllRowUsingMultipleTableSubclassRead(InheritancePolicy.java:1440)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2664)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:477)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1155)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1114)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:402)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1202)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2894)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1797)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1779)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1744)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
... 3 more


Thanks
Chandru
Previous Topic:Eclipselink 2.3 deadlock issues
Next Topic:Stored Procedures
Goto Forum:
  


Current Time: Tue Jun 30 12:53:10 GMT 2015

Powered by FUDForum. Page generated in 0.02846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software