Skip to content

Type cast error: Can't convert 'class java.math.BigInteger' to 'class java.lang.Long' #171

@alvachien

Description

@alvachien

Create a very simply model class:

@Entity
@Table(name = "book_ctgy_def")
public class BookCategory {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY) 
    @Column(name = "id")
    private Long id;

...
}

The database column created as

id bigint,

Access it via http://[localhost:9010/apis/v1/BookCategories, the error thrown:

{"error":{"code":null,"message":"Type cast error: Can't convert 'class java.math.BigInteger' to 'class java.lang.Long'. @Convert required"}}

The same model works with Olingo itself without 'olingo-jpa-processor-v4'.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions