Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin indeed doesn't work with @Transient properties for @Entity #80

Closed
kkaun opened this issue Jul 10, 2018 · 7 comments
Closed

Plugin indeed doesn't work with @Transient properties for @Entity #80

kkaun opened this issue Jul 10, 2018 · 7 comments

Comments

@kkaun
Copy link

kkaun commented Jul 10, 2018

Hi, I have an issue similar to this one: adding @Transient even to @Entity field of simple type leads to DT warning/error :
DataTables warning: table id=users - java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [placesNum] on this ManagedType [com.kirak.domain.User] , afer which DT renders no data AKA "No matching records found".

My sample field:

    @JsonInclude //Tried to comment this
    @JsonProperty("ownPlacesNum") //Tried to comment this
    @JsonView(DataTablesOutput.View.class)
    @Transient
    private Integer ownPlacesNum;

I tried to play with getters and their annotations - still the same.
Though I really don't want to get rid of this awesome extension and have some workaround, this issue
brings a little headache as it becomes nearly impossible to ignore any kinds of entities' properties. Hope it may remind to come up with something. Thanks.

@RomanKurbanov
Copy link

Does it work outside of DataTables environment?
If you send a GET request to your entity's api, does the transient field appear?

@kkaun
Copy link
Author

kkaun commented Jul 10, 2018

Yup, tried that just few moments ago and received fully valid JSON, including transient fields :(

@RomanKurbanov
Copy link

I can only offer using @Formula annotation for now, see if that fits your use case.

@kkaun
Copy link
Author

kkaun commented Jul 10, 2018

@iSosnitsky, thanks, I'll try it!

@darrachequesne
Copy link
Owner

It think you need to add:

{
    "data": "ownPlacesNum",
    "orderable": false,
    "searchable": false
}

So that the column is not used as a filter.

@sebasira
Copy link

I was having the same issue as @kkaun with the @darrachequesne proposal I'm able to render the DataTable.

I can live without the ordering and searching of that column but it would be great if we could

@darrachequesne
Copy link
Owner

Closed due to inactivity, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants