Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/ImportAttribute.java @ 497:67fd63e4ef66
Importer: centralized caching
flys-backend/trunk@1851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 08 May 2011 15:29:45 +0000 |
parents | bc3747a371cc |
children |
comparison
equal
deleted
inserted
replaced
496:4f2d8980415f | 497:67fd63e4ef66 |
---|---|
45 return value.hashCode(); | 45 return value.hashCode(); |
46 } | 46 } |
47 | 47 |
48 public Attribute getPeer() { | 48 public Attribute getPeer() { |
49 if (peer == null) { | 49 if (peer == null) { |
50 Session session = Importer.sessionHolder.get(); | 50 Session session = ImporterSession.getInstance().getDatabaseSession(); |
51 Query query = session.createQuery("from Attribute where value=:value"); | 51 Query query = session.createQuery("from Attribute where value=:value"); |
52 query.setString("value", value); | 52 query.setString("value", value); |
53 List<Attribute> attributes = query.list(); | 53 List<Attribute> attributes = query.list(); |
54 if (attributes.isEmpty()) { | 54 if (attributes.isEmpty()) { |
55 peer = new Attribute(value); | 55 peer = new Attribute(value); |