Looking for an example. I wonder if someone in the community has done this. I think using createNativeQuery() would be preferable. I have 4 tables that are not part of the dspace code that I need to manipulate.
Thanks! -Jose On Thu, Feb 20, 2020 at 1:01 PM Tim Donohue <[email protected]> wrote: > Hi Jose, > > That error from Hibernate usually means that you are trying to run a > straight SQL query when it's expecting you to use HQL (Hibernate Query > Language) and a Hibernate Entity object. So, more than likely you need to > do one of the following: > > > - Either, Create a Hibernate Entity class that maps to this Table. See > > https://docs.jboss.org/hibernate/annotations/3.5/reference/en/html/entity.html > This > is how DSpace 6.x (and above) already maps to existing tables...you'll see > an Entity object corresponding to every table in the codebase. > - Or, you might be able to tell Hibernate this is just a plain old SQL > query by using Hibernate's "createNativeQuery()" method instead of using > "createQuery()" (as the latter expects a Hibernate Entity). More info on > that is at > https://docs.jboss.org/hibernate/core/4.0/hem/en-US/html/query_native.html > > > Hopefully that helps. > > Tim > > ------------------------------ > *From:* [email protected] <[email protected]> on > behalf of Jose Blanco <[email protected]> > *Sent:* Thursday, February 20, 2020 10:42 AM > *To:* DSpace Technical Support <[email protected]> > *Subject:* [dspace-tech] new table in 6.3 > > I have a new table in 6.3 - individual_stats, and I'm seeing this error: > > org.hibernate.hql.internal.ast.QuerySyntaxException: individual_stats is > not mapped [SELECT count(*) FROM individual_stats WHERE email=' > [email protected]'] > > How do I map indiviual_stats table? > > Thank you! > -Jose > > -- > All messages to this mailing list should adhere to the DuraSpace Code of > Conduct: https://duraspace.org/about/policies/code-of-conduct/ > --- > You received this message because you are subscribed to the Google Groups > "DSpace Technical Support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dspace-tech/CAK%3DKc-uyfZ8QofBe2Mo9WKyPDSAA8vvOgh4HfsAM%3DJWGPFsNNw%40mail.gmail.com > <https://groups.google.com/d/msgid/dspace-tech/CAK%3DKc-uyfZ8QofBe2Mo9WKyPDSAA8vvOgh4HfsAM%3DJWGPFsNNw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/ --- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/CAK%3DKc-stwWTCxeu7C_gcMY30dj1OdXu5Jx5rLqas%3Dc%2BK4puYog%40mail.gmail.com.
