diff --git a/documentation/src/main/docbook/devguide/en-US/extras/executeUpdate.java b/documentation/src/main/docbook/devguide/en-US/extras/executeUpdate.java index 632b2f2a3b..ce05fc09a2 100644 --- a/documentation/src/main/docbook/devguide/en-US/extras/executeUpdate.java +++ b/documentation/src/main/docbook/devguide/en-US/extras/executeUpdate.java @@ -3,9 +3,9 @@ Transaction tx = session.beginTransaction(); String hqlUpdate = "update Customer c set c.name = :newName where c.name = :oldName"; // or String hqlUpdate = "update Customer set name = :newName where name = :oldName"; -int updatedEntities = s.createQuery( hqlUpdate ) +int updatedEntities = session.createQuery( hqlUpdate ) .setString( "newName", newName ) .setString( "oldName", oldName ) .executeUpdate(); tx.commit(); -session.close(); \ No newline at end of file +session.close(); diff --git a/documentation/src/main/docbook/devguide/en-US/extras/hql-insert.java b/documentation/src/main/docbook/devguide/en-US/extras/hql-insert.java index c1ec22cc49..9505919c3a 100644 --- a/documentation/src/main/docbook/devguide/en-US/extras/hql-insert.java +++ b/documentation/src/main/docbook/devguide/en-US/extras/hql-insert.java @@ -2,7 +2,7 @@ Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); String hqlInsert = "insert into DelinquentAccount (id, name) select c.id, c.name from Customer c where ..."; -int createdEntities = s.createQuery( hqlInsert ) +int createdEntities = session.createQuery( hqlInsert ) .executeUpdate(); tx.commit(); -session.close(); \ No newline at end of file +session.close(); diff --git a/documentation/src/main/docbook/devguide/en-US/extras/hql_delete.java b/documentation/src/main/docbook/devguide/en-US/extras/hql_delete.java index d4720e9d82..87c2971706 100644 --- a/documentation/src/main/docbook/devguide/en-US/extras/hql_delete.java +++ b/documentation/src/main/docbook/devguide/en-US/extras/hql_delete.java @@ -3,8 +3,8 @@ Transaction tx = session.beginTransaction(); String hqlDelete = "delete Customer c where c.name = :oldName"; // or String hqlDelete = "delete Customer where name = :oldName"; -int deletedEntities = s.createQuery( hqlDelete ) +int deletedEntities = session.createQuery( hqlDelete ) .setString( "oldName", oldName ) .executeUpdate(); tx.commit(); -session.close(); \ No newline at end of file +session.close(); diff --git a/documentation/src/main/docbook/devguide/en-US/extras/updating_version.java b/documentation/src/main/docbook/devguide/en-US/extras/updating_version.java index b59ff60f1d..b68c41c370 100644 --- a/documentation/src/main/docbook/devguide/en-US/extras/updating_version.java +++ b/documentation/src/main/docbook/devguide/en-US/extras/updating_version.java @@ -1,9 +1,9 @@ Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); String hqlVersionedUpdate = "update versioned Customer set name = :newName where name = :oldName"; -int updatedEntities = s.createQuery( hqlUpdate ) +int updatedEntities = session.createQuery( hqlUpdate ) .setString( "newName", newName ) .setString( "oldName", oldName ) .executeUpdate(); tx.commit(); -session.close(); \ No newline at end of file +session.close();