How to use criteria with enums from TypeScript service?

拈花ヽ惹草 提交于 2020-01-05 07:49:16

问题


I have a criteria that is roughly like this :

public class DocuSignTemplateDefinitionCriteria implements Serializable {

    public static class DocuSignTemplateTypeFilter extends Filter<DocuSignTemplateType> {
    }

    private DocuSignTemplateTypeFilter templateType;
    private LongFilter sponsorLevelId;
    private LongFilter languageId;
    private LongFilter eventId;

From the TypeScript service, I can use the query with all the simple types (in this example, longs):

this.http.get(`${this.resourceUrl}languageId.equals=2&sponsorLevelId.equals=4&eventId.equals=1001`)

But I can't figure out how to query the enum DocuSignTemplateType. I've used several syntaxes (below is one example), but I can't get it right.

this.http.get(`${this.resourceUrl}?languageId.equals=2&sponsorLevelId.equals=4&eventId.equals=1001&templateType.equals=DocuSignTemplateType.SPONSOR_AGREEMENT`)

Any idea ? Any example on how to archieve this ?

Thanks


回答1:


As said in comment, it must be templateType.equals=SPONSOR_AGREEMENTwithout the enum class name.



来源:https://stackoverflow.com/questions/47111866/how-to-use-criteria-with-enums-from-typescript-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!