-->
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: Problem again with upgrade hibernate 3
PostPosted: Mon Sep 19, 2005 12:21 am 
Newbie

Joined: Fri Sep 09, 2005 5:15 am
Posts: 2
I have some problem again in hibernate 3 :

1. In my HibernatePersistenceManager.java, there is method find() (that is a source code). This method is not compatible with org.hibernate.classic.Session, what should I change?
public List findAllSorted(Class type, String sortField) {
try {
String query = "FROM result IN CLASS " + type.getName();
if (sortField != null)
query += " ORDER BY LOWER(result." + sortField + ")";

return session.find(query);
} catch (Exception e) {
throw new PersistenceException(e);
}
}

public List find(String query, Object[] parameters, Class[] parameterTypes) {
Session session = null;
List results = null;

try {
session = this.session;

if ((parameterTypes != null) || (parameters != null)) {
Type[] hibernate_parameter_types = getHibernatedParameterTypes(parameterTypes);

results = session.find(query, parameters, hibernate_parameter_types);

} else {
results = session.find(query);
return session.createQuery(query).list();
}

return results;
} catch (Exception e) {
throw new PersistenceException(e);
}
}

2. I need a presentation from Rod Johnson (Persistence Strategy Overview), where can I get this?
And can u tell me about tutorial hibernate and building simple application in MVC using hibernate 3, pliss tell me (except in www.hibernate.org).


Top
 Profile  
 
 Post subject: plese try to limit to one question per post
PostPosted: Mon Sep 19, 2005 11:36 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Firsly look at migration guide: http://hibernate.org/250.html

therefore "FROM result IN CLASS zzzz" should not work

and querying is a bit different now:

session.createQuery( "some HQL where v=?").setString(0,"value").list();

or

session.createQuery( "some HQL where v = :vv").setString("vv","value").list();

>>presentation from Rod Johnson (Persistence Strategy Overview)
http://media.techtarget.com/tss/BeJUG/P ... index.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.