-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 3.5.0-Final SQLGrammarException
PostPosted: Fri Apr 02, 2010 6:49 pm 
Newbie

Joined: Sat Jul 19, 2008 1:29 am
Posts: 13
Hello. I am trying to upgrade from Hinernate 3.3

Error:
Code:
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query using scroll
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
   at org.hibernate.loader.Loader.scroll(Loader.java:2402)
   at org.hibernate.loader.criteria.CriteriaLoader.scroll(CriteriaLoader.java:114)
   at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1670)
   at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:361)
   at com.acula.dao.hibernate.AculaHibernateUtils.getTotalCount(AculaHibernateUtils.java:61)
   at com.acula.dao.hibernate.UserDaoHibernate$39.doInHibernate(UserDaoHibernate.java:1341)
   at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
   ... 118 more
Caused by: org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "role3_"


in my java code:

Code:

@ManyToMany(targetEntity = Role.class, fetch = FetchType.EAGER)
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    @JoinTable(name = "user_roles",
            joinColumns = {@JoinColumn(name = "user_id", nullable = false)},
            inverseJoinColumns = {@JoinColumn(name = "role_id", nullable = false)}
    )
    @BatchSize(size = 20)
    public Set<Role> getRoles() {
        return roles;
    }

...

Criteria cr = s.createCriteria(User.class);

                        cr.setProjection(Projections.projectionList()
                                .add(Projections.groupProperty("id"))
                        )
                                .createAlias("roles", "role")
....


Is it a workaround for this?


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5.0-Final SQLGrammarException
PostPosted: Sat Apr 03, 2010 9:20 am 
Newbie

Joined: Sat Jul 19, 2008 1:29 am
Posts: 13
In my old hibernate version all working fine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.