[JBoss Seam] - org.jboss.seam.ui.entityConverter not working with set of en
by chandu_great
Hi,
The entity converter is not working with a set of entities.
I think, the entity converter(org.jboss.seam.ui.entityConverter) doesn't hanlde Set of entities. Its handles only Lists or Collection of entities.
In components.xml, I had an entity query(shown below) which was generating a lot of queries.
<framework:entity-query scope="EVENT" name="users" ejbql="select u from User u" order="username" />
In User class(User.java) I had a collection of entities defined as
protected List roles = new ArrayList();
I changed the semantics from bag/collection to set, that is,
protected Set roles = new HashSet();
In order to reduce a number of queries, I tried to use 'left join fetch' query (shown below) which is not working in case of list or collection of entities. But it is working in case of set of entities(:-).
<framework:entity-query scope="EVENT" name="usersAdmin" ejbql="SELECT DISTINCT object(u) from User u left join fetch u.groups left join fetch u.roles" order="username" />
Now When I tried to save a record, I am getting conversion error :-(.
I checked the entity converter sources. I think the entity converter has no problem working out the value type. In the case of a collection the entity converter must check the type of an item in the value object, rather than the value object itself. I guess that it has code to do this in the case of a list but not a set.
Am I thinking right? Any guidance on this issue will be very helpful if someone can throw light on this. Is there any workaround to get rid of this entity conversion problem in case of a set of entities?
I am a newbie.
Thanks.
Chandra
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099250#4099250
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099250
18Â years, 6Â months
[JBoss Seam] - Re: Let's use component scope before lookupInStatefulContext
by dmitriy.lapko
Yes, I thought about this - that such feature can influence outjection. But if I'm sure, that I wouldn't in any place outject any property with name, equal to my component name, I could just specify it in @Name annotation, like:
@Name(value = "loginBean", limitSearchByGivenScope="true")
So in method lookupInStatefulContext we can check if there is a component with such name and it is marked with a propery 'limitSearchByGivenScope', then it should search only in given scope.
If I suppose, that I would use this possibility to overwrite component by outjected object, I would't use this option.
Really, I spent last 2 days JProfiling my application and see method getInstance in my hotspots. Too much of calls to method BaseContext.get and ServerConversationContext.isPerNestedConversation...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099249#4099249
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099249
18Â years, 6Â months