From 8b873dd2a5edf4dc541ae7a8f15ef5ec8007c006 Mon Sep 17 00:00:00 2001 From: tomas-muller Date: Tue, 26 Nov 2024 11:50:39 +0100 Subject: [PATCH] Scripts - fixed Hibernate API in the two examples --- scripts.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts.md b/scripts.md index 1f02b68..603e16c 100644 --- a/scripts.md +++ b/scripts.md @@ -69,7 +69,7 @@ if (subjects != null) {   } } if (type != null) { -  var t = hibSession.createQuery('from RoomType where reference = :reference').setString('reference', type).uniqueResult(); +  var t = hibSession.createQuery('from RoomType where reference = :reference').setParameter('reference', type).uniqueResult();   log.info('Room type: ' + t.getLabel() + ' (' + t.countRooms(session.getUniqueId()) + ' rooms in ' + session.getLabel() + ')'); } // Progress @@ -118,9 +118,9 @@ if dept:   print 'Selected department: %s - %s' % (dept.getDeptCode(), dept.getLabel()) if subjects:   for subject in subjects: -    print '   %s - %s' % (subject.getSubjectAreaAbbreviation(), subject.getTitle()) +    print ' %s - %s' % (subject.getSubjectAreaAbbreviation(), subject.getTitle()) if type: -  t = hibSession.createQuery('from RoomType where reference = :reference').setString('reference', type).uniqueResult() +  t = hibSession.createQuery('from RoomType where reference = :reference').setParameter('reference', type).uniqueResult()   print 'Room type: %s (%d rooms in %s)' % (t.getLabel(), t.countRooms(session.getUniqueId()), session.getLabel()) # Progress log.setStatus('Counting to ten. Slowly.', 10)