Example usage for org.hibernate Session persist

List of usage examples for org.hibernate Session persist

Introduction

In this page you can find the example usage for org.hibernate Session persist.

Prototype

void persist(Object object);

Source Link

Document

Make a transient instance persistent.

Usage

From source file:dao.FinanceDaoImpl.java

@Override
public void addFin(Fin fin) {
    Session session = sessionFactory.openSession();
    session.getTransaction().begin();/*from   w w w  . jav  a2  s. co  m*/
    session.persist(fin);
    session.getTransaction().commit();
    session.close();
}

From source file:Dao.GenreDAO.java

public void addGenre(Genre g) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(g);
    logger.info("Genre saved successfully, Genre Details=" + g);
}

From source file:Dao.MovieGenreDAO.java

public void addMovieGenre(MovieGenre u) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(u);
    logger.info("MovieGenre saved successfully, MovieGenre Details=" + u);
}

From source file:Dao.MovieQDAO.java

public void addMovieQ(MovieQ u) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(u);
    logger.info("MovieQ saved successfully, MovieQ Details=" + u);
}

From source file:Dao.MovieTrailerDAO.java

public void addMovieTrailer(MovieTrailer u) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(u);
    logger.info("MovieTrailer saved successfully, MovieTrailer Details=" + u);
}

From source file:Dao.OrderDAO.java

public void addOrder(Order u) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(u);
    logger.info("Order saved successfully, Order Details=" + u);
}

From source file:Dao.OrderTicketDAO.java

public void addOrderTicket(OrderTicket u) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(u);
    logger.info("OrderTicket saved successfully, OrderTicket Details=" + u);
}

From source file:Dao.PersonDAO.java

public void addPerson(Person u) {
    Session session = this.sessionFactory.getCurrentSession();
    session.persist(u);
    logger.info("Person saved successfully, Person Details=" + u);
}

From source file:DAO.PreguntaDAOImpl.java

@Override
public void create(Pregunta pregunta) {
    Session session = this.sessionFactory.openSession();
    Transaction tx = session.beginTransaction();
    session.persist(pregunta);
    tx.commit();//from w w  w  .  j  a  v a2  s.c  o  m
    session.close();
}

From source file:dao.ProductoDaoImpl.java

@Override
public boolean create(Producto producto) {
    Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    boolean flag;
    try {// w w w.  j a  v a  2s.  com
        session.beginTransaction();
        session.persist(producto);

        flag = true;
    } catch (Exception e) {
        flag = false;
        throw e;
    }
    return flag;

}