Menu

#130 is-accessible="true" option not work with interface mapping

open
nobody
None
5
2008-01-23
2008-01-23
ed
No

Sorry guys, but I think it's better to report this as a bug. I first reported it as a feature request, but I think it's a bug.
That is: when using an interface mapping, using the field option [is-accessible="true"] will throw an exception as it tries to access the field on the interface.
Instead it should use the custom factory to first request an instance of the interface implementation.
I think this bug has a lot to do with my earlier bug report 1877216
The feature request earlier:
-----
t would be very convenient if you could use interfaces in dozer mapping
file in combination with the option [is-accessible="true"].
Now this isn't possible, as I explain in my forum post:
http://sourceforge.net/forum/forum.php?thread_id=1864420&forum_id=452530

What happens now: dozer reads this options and tries to access the field
directly on the interface defined in the dozer configuration. It should
however first create a new instance through the factory defined in the
dozer mapping and then access field.
So I think the order of these two actions should be changed (first create
new instance, access field).

If you have an questions, please email me.
-----

And the additional feedback with the request:
---------
I forgot to mention why this is very convient:
Suppose you have an object that you give to a client (in my case: a gwt
client), which contains fields like dateCreation, dateModified and
loginFailureCount.
You don't want the client to be able to access them, as such you don't
want any setters on these objects.
Why ?
Because when you receive the modified object back in the backend, you
basically just want to use hibernate saveOrUpdate() on the modified object,
after you have use dozer to copy back the object.
But wit the setters, the fields might be changed, which ofcourse you don't
want, which means you have check this and do more coding before saving....
and ofcourse you don't want that.
----

Good luck,
Ed

Discussion


Log in to post a comment.

MongoDB Logo MongoDB