From 6d4c6960e69b53c124bd84beb3d008bd5a4bb319 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 4 Aug 2013 18:50:18 +0200 Subject: wip o Adding Joda time's DateTime and UUID. o Registering @SequenceGenerator's on fields and getters. o Skipping static methods. o Generating SQL to drop sequences. --- .../src/main/java/io/trygvis/container/compiler/SqlUnitModel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java') diff --git a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java index 568bbe7..1bd2535 100644 --- a/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java +++ b/container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java @@ -67,13 +67,17 @@ public class SqlUnitModel { // ----------------------------------------------------------------------- public SqlUnitModel add(SequenceMirror sequence, Element element) { + Element e = sequenceElements.get(sequence); + if (e != null && !e.equals(element)) { + throw new CompilerException(element, "This unit already contains a sequence called '" + sequence.name + "'."); + } sequences.put(sequence.name, sequence); sequenceElements.put(sequence, element); return this; } - public SqlUnitModel add(SequenceMirror... sequenceMirrors) { - for (SequenceMirror sequenceMirror : sequenceMirrors) { + public SqlUnitModel add(SequenceMirror... sequences) { + for (SequenceMirror sequenceMirror : sequences) { this.sequences.put(sequenceMirror.name, sequenceMirror); } return this; -- cgit v1.2.3