Hi all,
Here is the code I have:
Code:
Configuration config = new Configuration();
// Tell it about the classes we want mapped, taking advantage of
// the way we've named their mapping documents.
config.addClass(gov.nih.nci.caBIO.bean.Gene.class).
addClass(gov.nih.nci.caBIO.bean.Pathway.class).
addClass(gov.nih.nci.caBIO.bean.ExpressionMeasurement.class).
addClass(gov.nih.nci.caBIO.bean.ArrayReporterMap.class).
addClass(gov.nih.nci.caBIO.bean.GeneReporter.class).
addClass(gov.nih.nci.caBIO.bean.PathwayGene.class);
// Get the session factory we can use for persistence
SessionFactory sessionFactory = config.buildSessionFactory();
// Ask for a session using the JDBC information we've configured
Session session = sessionFactory.openSession();
sqlStr = "select p.* " +
"from BIO_Pathways p, Gene g, Reporter r, Pathway_Gene_Object pg, " +
"Gene_Reporter gr " +
"where pg.pathway_id = p.pathway_id and pg.gene_id = g.gene_id " +
"and gr.gene_id = g.gene_id and gr.reporter_id = r.reporter_id ";
net.sf.hibernate.Query query = null;
query = session.createQuery(sqlStr);
java.util.List c = query.list();
When I run it, I get the following exception. Any ideas as to why and what it means? It is weird that the sql statement getting printed out has gov.nih.nci.caBIO.bean.Gene g instead of Gene g!
Code:
gov.nih.nci.common.persistence.PersistenceException: Error getting objects; nest
ed exception is:
net.sf.hibernate.QueryException: in expected: p [select p.* from BIO_Pat
hways p, gov.nih.nci.caBIO.bean.Gene g, Reporter r, Pathway_Gene_Object pg, Gene
_Reporter gr where pg.pathway_id = p.pathway_id and pg.gene_id = g.gene_id and g
r.gene_id = g.gene_id and gr.reporter_id = r.reporter_id ]
net.sf.hibernate.QueryException: in expected: p [select p.* from BIO_Pathways p,
gov.nih.nci.caBIO.bean.Gene g, Reporter r, Pathway_Gene_Object pg, Gene_Reporte
r gr where pg.pathway_id = p.pathway_id and pg.gene_id = g.gene_id and gr.gene_i
d = g.gene_id and gr.reporter_id = r.reporter_id ]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.ja
va:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149
)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138
)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.
java:293)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1561)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1532)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at gov.nih.nci.common.persistence.DefaultPersistenceManager.search(Unkno
wn Source)
at gov.nih.nci.common.manager.DefaultObjectManager.search(Unknown Source
)
at gov.nih.nci.common.remote.rmi.RMIObjectManagerRemote.search(Unknown S
ource)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
Any help would be appreciated,
Payam.