Package com.jk.core.jpa
Class JKEntityModelMapper
java.lang.Object
com.jk.core.jpa.JKEntityModelMapper
This class provides methods for 
JKBaseEntity objects and
 JKBaseModel objects to interact with each other by mapping each other
 attributes to their own.
 This class also provide methods to convert dates to strings and vice versa.
- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic StringdateToString(Date date) This method transform the givenDateobject into a string.voidfillCommonAttributesFromEntityToModel(JKBaseEntity entity, JKBaseModel model) This method takes the providedJKBaseModelattributes and fill them with values from the specifiedJKBaseEntityattributes.voidfillCommonAttributesFromModelToEntity(JKBaseEntity entity, JKBaseModel model) This method takes the providedJKBaseEntityattributes and fill them with values from the specifiedJKBaseModelattributes.static DatestringToDate(String date) This method transform the given date string into aDateobject. 
- 
Constructor Details
- 
JKEntityModelMapper
public JKEntityModelMapper() 
 - 
 - 
Method Details
- 
fillCommonAttributesFromEntityToModel
This method takes the providedJKBaseModelattributes and fill them with values from the specifiedJKBaseEntityattributes.- Parameters:
 entity- Specifies the entity whose attributes values are to be copied.model- Specifies the model whose attributes are to be changed to the new values taken from the entity.
 - 
fillCommonAttributesFromModelToEntity
This method takes the providedJKBaseEntityattributes and fill them with values from the specifiedJKBaseModelattributes.- Parameters:
 entity- Specifies the entity whose attributes are to be changed to the new values taken from the model.model- Specifies the model whose attributes values are to be copied.
 - 
dateToString
This method transform the givenDateobject into a string.This method formats the date in the following format:
yyyy/MM/dd hh:mm:ss- Parameters:
 date- Specifies the date to be converted.- Returns:
 - string representation of the date.
 
 - 
stringToDate
This method transform the given date string into aDateobject.- Parameters:
 date- Specifies the date in theyyyy/MM/dd hh:mm:ssformat.- Returns:
 - a 
Dateobject that represents the values in the provided string. 
 
 -