How do I set below value in java api?
entity1.setAttributeValue("LastModified", dateTimeHolder);
Timestamp
org.openadaptor.util.DateTimeHolder
I have data in dateTimeHolder but always inserting null...
entity1.setAttributeValue("LastModified", dateTimeHolder)
-
- Posts: 370
- Joined: Sat Apr 28, 2018 3:33 am
- Location: India
- Contact:
Re: entity1.setAttributeValue("LastModified", dateTimeHolder
First off, the second parameter of setAttributeValue needs to be an Object. So your dateTimeHolder needs to be cast to Object. One way to do that is like:
Also, your code is setting variables within your java program. To actually update the database, you need to do
Are you doing that?
Code: Select all
entity1.setAttributeValue("LastModified", (Object) dateTimeHolder);
Code: Select all
engine.updateEntity(this, entity1);
Bob
-
- Posts: 370
- Joined: Sat Apr 28, 2018 3:33 am
- Location: India
- Contact:
Re: entity1.setAttributeValue("LastModified", dateTimeHolder
This worked like a charm! Thank you Bob.