-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate and DB Views in MySQL
PostPosted: Thu Jun 26, 2008 12:24 pm 
Newbie

Joined: Thu Jun 26, 2008 8:59 am
Posts: 9
Location: Dublin, Ireland
Hi guys,

Please help me find what we're doing wrong here, this is happening across all our dev machines. We added a view to our DB to allow us to order by a certain column but when we try call the view from hibernate it kills MySQL. We are just using the views as we would a table




Hibernate version: 3.2.6

Mapping documents:
Anotations

Code between sessionFactory.openSession() and session.close():
Code:
public List<MasterListView> getRecords(long start, Integer numRecords,
         String sortField, Boolean asc, List<QueryField> qryFields,
         Date fromDate, Date toDate, Long classificationID) {
      Criteria criteria = getHibernateTemplate().getSessionFactory()
            .getCurrentSession().createCriteria(MasterListView.class);

      
      super.addFilterCriteria(criteria, qryFields, sortField, asc);

      if (fromDate != null || toDate != null) {
         super.addDateCriteria(criteria, fromDate, toDate);
      }

      if (classificationID != null) {
         addClassificationCriteria(criteria, classificationID);
      }

      super.addNumLimitCriteria(criteria, start, numRecords);

      return criteria.list();
   }


Full stack trace of any exception that occurs:
None MySQL just crashes

Name and version of the database you are using:
MySQL community 5.0.41

The generated SQL (show_sql=true):
Code:
select this_.id as id39_0_, this_.adCallRouting as adCallRo2_39_0_, this_.adTargeting as adTarget3_39_0_, this_.booyah as booyah39_0_, this_.brand as brand39_0_, this_.channel as channel39_0_, this_.classification as classifi7_39_0_, this_.contact as contact39_0_, this_.description as descript9_39_0_, this_.domain as domain39_0_, this_.fallbackEnabled as fallbac11_39_0_, this_.googleChannel as googleC12_39_0_, this_.googleClient as googleC13_39_0_, this_.googleClientParent as googleC14_39_0_, this_.googleConsole as googleC15_39_0_, this_.ingenio as ingenio39_0_, this_.invocation as invocation39_0_, this_.isBulkUpload as isBulkU18_39_0_, this_.isMarketPlace as isMarke19_39_0_, this_.isSticky as isSticky39_0_, this_.locale as locale39_0_, this_.modifiedDate as modifie22_39_0_, this_.outputFormat as outputF23_39_0_, this_.product as product39_0_, this_.publishedDate as publish25_39_0_, this_.publishingType as publish26_39_0_, this_.searchBrand as searchB27_39_0_, this_.status as status39_0_, this_.subChannel as subChannel39_0_, this_.tafficEstimate as tafficE30_39_0_, this_.targetDate as targetDate39_0_ from MASTER_LIST_VIEW this_ order by this_.id asc limit ?



Debug level Hibernate log excerpt:


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

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.