rsql-jpa-specification icon indicating copy to clipboard operation
rsql-jpa-specification copied to clipboard

Why does it not work while using the nn, nutnull or isnotnull?

Open alansun2 opened this issue 1 year ago • 4 comments

My rsql is like this: status=='ACTIVE';region!='';filespacePrefix!='';workflowExtInfo=nn= but workflowExtInfo=nn= does not work, and the param workflowExtInfo is a map.

And I use the postgresql.

alansun2 avatar Sep 11 '24 08:09 alansun2

Hi @alansun2, could you share your model class? Thanks.

perplexhub avatar Sep 11 '24 15:09 perplexhub

helloe @perplexhub My model like this: DriveCluster:

@Entity
@Table(name = "drive_cluster", schema = "drive")
@SQLDelete(sql = "UPDATE drive.drive_cluster SET deleted = TRUE WHERE id = ?")
@SQLRestriction(value = "deleted = false")
public class DriveCluster extends DomainObject implements Serializable {

    private String studio;

    private String studioId;

    private String name;

    @Type(JsonType.class)
    @Column(name = "cities", columnDefinition = "jsonb")
    private List<Object> cities;

    private String vendor;

    @Size(max = 255)
    @NotNull
    @Column(name = "user_group_prefix", nullable = false)
    private String userGroupPrefix;

    @Enumerated(value = EnumType.STRING)
    @Column(name = "status", nullable = false)
    private ClusterStatusEnum status = ClusterStatusEnum.DETACHED;

    @Size(max = 255)
    @Column(name = "region")
    private String region;

    @Column(name = "workflow_ext_info")
    @JdbcTypeCode(SqlTypes.JSON)
    private Map<String, Object> workflowExtInfo;

    @Size(max = 32)
    @Column(name = "filespace_prefix")
    private String filespacePrefix;

ClusterStatusEnum:

public enum ClusterStatusEnum {

    ACTIVE, IN_PROVISION, ERROR, DETACHED
}

alansun2 avatar Sep 18 '24 08:09 alansun2

@perplexhub hello

alansun2 avatar Sep 20 '24 03:09 alansun2

Hello,

It's a problem in the version 5.x that is resolved in the version 6.x The parser expects a value after the =nn= operator. To solve the problem, you can simply add an empty value like this workflowExtInfo=nn=''.

I hope I was able to help you.

Regards

jfb-NRB avatar Mar 28 '25 19:03 jfb-NRB