Closed deverlex closed 1 week ago
I added B (child) to a list and call saveAll() them
What list? You haven't actually shown us what you are doing.
I added B (child) to a list and call saveAll() them
What list? You haven't actually shown us what you are doing.
I found a list A from database, and I get B from a items and add to a list
List<A> listA = finder.query().findList();
List<B> listB = new ArrayList<>();
for (A a : listA) {
B b = a.getChild();
b.setOther(...)
listB.add(b);
}
DB.byName(dbName).saveAll(listB);
I added B (child) to a list and call saveAll() them
What list? You haven't actually shown us what you are doing.
oh, I see the field has fetch type is lazy is not load object with id
straightway. But after some call get any fields, the field have been loaded object with id
.
How to load object with id
straightway?
How to load object with id straightway?
Can you ask your question again? I mean, the mapping has FetchType.LAZY, you need to show us the ORM query that you are using + the mapping (like FetchType.LAZY) + the SQL that is generated ... and state why it doesn't do what you think it should be doing. Can you provide that?
Maybe we should close this if you don't have any follow up question here?
How to load object with id straightway?
Can you ask your question again? I mean, the mapping has FetchType.LAZY, you need to show us the ORM query that you are using + the mapping (like FetchType.LAZY) + the SQL that is generated ... and state why it doesn't do what you think it should be doing. Can you provide that?
Thank u for your time. I think I need call a setter for an field that is object in ebean.
Hi, I have complex relation of entities
When I find A by @Id and access to B (child), I see the C (data ) is null. I added B (child) to a list and call saveAll() them. The C data to be null.
I think B (child) will have C data object has
Id
only