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

The Archive Base Latest Questions

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

I am working on project which uses jsf 1.X and hibernate, where am new.

  • 0

I am working on project which uses jsf 1.X and hibernate, where am new. We are using below code to update_

        Shift4DAO dao = Shift4DAO.getInstance();
        Session session = dao.createNewSession();
        Transaction transaction = null;
        try {
            transaction = session.beginTransaction();
            session.saveOrUpdate(shift4B);
            transaction.commit();
        } catch (final HibernateException e) {
            e.printStackTrace();
            if (transaction != null) {
                transaction.rollback();
            } 

How session.saveOrUpdate(shift4B); it is working(Flow)?
where Shift4DAO.java

public class Shift4DAO extends BaseShift4DAO {

public Shift4DAO () {}
}

And Shift4.java

public class Shift4 extends BaseShift4 {
private static final long serialVersionUID = 1L;


public Shift4 () {
    super();
}


public Shift4 (java.lang.Integer id) {
    super(id);
}


public Shift4 (
    java.lang.Integer id,
    org.azureworlds.dao.Employee createdBy,
    org.azureworlds.dao.Employee lastUpdatedBy,
    org.azureworlds.dao.Reservation reservation) {

    super (
        id,
        createdBy,
        lastUpdatedBy,
        reservation);
}

}

I fail to understand how i get connect to update for updating data.
is anybody can simplify this, where i need to check or how connecting to HB?
Thank u!!!!

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

    dao.createNewSession(); creates a hibernate session which encapsulates a database connection and implements the “Unit of Work” pattern. session.saveOrUpdate(shift4B); tells the session that shift4B should be created(INSERT) or updated depending on the state of the entity (new or changed).

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

Sidebar

Related Questions

I'm working on using a project which uses jQuery, and I need to dynamically
I'm working on a maven project which uses seam 2.2.0, hibernate 3.5.0-CR-2 as JPA
I'm working on updating a project which uses the following code to place a
I am working on a project which uses Java,MySql,Struts2 MVC and Hibernate. I tried
I am working on a project with existing code which uses mainly C++ but
I am new to android. I am working on a project which uses map.
I am working on the project which uses NHibernate. I don't keep session opened.
I have been working on a project which uses Grails with Hibernate... Now the
We are working on a project in netbeans using Java which uses mysql database
I am working in a project which uses Clearcase for it source code management.

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.