From 0d71d356973b8e02264325e3f312c650b7f32844 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Tue, 19 Apr 2011 09:04:55 -0500 Subject: [PATCH] HHH-6138 - Implement addition of annotated classes and packages in MetadataSources --- .../org/hibernate/metamodel/source/MetadataSources.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/MetadataSources.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/MetadataSources.java index 4c79860752..bcb672cb5c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/MetadataSources.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/MetadataSources.java @@ -31,6 +31,7 @@ import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; +import java.util.LinkedHashSet; import java.util.List; import java.util.jar.JarFile; import java.util.zip.ZipEntry; @@ -55,6 +56,8 @@ public class MetadataSources { private static final Logger LOG = Logger.getLogger( MetadataSources.class ); private List jaxbRootList = new ArrayList(); + private LinkedHashSet annotatedClasses = new LinkedHashSet(); + private LinkedHashSet annotatedPackages = new LinkedHashSet(); private final JaxbHelper jaxbHelper; @@ -98,7 +101,8 @@ public class MetadataSources { * @return this (for method chaining) */ public MetadataSources addAnnotatedClass(Class annotatedClass) { - return this; // todo : implement method body + annotatedClasses.add( annotatedClass ); + return this; } /** @@ -109,7 +113,8 @@ public class MetadataSources { * @return this (for method chaining) */ public MetadataSources addPackage(String packageName) { - return this; // todo : implement method body + annotatedPackages.add( packageName ); + return this; } /**