diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-04 18:50:18 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-04 18:50:18 +0200 |
commit | 6d4c6960e69b53c124bd84beb3d008bd5a4bb319 (patch) | |
tree | 1bd812b044d35b629ac2b49f4910b28cfdc29a12 /container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java | |
parent | 381c368b8907640bdd7cd81db2294724e082a119 (diff) | |
download | container-playground-6d4c6960e69b53c124bd84beb3d008bd5a4bb319.tar.gz container-playground-6d4c6960e69b53c124bd84beb3d008bd5a4bb319.tar.bz2 container-playground-6d4c6960e69b53c124bd84beb3d008bd5a4bb319.tar.xz container-playground-6d4c6960e69b53c124bd84beb3d008bd5a4bb319.zip |
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.
Diffstat (limited to 'container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java')
-rw-r--r-- | container-compiler-plugin/src/main/java/io/trygvis/container/compiler/SqlUnitModel.java | 8 |
1 files changed, 6 insertions, 2 deletions
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; |