java - Mapper code generation -
there many mapper tools available pojo , dto. check link: any tool java object object mapping? there tool generates dao, service classes automatically?
dozer sample:
<mapping> <class-a>yourpackage.sourceclassname</class-a> <class-b>yourpackage.destinationclassname</class-b> <field> <a>yoursourcefieldname</a> <b>yourdestinationfieldname</b> </field> </mapping> sourceclassname sourceobject = ... mapper mapper = new dozerbeanmapper(); destinationobject destobject = mapper.map(sourceobject, destinationclassname.class); asserttrue(destobject.getyourdestinationfieldname().equals(sourceobject.getyoursourcefieldname));
here xml configuration fine, can skip code part , specify pojo-dto configuration or pojo-dto along-with filter configuration. , tool should able automatically generate intermediate translation code in form of dao , service classes. there such tools available?
Comments
Post a Comment