Have a table with >70 columns.
I use about 8 of these columns with the .java object, including the id
- not sure if that matters.
My Id column has the following:
@Column(name = "pseudonym", nullable = false)
@Basic(fetch = FetchType.EAGER)
@Id
My question is this:
If I want to update a row using xxxDAO.store(updatedRow)
- do I need to specify anything to reference the row ID or am I missing something here?
I'm getting the following exception:
DEBUG: org.springframework.web.servlet.DispatcherServlet - Could not complete request
javax.persistence.PersistenceException: org.hibernate.exception.DataException: Could not execute JDBC batch update
.. ~(adding this in here)~ not a valid month
Hopefully I have explained this well enough. Let me know if I haven't.
Thanks in advance
Some pseudo code for reference:
item = dao.getItemById(123);
item.setUpdateTime(theTime);
dao.store(item);
Store: return getEntityManager().merge(itemToStore);
To Clarify
I was getting the exception above not a valid month
. This was because I was trying to update an Oracle table that had a column defined as a timestamp. I was trying to pass a String value (even though the String was essentially structured identically).
In an attempt to debug this, my question was if I could update a row via the JPA DAO without having e.g. all 70+ columns defined in my Java object. This turned out to be possible and the exception was not related to not having defined columns. The exception was simply because the timestamp I was trying to update didn't have the correct structure. I changed the Strings to Date objects, and they updated