They usually have enough info to understand what's going on with issues like these? Hi Jaikiran, thanks for your answer. I will try to set the log level to trace. However I'll check that agian.
I suspect it has to do with the "id" column s of that specific entity. So posting the entity class or even reviewing it yourself might give you a hint on what's wrong or what's different from other entities. E Armitage. Post your Entity mappings, also what happens if you execute the query without the order by clauses? I found the problem.
Thanks Jaikiran Pai for the guidance!! As you are using a java. List, the ordering has to be maintained. Now when you retrieve this list based on some conditions, say you get 1st, 2nd and 4th element. Forum: Object Relational Mapping. Jazzy Sanchez. Optional 'thank-you' note:. I have a one-to-many relationship. As i retrieve the Parent object, hibernate returns the Parent object and List of Child objects. The problem is, the List contains some null values so there's some error when iterating through it.
Any idea? Thanks in advance! Mark Spritzler. I like When are you iterating through them. Is it while the Session is still open.
Because Hibernate will sometimes fill in a Collection with proxy objects, that if you try to access while not having a Session open will give you no data, just errors. The session is close and lazy loading is set to false. I am now iterating through a list, getting all objects and store it to a new list.
To get rid of null values. I just wonder why hibernate is returning a List with size of 10 where the objects are just actually 3. Thanks again! Any idea guys? Hibernate is returning a list that contains NULL values. Should I use utility class to manually clear the values so i can easily iterate through the values? C Lamont Gilbert.
Does your database contain null values? FAQ Search. Page 1 of 1. Previous topic Next topic. Post subject: Hibernate query returns a list with null elements Posted: Mon Oct 10, pm. If I try to get the same row but directly in Oracle, using the query that underlying was generated by hibernate, then I'm able to get that row that was inserted without problems.
So my question is: Why hibernate is not able to get that row that was inserted? Post subject: Re: Hibernate query returns a list with null elements Posted: Tue Oct 11, am. Hibernate Team. I don't think I can use embeddable id. This would be like to use idClass, right?. Then, none of fields that belong to the index can be null, and what I need is to allow that column2 or column3 can be null. Post subject: Re: Hibernate query returns a list with null elements Posted: Tue Oct 11, pm.
Yes, no problem with the primary key concept :. Let me explain you why I'm asking these weird things: someone created in the DB that unique index that I posted in the first comment. Why that person did that? Then this person, added Idclass in the hibernate entity, which obviusly produced errors since the pk can't include null values. We don't want to change the DB structure, nor the values that historically have been there.
0コメント