From 218a000b84a4a8c6b74bb9de4dc604d720c04f66 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Sat, 13 Jan 2007 00:35:45 +0000 Subject: [PATCH] ClassMappingInfo.addUnique() accepts a Unique instance rather than an array of column names git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@495800 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/jdbc/meta/ClassMappingInfo.java | 16 ++------- .../openjpa/jdbc/meta/localizer.properties | 5 +-- .../AnnotationPersistenceMappingParser.java | 33 +++++++++++++++---- .../persistence/jdbc/localizer.properties | 2 ++ 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java index 248e2abdd..60d759892 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java @@ -322,22 +322,12 @@ public class ClassMappingInfo _uniques = new ArrayList(cinfo._uniques); } - public void addUnique(String name, String[] columnNames) { - if (columnNames == null || columnNames.length == 0) + public void addUnique(Unique unique) { + if (unique == null) return; if (_uniques == null) _uniques = new ArrayList(); - Unique uniqueConstraint = new Unique(); - uniqueConstraint.setName(name); - for (int i=0; i