I have a problem with timestamp field in postgresql database its
scheduled_time timestamp without time zone,
And i would like to get posibility to set it to null on update. But its still
ERROR: column "scheduled_time" is of type timestamp without time zone but expression is of type bytea Wskazówka: You will need to rewrite or cast the expression.
I tried to set it null, i tried to set it empty string "" i tried to find solutions at internet, i know that its work when i set it at pgadmin to null, but when i set as a parameter in
queryString = "UPDATE upload SET additional_info=:additionalInfo, customer_id=:customerId, scheduled_time=:scheduledTime WHERE upload_id=:uploadId";
final Query query = entityManager.createNativeQuery(queryString);
query.setParameter("scheduledTime", upload.getScheduledTime());
more setParameters ....
query.executeUpdate();
Its still get me that message with type bytea. Can you tell me how to solve that?
I will do it by checking if scheduled is null. When true, i will make
UPDATE upload SET additional_info=:additionalInfo, customer_id=:customerId, scheduled_time= NULL WHERE upload_id=:uploadId
else i will
UPDATE upload SET additional_info=:additionalInfo, customer_id=:customerId, scheduled_time=:scheduledTime WHERE upload_id=:uploadId
couse i didn't find any normal solution.
upload.getScheduledTime()return?upload.getScheduledTime()return?