Skip to content

Issue with Enum datatype in querydsl #2364

@prasannabalaraman

Description

@prasannabalaraman

I have an App entity class which has a enum field

@Enumerated(EnumType.STRING)
@Column(name = "platform", columnDefinition = "platform_enum")
private Platform platform;

My Platform enum is

public enum Platform {
ANDROID,
IOS;
}

I have created enum in postgres too
CREATE TYPE platform_enum AS ENUM (
'IOS',
'ANDROID');

My repo class is

public interface AppRepository extends PagingAndSortingRepository<App, UUID>, QuerydslPredicateExecutor

When I try to {{baseUrl}}/{{apiVersion}}/{{apiContext}}/apps?platform=IOS, I am getting the following exception

Caused by: java.lang.IllegalArgumentException: Parameter value [IOS] did not match expected type [Platform (n/a)]

I tried converting the column type as varchar in DB but that doesnt help.

Appreciate your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions