Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:01:39+00:00 2026-06-17T14:01:39+00:00

the call em.find(Department.class, D1) returns null even when D1 exists in database. the debug

  • 0

the call em.find(Department.class, “D1”) returns null even when D1 exists in database.

the debug log shows message as :
Sole candidate for id is com.ge.dsp.iwork.entity.Department and has no subclasses, so returning without checking datastore

What does that mean? why it returns null?


I then tried to use the

            departmentId = emp.getDepartment().getDeptNo().trim();
            Query query = em.createQuery("SELECT d FROM Department d WHERE   
      trim(d.deptNo) = :departmentId");     
            query.setParameter("departmentId", departmentId);

note: the departmentId is already trim before passing to parameter here.

The query printed in the log is as:

SELECT 'com.ge.dsp.iwork.entity.Department' AS  
NUCLEUS_TYPE,D.DEPTNAME,D.DEPTNO,D.LOCATION,D.MGRNO FROM DEPARTMENT D WHERE D.DEPTNO =  
<'D1'>

and returns 0 rows.

When I modified the query to

            departmentId = emp.getDepartment().getDeptNo().trim();
            Query query = em.createQuery("SELECT d FROM Department d WHERE trim(d.deptNo) = :departmentId");     // 'D1'");
            query.setParameter("departmentId", departmentId.trim());

note: departmentId is now trim again while setting it as parameter.

the log file shows query as:

SELECT 'com.ge.dsp.iwork.entity.Department' AS NUCLEUS_TYPE,D.DEPTNAME,D.DEPTNO,D.LOCATION,D.MGRNO FROM DEPARTMENT D WHERE D.DEPTNO = 'D1'

and returns the entity from DB.

Why is this case? when does datanuclueus add angle brackets <> to the parameter?

Please advice

thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:01:40+00:00Added an answer on June 17, 2026 at 2:01 pm

    “Not checking datastore” means it knows what is the type of the object to be returned so it is not checking the datastore to validate the type. Why it returns null only you can answer since you know what is in the datastore, what is in the log and what is that class.

    Angle brackets symbolise a parameter to a JDBC statement (so in the real statement that is a “?”). This is LOGGING, not what goes to the datastore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have MongoJS query call: db.users.find({username:eleeist},function(err, docs) { console.log(docs); }); The docs variable looks
I keep getting this error when I try to call Find() public void findTxt(string
Possible Duplicate: CakePHP: Call to a member function find() on a non-object I have
I need to find a way to call a vb.net function in my aspx
I am receiving a Find Bugs error - call to method of static java.text.DateFormat
Can I call tableViewcellForRowAtIndexPathtableView in heightForRowAtIndexPath to find cell's size? Is it too expensive
I'm struggling to find how to call the equivalent of (taken from this article
I'm trying to find a simple way to call a NSLog to trace myPoint
I know I can find if a process is being debugged via a call
I'm trying to find the jQuery equivalent of this JavaScript method call: document.addEventListener('click', select_element,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.