-->
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.  [ 4 posts ] 
Author Message
 Post subject: Web services and returning arrays
PostPosted: Thu Feb 24, 2005 5:45 am 
Newbie

Joined: Fri Dec 10, 2004 1:52 am
Posts: 5
Hi,

I've a peculier problem.

Web services created using Axis do not encourage usage of collections...

And hibernate requires index to be stored in DB to use arrays...otherwise one needs to use bag or list...

I cannot alter our DB schema...So, is there any way that I can use Hibernate with web services backend system in many-to-many and one-to-many relationships?

Thanks.


Top
 Profile  
 
 Post subject: re: Web services and returning arrays
PostPosted: Sun Feb 27, 2005 1:34 am 
Newbie

Joined: Sun Feb 06, 2005 1:42 pm
Posts: 4
>
> And hibernate requires index to be stored in DB to use arrays...
>

If by "index" you mean primary key, then yeah, but your primary key can be a composite key made out of whatever columns happen to be in your DB. Check out the docs for using composite keys. If you're saying that the existing DB table doesn't have any columns that could comprise a primary key then yes you have a problem, but then you'd have the same problem with any ORM tool.

>
> Web services created using Axis do not encourage usage of collections...
>

I assume you're talking about parameters in the web service call. Axis doesn't care what you use in the body of the web service code though, so presumably you could convert the parameters into a Collection if that's what you really wanted? Sorry, but it's not clear from your post what you're trying to do.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 2:08 am 
Newbie

Joined: Fri Dec 10, 2004 1:52 am
Posts: 5
If by "index" you mean primary key, then yeah, but your primary key can be a composite key made out of whatever columns happen to be in your DB. Check out the docs for using composite keys. If you're saying that the existing DB table doesn't have any columns that could comprise a primary key then yes you have a problem, but then you'd have the same problem with any ORM tool.

Hibernate <list> mapping can use arrays as well as java Lists. But it requires a column in DB that specifies 'position' of the element in the array which will be maintained while storing and retrieving it.

This practice of additional column in every table that is on 'many' side of any mapping is not a standard DB design as far as I know. Normally most people would need a <bag> semantics, and order will be decided by user clicking on a column on the web page.

I assume you're talking about parameters in the web service call. Axis doesn't care what you use in the body of the web service code though, so presumably you could convert the parameters into a Collection if that's what you really wanted? Sorry, but it's not clear from your post what you're trying to do.

Yes, I'm talking about parameters and return values of Axis web services. Yes, writing rappers over all the collections would be a solution, but then writing simple SQL becomes a fast option for me.

Please let me know if you know anything about what to do in such situations.

Thanks.


Top
 Profile  
 
 Post subject: Web services and returning arrays
PostPosted: Mon Feb 28, 2005 7:24 pm 
Newbie

Joined: Mon Feb 28, 2005 7:10 pm
Posts: 1
Location: Austin, TX
I use axis quite a bit with Hibernate and I think I understand your issue.

What I've done is implemented an alternate PropertyAccessor for collection mappings that work on underlying collection (for example idbag) but because of axis / web services needs to actually be an array.

So ultimately there are wrappers that translate between array/collection semantics but only the alternate property accessor has to use them.

Scott


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.