Results 1 to 4 of 4

Thread: spring+hibernate+hessian Lists problem (again?)

  1. #1
    Join Date
    Jan 2005
    Location
    Essex, England
    Posts
    2

    Default spring+hibernate+hessian Lists problem (again?)

    I'm sure that many other people must experience the problem of not being able to return lists of objects created by getHibernateTemplate() to a remote client via Hessian - they end up as an ArrayList of Hashmaps. I have seen a few solutions on the web but do not seem to be able to get any of them to work for me. I am not running Spring or Hibernate on the client just Hessian.

    Can anyone tell me what the current "standard" solution to this problem is? Or should it all work out-of-the-box and I'm just doing it wrong?

    I am using Spring 1.1.15 and the Hessian and Hibernate jars that come with it.

  2. #2
    Join Date
    Feb 2005
    Posts
    217

    Default

    lists of objects created by getHibernateTemplate() to a remote client via Hessian - they end up as an ArrayList of Hashmaps.
    That's a weird one. Does the hashmap look like the column name and values of each row?

    Can you force your List into an Object[] array and then transmit that via hessian?

  3. #3
    Join Date
    Jan 2005
    Location
    Essex, England
    Posts
    2

    Default

    Since I posted I have changed to return an Object[]...

    public Object[] findCatalogues() throws DataAccessException {
    return getHibernateTemplate().find("from Catalogue catalogue").toArray();
    }
    ... but I still have the same problem/result. The HashMap has an entry for each column in the table, the key is the column name and the value is the value of the column/row. One entry in the Object[] for each row.

    For the time being, I am just creating the required object from the parts but I cannot believe there isnt a better way.

  4. #4
    Join Date
    Feb 2005
    Posts
    217

    Default

    Do you have any lazy relationships in that object? Perhaps they aren't being loaded up.

    By "return an Object[]" I mean more of a "return a Foo[]" where Foo is your object, so that you're forcing your getHibernate() results into an array of the same type as what you expected to get back from the query.

Similar Threads

  1. Replies: 5
    Last Post: Feb 3rd, 2009, 05:19 AM
  2. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  3. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Replies: 5
    Last Post: Aug 27th, 2004, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •