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

Model attribute beginning with "_" leads to a NULL value #23

Open
segalaj opened this issue Mar 26, 2015 · 8 comments
Open

Model attribute beginning with "_" leads to a NULL value #23

segalaj opened this issue Mar 26, 2015 · 8 comments

Comments

@segalaj
Copy link

segalaj commented Mar 26, 2015

Problem
Get the value of an element attribute named _ return always NULL

How to reproduce
Create a model like:

@Entity
public class Test {
    @Id
    private String id;

    private Date _date;

    public Test() {
    }

    public String getId() {
        return id;
    }

    public Date getDate() {
        return _date;
    }

    public void setDate(Date date) {
        this._date = date;
    }
}

Try to access to an element in a controller:

....
    @Model(value = Test.class)
    private OrientDbCrud<Test,String> _testCrud;
....
    @Route(method = HttpMethod.GET, uri = "")
    public Result test() {
        return ok(Iterables.toArray(_testCrud.findAll(), License.class)).json();
    }

Return:

[{"id":"#18:0","date":null,"handler":{}}]

Environment
Java 8, wisdom 0.7.0, wisdom-orientdb 0.2.4, orientdb 2.0.2

@barjo
Copy link
Member

barjo commented Mar 26, 2015

Hi,

I can reproduce it on the snapshot version. It seems that it's a limitation of orientdb itself (or possibly javassist). We should consider opening the issue on their tracker https://github.com/orientechnologies/orientdb/issues

@barjo barjo added the wontfix label Mar 26, 2015
@barjo barjo self-assigned this Mar 26, 2015
barjo pushed a commit that referenced this issue Mar 26, 2015
@segalaj
Copy link
Author

segalaj commented Mar 26, 2015

Hi, thanks for your answer.
I'm not sure that come from oriendb, in fact it's possible to have column name beginning with "_" in one table.

What do you think?

@cescoffier
Copy link
Member

Hi,

It may come from the proxy generation that orientDB is doing.

2015-03-26 13:38 GMT+01:00 Joachim Segala [email protected]:

Hi, thanks for your answer.
I'm not sure that come from oriendb, in fact it's possible to have column
name beginning with "_" in one table.

What do you think?


Reply to this email directly or view it on GitHub
#23 (comment)
.

@barjo
Copy link
Member

barjo commented Mar 26, 2015

Indeed, I am pretty sure it's related to the JPA layer of orientdb. I will check with them and open an issue if that's the case.

@barjo
Copy link
Member

barjo commented Mar 26, 2015

After further investigation it seems that it is because the field name does not match the getter/setter.
https://github.com/orientechnologies/orientdb/blob/master/object/src/main/java/com/orientechnologies/orient/object/enhancement/OObjectMethodFilter.java

@barjo
Copy link
Member

barjo commented Mar 27, 2015

I open an issue at orientdb orientechnologies/orientdb#3822

@segalaj
Copy link
Author

segalaj commented Mar 27, 2015

Thanks a lot for your investigation.

@barjo
Copy link
Member

barjo commented Apr 19, 2015

It seems it will be fix for orientdb 2.2

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

No branches or pull requests

3 participants