Dozer is more robust than Beanutills object Conversion tool _ Knowledge point

Source: Internet
Author: User

Dozer provides 2 ways to configure the classes that need to be mapping, one based on XML, and one based on Api,api, which is provided by version 5.3, primarily to address the problem of XML that cannot dynamically modify mapping configuration.



Annotation resolution name is different


Configuration file XML resolution file is different

The type that supports the same attribute between two objects is a heterogeneous object, such as the Cardto engine property is Enginedto, and the engine property of the car is engine.

Supports conversions of string <-> base types, such as Cardto's Price property is string, and the price property of car is double.

Supports conversions between collection types, such as string[] <-> List

Supports bidirectional dependencies, such as product with a property of list parts, and each part also has a product attribute, at which time product and part are doubly dependent.

When a property name is really inconsistent, it can be defined with @mapping, and it can be defined only on one side.

But Dozer also has a disadvantage that it must be based on getter/setter and cannot directly access the public field

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.