@Id @Type(type = "org.hibernate.type.PostgresUUIDType") private UUID id = UUID.randomUUID();
public interface DemoDao extends JpaRepository<Demo,UUID> { public Demo findById(UUID uuid); }
Demo demo =demoDao.findById(UUID.fromString("127757ac-571c-9052-cdd9-a31f91d15972"));