Fix load of entity with Date[] field

This commit is contained in:
Andrea Boriero 2021-12-07 18:23:48 +01:00
parent 15121842f1
commit e08a7665c8
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,6 @@
*/ */
package org.hibernate.type.descriptor.java; package org.hibernate.type.descriptor.java;
import java.sql.Time;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.sql.Types; import java.sql.Types;
import java.time.ZoneId; import java.time.ZoneId;
@ -236,7 +235,7 @@ public class JdbcTimestampJavaTypeDescriptor extends AbstractTemporalJavaTypeDes
return copy; return copy;
} }
else { else {
return new Date( value.getTime() ); return new Timestamp( value.getTime() );
} }
} }
} }

View File

@ -17,6 +17,8 @@ import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.OrderColumn; import jakarta.persistence.OrderColumn;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
public class DateArrayTest extends BaseCoreFunctionalTestCase { public class DateArrayTest extends BaseCoreFunctionalTestCase {