2
你知道如何将这个属性(日历数组)传递到@NamedNativeQuery中吗?JAVA-如何将数组传递给@NamedNativeQuery
'[ “1996-01-01 12时00分00秒”, “1996-01-01 17时00分00秒”]'
我尝试了后续的方式,但不起作用。
@NamedNativeQuery(
name = "BusinessHours.deleteBusinessHours",
query = "delete from business_hours " +
"where company_address_id = ?1 and " +
"hours = [?2,?3]"
)
编辑:在Postgres的 本地查询:
DELETE FROM business_hours
WHERE company_address_id = 7
AND hours = '["1996-01-01 18:15:00","1996-01-01 18:30:00"]'
您是否尝试过使用? ...和小时在?2并传递数组而不是2个参数 – mariusz2108
你能详细写下它吗,因为我不明白你的意思。 – pik4
查询=“从business_hours删除company_address_id =?1和小时?2”As?2你传递数组日期 – mariusz2108