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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:07:21+00:00 2026-05-21T21:07:21+00:00

For refrence look http://singgihpraditya.wordpress.com/2010/02/13/spring-3-0-and-hibernate-tutorial-part-1/ @Entity @Table(name=USER) public class User implements Serializable { private Long

  • 0

For refrence look http://singgihpraditya.wordpress.com/2010/02/13/spring-3-0-and-hibernate-tutorial-part-1/

@Entity
@Table(name="USER")
public class User implements Serializable {
        private Long id;
    private String name;
private String password;

@Id
@GeneratedValue
@Column(name="USER_ID")
public Long getId() {
    return id;
}
public void setId(Long id) {
    this.id = id;
}

    private HibernateTemplate hibernateTemplate;

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

the above part is code from 2 files , just to give you some code as people here like to ask for it


the important part:

@Override
public User getUser(Long id) {
    return hibernateTemplate.get(User.class, id);

}

As we can see get User by his ID is easy..
I want to : i’m sure its easy I just dont know how , and I know there is the alternative way to get all User into a a List<User> and serach with for(..) but I don’t want that way, I want the elegant way.


* return user by name

* return true/false if user exists by name

  • 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-05-21T21:07:21+00:00Added an answer on May 21, 2026 at 9:07 pm

    You need queries to search for entities. Read the user guide about queries. The same page also contains a whole section about HQL, the query language used to write queries.

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

Sidebar

Related Questions

So taking a look at the API doc page here: http://developers.facebook.com/docs/reference/javascript/FB.api I'm wondering if
Can I get wp_tag_cloud ( http://codex.wordpress.org/Function_Reference/wp_tag_cloud ) to look like either of these two
I read carefully the good UI practice from the Google Dev Blog; http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html and
What should I look at to get started? Is it Timer? http://developer.android.com/reference/java/util/Timer.html Or am
Please take a look at this site as a reference: http://www.philsalesses.com/place-pulse/ On the left
Take a look at the graphics part of the GoogleAPI reference . It says
Website in reference: http://www.imvu-e.com/products/ht/clients/test/ Notice on the tables how I have a newline separating
Where can I find the values that InputType can has? I'm aware of http://developer.android.com/reference/android/text/InputType.html
I'm using http://raphaeljs.com/ to try and draw multiple small circles. The problem I'm having
Scribd API: http://www.scribd.com/developers For those of you that are aware of Scribd, used it

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.