Thread:
 Performance and memfootprint optimisation 
 KnisterPeter   17 Jul 2005, 21:08 
 Re: Performance and memfootprint optimisation 
 sorenlarsen   28 Jul 2005, 05:46 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: KnisterPeter (17 Jul 2005, 21:08) Replies: 1, Views: 36953
Subject: Performance and memfootprint optimisation
For sake of performace this method should be slightly modified:
[code]
    public Object nullSafeGet(ResultSet resultSet, String[] names,
Object owner) throws HibernateException, SQLException { 
        String name = resultSet.getString(names[0]); 
        E result = null; 
        if (!resultSet.wasNull()) { 
            result = Enum.valueOf(clazz, name); 
        } 
        return result; 
    } 
[/code]
to
[code]
    public Object nullSafeGet(ResultSet resultSet, String[] names,
Object owner) throws HibernateException, SQLException { 
        E result = null; 
        if (!resultSet.wasNull()) { 
            String name = resultSet.getString(names[0]); 
            result = Enum.valueOf(clazz, name); 
        } 
        return result; 
    } 
[/code]
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]