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

  • Home
  • SEARCH
  • 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 8625077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:41:34+00:00 2026-06-12T07:41:34+00:00

This statement is to check if the user is existing in the database. public

  • 0

This statement is to check if the user is existing in the database.

public boolean isExisting(int userId) {
    String sql = "{call isExistingUser(?)}";
    Session session = null;
    boolean isExisting = false;
    try {
        session = getSession();
        SQLQuery query = session.createSQLQuery(sql);
        query.setParameter(0, userId);
        List<?> list = query.list();
        isExisting = list.get(0) != null ? (Boolean) list.get(0) : false;  
    } finally {
        if (session != null)
            session.close();
    }
    return isExisting;
}

This is the stored procedure:

CREATE DEFINER=cbsadmin@% PROCEDURE isExistingUser(IN userId int)
BEGIN
SELECT USER_ID FROM USER_LOGIN_STATUS WHERE USER_ID = userId;
END

  • 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-12T07:41:36+00:00Added an answer on June 12, 2026 at 7:41 am

    It is not possible to query a Stored procedure using detached criteria in NHibernate.

    You need to use SQL query only.

    See here.

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

Sidebar

Related Questions

Scenario: I have to check for user input (a string) that shouldn't contain <.%?/
I am trying to use an if statement to check if the user has
When I am trying to execute this sql statement, I am getting exception as-
I have this code when to sign in User , that string sUserData is
I often use python's assert statement to check user input and fail-fast if we're
I need help with my code. The if statement will check session for user
This is my PHP code, essentially I check the user's country, and if it
This statement is returning error 00920- invalid relational operator. I am sure it is
this statement will generate a 4 column table: SELECT shipped.badguy AS badguy, shipped.sdate AS
This statement doesnot work in Entity Framework context.sleep.Where(o=>o.clientDateTime.TimeOfDay>new TimeSpan(18,0,0)).ToList(); Please suggest me a workaround.

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.