Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] QueryException: Missing descriptor for [class java.sql.Timestamp]

Hello Gili,

The class parameter to createNativeQuery must be an Entity class you want built from the results.  If all you want is data, just specify the query string with no other parameters:
  Query query = em.get().createNativeQuery("select log from playlist_log as log");

Best Regards,
Chris
----- Original Message -----
From: "Cowwoc" <cowwoc@xxxxxxxxxxxxxxxx>
To: "Eclipselink-Users" <eclipselink-users@xxxxxxxxxxx>
Sent: Monday, December 15, 2008 7:34:25 o'clock PM (GMT-0500) America/New_York
Subject: [eclipselink-users] QueryException: Missing descriptor for [class java.sql.Timestamp]


Hi,

When I invoke:

Query query = em.get().createNativeQuery("select log from playlist_log as
log", Timestamp.class);
for (Object o: query.getResultList())
	System.out.println(o);

I get this exception on getResultList():

Exception [EclipseLink-6007] (Eclipse Persistence Services - 1.0.1 (Build
20080905)): org.eclipse.persistence.exceptions.QueryException
Exception Description: Missing descriptor for [class java.sql.Timestamp].
Query: ReadAllQuery(java.sql.Timestamp)
        at
org.eclipse.persistence.exceptions.QueryException.descriptorIsMissing(QueryException.java:417)
        at
org.eclipse.persistence.queries.ObjectLevelReadQuery.checkDescriptor(ObjectLevelReadQuery.java:546)
        at
org.eclipse.persistence.queries.ObjectLevelReadQuery.prePrepare(ObjectLevelReadQuery.java:1642)
        at
org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrePrepare(ObjectLevelReadQuery.java:632)
        at
org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:615)
        at
org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:429)
        at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:611)
        at
org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:840)
        at
org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:456)
        at
org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:902)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2587)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1178)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1162)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1136)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1118)
        at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:399)
        at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:517)


Any ideas?

Gili
-- 
View this message in context: http://www.nabble.com/QueryException%3A-Missing-descriptor-for--class-java.sql.Timestamp--tp21025078p21025078.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top