Announcement Announcement Module
Collapse
No announcement yet.
Criteria Query with Composite Id Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Criteria Query with Composite Id

    I have a Search screen for searching with variable number of conditions i.e. dynamically add "and condition" to where clause in the Query. Hence i am using Criteria API from Hibernate. The query works perfectly fine as criteria.list() correctly prints the no of records in the List. The problem occurs when i am trying to access the values in the Composite object having id values. It always return null value. Then i tried accessing value within the same pojo again it return the null
    Here is the pojo
    Code:
    public class DeviceSummaryView  implements java.io.Serializable {
       // Fields    
    
         private DeviceSummaryViewId id;
         private String tagNumber;
    ...
    ...
    ...
    }
    public class DeviceSummaryViewId  implements java.io.Serializable {
        // Fields    
    
         private Long deviceId;
         private long interfaceId;
         private Long ipId;
         private Long hostNameId;
    
    }
    Any pointers/suggestions highly appreciated

  • #2
    I will appreciate any pointers/suggestions

    Comment

    Working...
    X