This all works as intended but now when accessing the screen of “SystemCodeDetail” I receive the error
I am unable to figure out how the method above affects my entity in such a way… I have changed nothing else except adding the above annotation and method.
The @NamePattern annotation should define a list of attributes that should be loaded for the method to work. If you specify @NamePattern("#getCaption|texts"), the collection will be loaded (which is bad for performance BTW), but SystemCodeDetailText attributes languageCode.codeKey will not. So it won’t work anyway.
I would suggest denormalization, i.e. storing text.languageCode.codeKey value in the SystemCodeDetail entity. It can be done using entity listeners.
The code as I’ve showed you above works for its intended purposes. We wanted to display text.shortName (stored in SystemCodeDetailText) as the instance name (of SystemCodeDetail) in other tables and that is what it does.
The problem was when we tried to access the SystemCodeDetail entity itself.
What we did was add texts to the SystemCodeDetail view:
This seemed to work initially. What we discovered was that when the screen was loaded initially (ie. the first 50 rows) it works. However, when we want to display the next 50 rows the same error appears:
BUT it seems to only be referencing the the first row since the rest of the rows do get loaded:
We don’t understand why its having trouble loading only the first entry…?
It can be a bug in ORM that we have recently fixed. What platform version do you use?
Also, setting Fetch Mode to BATCH explicitly for both texts and index attributes may help.
Setting the Fetch Mode to BATCH for texts and index did, unfortunately, not resolve our problem.
This is a real head scratcher. It almost feels like it wants to display the first row before the data has arrived and by the time it wants to start filling rows 2 onwards the data has arrived.
The bugs I was talking about were fixed by 6.7.2. Perhaps your case is something new.
We would be happy to find out the reason and fix a bug if it is a bug. Could you make a test project where the problem is reproduced?