dozer

Dozer : primitive int -1 value to null object mapping

Is there a way to configure dozer via its xml mapping file to convert a primitive int field value of -1 to a null object reference? The legacy object model defaults the value to -1, so that zero can be a valid selection. The newer object model we are mapping to, assumes that non-selected values will be null, and that any initialized ...

Constants in dozer mappings

Hello, does anybody know how to put a constant value into an attribute with dozer? I haven't seen anything about that in the dozer's documentation ...

Dozer object on GAE/J

I'm trying to write application using GWT and GAE/J (Google AppEngine with Java). For my application i need to use DTO. In order to convert Pojo into JDO Entities I want to use Dozer library. So when i'm trying to convert object I'm getting following error: Jun 23, 2009 7:12:30 PM com.google.appengine.tools.development.ApiProxyLocalImpl...

Is there a data mapper like Dozer for c#

I am looking for something similar to Java's Dozer for C#, something that uses reflection to automatically maps the data fields in one object to another. A link to Dozer: http://dozer.sourceforge.net/ ...

Warning on Mac when use Dozer

I'm building application with GWT + GAE on my MAC. In this app i have DTO's and to convert from DTO to Persistent entities I'm using Dozer Library, its Mapper object. Everything compiles and runs fine on Windows but when I'm trying to run my app in hosted mode on MAC i'm getting following WARNING: The server is running at http://localho...

Dozer map Text to String

I'm using GWT and GAE for my project. I'm using data transfer objects and dozer to move data between client and server. Dozer had been working great, but I have some classes that need to store text that is over 500 characters, so I must use com.google.appengine.api.datastore.Text datatype in my server side object, but a regular String i...

Best Persistence API for use with GWT

What is the best persistence API for use with GWT? Sadly, the application will be hosted on my own java server, as I will need more control than GAE will give me. I know I will need to have two sets of my entities, one for the server side, and some pojo's for the client side. I'm looking to make the mapping of the data as simple as...

How to map collections in Dozer

I'd like to do something like: ArrayList<CustomObject> objects = new ArrayList<CustomObject>(); ... DozerBeanMapper MAPPER = new DozerBeanMapper(); ... ArrayList<NewObject> newObjects = MAPPER.map(objects, ...); Assuming: <mapping> <class-a>com.me.CustomObject</class-a> <class-b>com.me.NewObject</class-b> <field> <...

Dozer InstantiationException mapping Calendar class

I'm getting an InstantiationException when trying to map Date -> Calendar. Simple test follows: @Test public void testConversion() { GregorianCalendar cal = new GregorianCalendar(2009, 2, 3); Date sourceValue = cal.getTime(); DozerBeanMapper mapper = new DozerBeanMapper(); Object result = mapper.map(sour...

How to Map unset property to value without getting NullPointerException in Dozer

Using Dozer to map two objects, I have: /** /* This first class uses the GXT (ExtJS) framework **/ Class1 extends BaseModelData { public int getId() { return (Integer)get("id"); } public void setId(int id) { set("id", id); } // more properties } Class2 { public int getId() { return i...

Alternative to dozer for bean mapping?

I am trying to figure out an easy way to map DTOs to entities without the boiler-plate code. While I was thinking of using dozer it appears to require a lot of xml configuration. Has anybody seen a dozer alternative that uses a DSL to configure the bean mapping in pure Java? Ideally I am hoping to find a bean mapper that is inspired b...

Non-trivial Dozer mappings

I'm struggling to get Dozer to bend to my will for something that I feel should be quite simple. I have two similar models that I wish to map between, however one has a 'deeper' hierarchy than the other and this is causing me problems when dealing with collections. Consider the following classes: Source classes: class Foo { String ...

Map collection size in Dozer

Is there a way to map collection size in dozer? class Source { Collection<String> images; } class Destination { int numOfImages; } ...

Dozer: JAXBElements to Java Types?

Hi, I'm trying (with Dozer) to convert a JAXB DTO to a POJO (well, actually, to a JPA-annotated Hibernate entity before persisting it). The problem right now is that right now Dozer does not seem to convert elements from the JAXB JAXBElement<> type to the JAXBElement.getValue() type. So, for example, a JAXBElement s is translated to th...

How to turn off debugging for just dozer?

Is there a way to turn off debug logging for just dozer? At least without having to increase it above the debug level? ...

Mapping deep properties with intermediate collections in dozer

Suppose I have the following classes public class Baz { private List<Foo> foos = new ArrayList<Foo>(); } public class Foo { private String string; } public class Target { private List<String> fooStrings = new ArrayList<String>(); } Is there any mapping I can use to, given a Baz, map it to the target class and get a list of the...

Dozer Example Tutorial

Hi, Are there any good tutorials on Dozer Mapper? ...

dozer custom convertors for primitive types

the below url has an example on dozer custom convertors.. http://stackoverflow.com/questions/1931212/map-collection-size-in-dozer but when i tried that example its giving the exception like this.. Type: null Source parent class: dozerPackage.Source Source field name: images Source field type: class java.util.ArrayList Source f...

Dozer mapping for Hibernate object to DTO

Hello, I try to use Dozer to convert my domain entity to DTO objects. So, I want to convert PersistentList, PersistentBag, ... from my domain entity to ArrayList, ... in my DTO objects to avoid lazy problem. This is an example of two of my domain entity : public class User { private Collection<Role> roles; ... } public cl...

Dozer deep mapping not working

I am trying to use dozer 4.1 to map between classes. I have a source class that looks like this: public class initRequest{ protected String id; protected String[] details } I have a destination class that looks like this: public class initResponse{ protected String id; protected DetailsObject detObj; } p...