Reputation: 1128
We are using mysql along with hibernate4 for one of our application. We are storing some error messages in the DB. Below is the class property which used to stores the current time in DB.
@Column(name = "generation_ts")
private java.sql.Timestamp generationTs;
Now we are trying to store this data in the Neo4J graph DB along with the mysql DB. Also we don't want to change the current behavior of the class.
When I am trying to save this object in Neo4J DB it is throwing the Exception as below:
Caused by: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] at java.sql.Timestamp.valueOf(Timestamp.java:202) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.core.convert.support.ObjectToObjectConverter.convert(ObjectToObjectConverter.java:71)
I have tried this. But It also gives the same exception.
So is there any other way by which I can save this object to mysql DB as well as to Neo4j DB.
Upvotes: 2
Views: 875
Reputation: 41706
I think you can use this to trigger the right converter:
@GraphProperty(propertyType=long.class)
private java.sql.Timestamp generationTs;
Upvotes: 2