Class org.sql2o.reflection.PojoMetadata can not access a member of class X with modifiers "private"

54 views
Skip to first unread message

vitor...@vicert.com

unread,
Nov 23, 2017, 12:20:01 PM11/23/17
to sql2o
Constructors, getters/setters and irrelevant members removed:

Domain:

public class PolaganjeIspita {
private Integer id;
private PrijavaIspita prijava;
}

public class PrijavaIspita {
private Integer id;
}

Repository:

public PolaganjeIspita findById(Integer id) {
String sql = "select id, prijavaispita_id as \"prijava.id\" from PolaganjeIspita where id=:id";
try(Connection con = sql2o.open()){
return con.createQuery(sql)
.addParameter("id", id)
.executeAndFetchFirst(PolaganjeIspita.class);
}
}

Results in: java.lang.IllegalAccessException: Class org.sql2o.reflection.PojoMetadata can not access a member of class test.persistancyArchitecture.domain.PolaganjeIspita with modifiers "private"

It seems that sql2o cannot accsess private members for some reason, am i doing something wrong or is this a bug? 
How else would i set members of composite objects?

Thanks.
Message has been deleted

vitor...@vicert.com

unread,
Nov 23, 2017, 12:22:10 PM11/23/17
to sql2o
Note that setting PolaganjeIspita.prijava to public works but im sure that this should work with private members as well.
Reply all
Reply to author
Forward
0 new messages