I am having a requirement where I need to read an data XML file and then send the data to the Oracle DataBase. For this, I am using JAXB to read the XML file and JPA-Hibernate to persist data in DB. By unmarshalling the XML file using JAXB, I got the complete data in a bean, then I copied the Bean's property to the JPA entity bean using
Apache BeanUtils and the persists the data using Hibernate. Below is the code:
But while copying the properties from JAXB to JPA entity I am facing an error :
org.apache.commons.beanutils.ConversionException: DateConverter does not support default String to 'Date' conversion. Which clearly explains that there is some property in JAXB which is of type 'String' but the same name property is of type 'Date' in JPA entity class. But I don't know how can I handle this situation, as I cannot verify the list of property because there are 900+ property variables in JAXB class.
How can I handle this situation? suggestions please!