[JBoss Seam] - Re: Challenge: Simple Example Adding Records With Lookup Dro
by Newlukai
No problem.
But ... erm ... I've another question: In my application there is a table which contains priorities. The table contains two columns: the ID and the description of the priority. On some pages the user can filter all shown entries by priority. Adding a noSelectionLabel the user has also the option to disable the filtering.
But now the user should be able to filter for priorities greater or less than a distinct value, say 3. So I want to add two further rows in the si:selectItems which have this special meaning. I know that the EntityConverter can't handle rows, which are created in my bean and not persisted in the database.
So I think the best solution would be a custom converter which handles the special meanings and invokes the EntityConverter for all the other cases.
Is that possible?
Has to be something like this (got it from the wiki):
public Converter getPriorityConverter() {
| return new PriorityConverter<Priority>() {
|
| protected Object getIdAsObject(String id, Class clazz) {
| int priority = Integer.parseInt(id);
| if(priority == -2) return SpecialPriorities.GREATER_3;
| if(priority == -3) return SpecialPriorities.LESS_3;
| Converter entityConverter = new EntityConverter();
| return entityConverter.getIdAsObject(id, clazz);
| }
|
| protected String getIdAsString(Priority entity) {
| return entity.getId() + " (" + entity.getDescription() + ")";
| }
| };
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988735#3988735
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988735
19Â years, 5Â months
[EJB 3.0] - Problems with self referencing entites
by martin ganserer
Hello,
I have got an entity bean let's call it users. This entity has a many to many relationship to other user entity beans.
Basically everything works fine but I have got a problem when I want to get really all users of one user.
(A user consists of many users and one of these users can have further users and so on)
I really tried everything:
- setup an ejbQL statement -> didn't work
- defining a stateless session bean that performs recursive calls -> this failed because SLSB might have problems with recursive invocations.
Is there anybody that faces the same problems or might have found a solution for my problem? To be honest I really don't care about the implementation itself. It must "only" work!
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988731#3988731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988731
19Â years, 5Â months