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 8852333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:22:24+00:00 2026-06-14T13:22:24+00:00

public Users findById(String id){ log.debug(find by id); try{ Users result=(Users)getHibernateTemplate().get(Users.class, id); return result; }catch

  • 0
public Users findById(String id){
    log.debug("find by id");
    try{
        Users result=(Users)getHibernateTemplate().get(Users.class, id);
        return result;
    }catch (RuntimeException re) {
        log.error("find by example failed", re);
        throw re;
    }
}

I get a null value. But I don’t know why. This function doesn’t throw an exception but just returns null.
In the meanwhile

List result=getHibernateTemplate().find("from Users as model where model.id="+id)

i can get data.

  • 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-14T13:22:25+00:00Added an answer on June 14, 2026 at 1:22 pm

    can you post Users.java . (Between I will name it User.java).

    What is the type of Id property .Is it long?.
    then use Users result=(Users)getHibernateTemplate().get(Users.class, Long.parseLong(id));

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

Sidebar

Related Questions

I have some async method public static Task<JObject> GetUser(NameValueCollection parameters) { return CallMethodApi(users.get, parameters,
I have multiple Users, each with a collection of Tasks. public class User {
I'm using CakeDC-Users plugin. <?php class Post extends AppModel { public $useTable='posts'; public $belongsTo
I have async methods that returns an objects public static IEnumerable<Users.User> GetUsers(IEnumerable<string> uids, Field
Here's the relevant code: Public class User.cs: public void FindByID(int id) { Parser parser
Code: export class ViewModel { public users: knockout.koObservableArrayBase; constructor () { this.users = ko.observableArray([]);
And here is my rest code @Path(Users) public class ItemsResource extends stu{ @Context private
ParseError: /Users/JMiller/Projects/multisport-momentum/public/stylesheets/style.styl:15 11| color #031634 12| } 13| a { 14| color font.color >
For Post model: public $belongsTo = array('Users.User') And for CakeDC-Users plugin's User model: public
I want to give my users the ability to choose how their public page

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.