• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate AND Axis2 problem

 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I'm using detached hibernate pojos and Axis2 for exposing some data to webservices. I can't use Bidirectional mapping because when I serialize to Axis2 the xml goes in an eternal loop.

ex.

Customer Class with MarketToLanguage set
MarketToLanguage with reference to customer class

This ends up with an eternal loop when I try to serialize it to Axis. See this topic for more information


I have solved it by not using bidirectional mapping .

ex
I have a Customer, Market, And Language class, They are mapped together by A MarketToLanguage class.




Language and Markets looks pretty much the same. Here is the MarketToLanguage class


the mapping maps many-to-one in MarketToLanguage.hbm.xml for Language, Customer and Market.



I have done this so that I wont serialize the whole object graphs when exposing it as webservice. There are of course several other classes in this but I think you get the id�

First question: Any help on a better way of implementing Hibernate and Axis2?

Second question: When I delete a Customer I want all the MarketToLanguage that has that Customer to be deleted. I can't get this to work because there isn't any Set to add on-delete for in the Customer class since the Customer is unaware of the MarketToLanguage

How can I delete MarketToLanguages when I delete a Customer?

Hope you know what I meen
[ September 23, 2007: Message edited by: Mathias Nilsson ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how did you manage to send back a list of objects from the service to your client. Your help would be greatfull
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use RPCServiceClient and just call the WebService

The returntype must be Object[].class. Or whatever object you are returning. You must use array and not List because axis only supports array. If you have implemented it as List use the List.toArray()
reply
    Bookmark Topic Watch Topic
  • New Topic