FindByUUID() using Spring Data's JPA Repository

前端 未结 4 521
面向向阳花
面向向阳花 2020-12-21 15:39

for some reason I have not being able to find a suitable answer for this. I have the following simple entity:

@Entity
@Table(name = \"simple_entity\")
@Acce         


        
4条回答
  •  伪装坚强ぢ
    2020-12-21 16:39

    Try annotate your UUID property with @org.hibernate.annotations.Type(type="org.hibernate.type.UUIDCharType")
    or
    @org.hibernate.annotations.Type(type="org.hibernate.type.UUIDBinaryType")

    I faced a problem similar while query database with UUID due to MSB/LSB swap with UUID in binary format; we solved the problem treating data as String and do necessary conversion before conversion.

提交回复
热议问题