Skip to main content
added 32 characters in body
Source Link
Basil Bourque
  • 346.8k
  • 130
  • 950
  • 1.3k

You can use DozerMapperDozerMapper. It will map the object to another object having same name properties or you have to write the mapping in the dozer-mapping xml.

Lets come to your question. Here you are trying to convert your entity to another object.

For that you have to write mapping code. It will be something like this and it is very common practice to convert entity objects to another object before using them.

Record toRecord(Billing billing) { if(billing == null) { return null; } Record record = new Record(); record.setBillingCycle = billing.getBillingCycle(); ... ... // other properties ... return record; } 

You can use DozerMapper. It will map the object to another object having same name properties or you have to write the mapping in the dozer-mapping xml.

Lets come to your question. Here you are trying to convert your entity to another object.

For that you have to write mapping code. It will be something like this and it is very common practice to convert entity objects to another object before using them.

Record toRecord(Billing billing) { if(billing == null) { return null; } Record record = new Record(); record.setBillingCycle = billing.getBillingCycle(); ... ... // other properties ... return record; } 

You can use DozerMapper. It will map the object to another object having same name properties or you have to write the mapping in the dozer-mapping xml.

Lets come to your question. Here you are trying to convert your entity to another object.

For that you have to write mapping code. It will be something like this and it is very common practice to convert entity objects to another object before using them.

Record toRecord(Billing billing) { if(billing == null) { return null; } Record record = new Record(); record.setBillingCycle = billing.getBillingCycle(); ... ... // other properties ... return record; } 
Source Link
Suraj
  • 3.2k
  • 4
  • 32
  • 50

You can use DozerMapper. It will map the object to another object having same name properties or you have to write the mapping in the dozer-mapping xml.

Lets come to your question. Here you are trying to convert your entity to another object.

For that you have to write mapping code. It will be something like this and it is very common practice to convert entity objects to another object before using them.

Record toRecord(Billing billing) { if(billing == null) { return null; } Record record = new Record(); record.setBillingCycle = billing.getBillingCycle(); ... ... // other properties ... return record; }