Matthias Sommer

Greenhorn
+ Follow
since May 20, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Matthias Sommer

Hi,

I've just experienced quite a strange thing - I had a webservice, which returns array of simple Java beans with couple of properties of simple types (int and Strings) as follows:



Serialized to SOAP-XML, it used to look like this:



This was OK, but after I re-deployed the WS without changing structure of Channel bean, format has suddenly changed to this:



Where channelId and defaultOrder are now references to another tags, which is WRONG and now I cannot make it behave like before. Does anybody have an idea why the output has changed and how to make it work like before that change? My deply.wsdd looks like this:



thanks to all, any suggestion is highly appreciated
Matthias
14 years ago
Thank you, man! That's what I needed - I could not figure out right expression for WHERE clause and that's it: WHERE ct IN (:typeList)! Now it works as desired.

thanks again
Matthias
Hi there,

I'd like to ask for an advice with a problem regarding OneToMany/ManyToMany mappings. Basically, what I'd like to do is to create named query like this:

<code>"SELECT ch FROM channel ch WHERE ch.channelTypes IN (:typeList)"</code>

where :typeList parameter is collection of desired ChannelType instances (or Integers, if necessary).

channelTypes field in Channel entity is ManyToMany mapping defined as following:

<code>
@ManyToMany(targetEntity=ChannelType.class, cascade = CascadeType.ALL)
@JoinTable(name = "channel_type_rel", joinColumns = { @JoinColumn(name = "channel_id", referencedColumnName = "channel_id") }, inverseJoinColumns = { @JoinColumn(name = "channel_type_id", referencedColumnName = "channel_type_id") })
private List<ChannelType> channelTypes;
</code>

Resulting SQL query then should look like this:

<code>SELECT ch.* FROM channel ch LEFT JOIN channel_type_rel ctr ON (ctr.channel_id = ch.channel_id) LEFT JOIN channel_type ct ON (ctr.channel_type_id = ct.channel_type_id) WHERE ct.channel_type_id IN (:channelTypes) </code>

Apparently, this does not works, so I'd like to ask if there's some way how to achieve this (does not matter how), preferably with pure JPQL, as code is deployed to two environments, one with Hibernate and the other with TopLink. If it's not possible with pure JPQL, HQL is preferred then.

many thanks in advance
Matthes