"from Company" is enough, as documented here :
http://www.hibernate.org/hib_docs/reference/en/html_single/#manipulatingdata-querying

Anyway, I have done another project with 3.0M3 and the same query is working.
I've tried a "select * from company" and it's the same pb.

That's why I'm submittig this problem.

Thanks for your help


Selon Max Cooper <[EMAIL PROTECTED]>:

> I don't know hibernate's query language enough to be sure this is the
> problem, but "from Company" seems like an incomplete query, and the
> error message seems to indicate this as well. Shouldn't it be something
> mor like "select * from Company"? Or replace '*' with an explicit list
> of columns/attributes.
>
> -Max
>
> On Wed, 2005-01-26 at 10:37 +0100, [EMAIL PROTECTED] wrote:
> > Hi,
> >
> > I have a problem related to hibernate.
> >
> > I've created a simple <<Entity>> called Company.
> > I've added a <<FinderMethod>> called getCompanies() that is doing a simple
> > @andromda.hibernate.query "from Company".
> >
> > The generated code looks like that :
> >
> >    /**
> >      *
> >      *
> >      * Finds Company instance(s) using a query.
> >      */
> >     public static java.util.Collection
> getCompanies(net.sf.hibernate.Session
> > session)
> >         throws net.sf.hibernate.HibernateException
> >     {
> >         net.sf.hibernate.Query query = session.createQuery("from Company");
> >         return query.list();
> >     }
> >
> >
> > which looks nice. Anyway, it's a simple example.
> >
> > When I call this method on a SessionBean, I have a hibernate error in my
> jboss
> > logs :
> >
> > 10:07:25,009 INFO  [STDOUT] Hibernate: select  from
> > 10:07:25,017 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: 42601
> > 10:07:25,017 ERROR [JDBCExceptionReporter] ERROR: syntax error at or near
> "from"
> >
> > I'v tried other hibernate operations such as load object instance, save new
> > object, etc which works.
> >
> > Is my problem related to hibernate or to andromda?
> > Does anybody already had this problem?
> >
> >
> > Thankx in advance ;-)
> >
> > NB: using 3.0-RC1-SNAPSHOT
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> > Tool for open source databases. Create drag-&-drop reports. Save time
> > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> > Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> > _______________________________________________
> > Andromda-user mailing list
> > Andromda-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/andromda-user
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Andromda-user mailing list
> Andromda-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/andromda-user
>




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to