Skip to content

Commit

Permalink
Scripts
Browse files Browse the repository at this point in the history
- fixed Hibernate API in the two examples
  • Loading branch information
tomas-muller committed Nov 26, 2024
1 parent 7fc675b commit 8b873dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8b873dd

Please sign in to comment.