Session. Get () hibernate Project

Source: Internet
Author: User
The method get (class, serializable) in the type session is n

I am using JBoss ide 1.5 and I am trying to generate from hibernate.

After generating I get the following error in home files

 public Dag findById( int id) { log.debug("getting Dag instance with id: " + id); try { Dag instance = (Dag) sessionFactory.getCurrentSession() .get("Dag", id); if (instance==null) { log.debug("get successful, no instance found"); } else { log.debug("get successful, instance found"); } return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } }

The method get (class, serializable) in the type session is not applicable for the arguments (string, INT)

I 've put hibernate3.jar in my project-library's

  • Like (0)

  • Max Anderson

    3,352 post from
    -8-11 currently under approval1.PM (reply to Arjan sort ing)

    Re: The method get (class, serializable) in the type session

    If you run with jdk5 it will work

    Some of the DaO templates is not jdk5 free... this is one of the areas.
    Try it with CVS version, and if that does not work report it in Jira.

 

The jdk1.5 version is automatically packaged into the integer type.

Integer. valueof (1 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.