[webbeans-commits] Webbeans SVN: r2364 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean and 15 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Apr 9 11:45:47 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-04-09 11:45:47 -0400 (Thu, 09 Apr 2009)
New Revision: 2364
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/
ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml
Removed:
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
Log:
Support for not making entities beans
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -84,7 +84,8 @@
{
throw new DuplicateBindingTypeException(newAnnotation + " is already present in the bindings list for " + this);
}
- }
+ result.add(newAnnotation)
+; }
return result.toArray(EMPTY_BINDINGS);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -43,10 +43,11 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.persistence.PersistenceApiAbstraction;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -222,8 +223,8 @@
protected void initPersistenceUnitInjectionPoints()
{
this.persistenceUnitInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- Class<? extends Annotation> persistenceContextAnnotationType = manager.getServices().get(EJBApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
- Object extendedPersistenceContextEnum = manager.getServices().get(EJBApiAbstraction.class).EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
+ Class<? extends Annotation> persistenceContextAnnotationType = manager.getServices().get(PersistenceApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
+ Object extendedPersistenceContextEnum = manager.getServices().get(PersistenceApiAbstraction.class).EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(persistenceContextAnnotationType))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -33,13 +33,11 @@
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.WrappedAnnotatedField;
import org.jboss.webbeans.introspector.WrappedAnnotatedMethod;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.util.Reflections;
@@ -294,10 +292,26 @@
!servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(rawType) &&
!ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(rawType) &&
!jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(rawType) &&
- hasSimpleWebBeanConstructor(clazz)
- && (manager.getServices().contains(JpaServices.class) ? !manager.getServices().get(JpaServices.class).discoverEntities().contains(clazz.getRawType()) : true);
+ hasSimpleWebBeanConstructor(clazz) &&
+ !isEntity(clazz);
}
+ private boolean isEntity(AnnotatedClass<?> clazz)
+ {
+ if (manager.getServices().contains(EntityDiscovery.class))
+ {
+ EntityDiscovery entityDiscovery = manager.getServices().get(EntityDiscovery.class);
+ return
+ entityDiscovery.discoverEntitiesFromAnnotations().contains(clazz.getRawType()) ||
+ entityDiscovery.discoverEntitiesFromPersistenceUnits().contains(clazz.getRawType()) ||
+ entityDiscovery.discoverEntitiesFromXml().contains(clazz.getRawType());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
private static boolean hasSimpleWebBeanConstructor(AnnotatedClass<?> type)
{
return type.getNoArgsConstructor() != null || type.getAnnotatedConstructors(Initializer.class).size() > 0;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -52,13 +52,16 @@
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.literal.DeployedLiteral;
import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.persistence.DefaultEntityDiscovery;
+import org.jboss.webbeans.persistence.PersistenceApiAbstraction;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.resources.DefaultNamingContext;
import org.jboss.webbeans.resources.DefaultResourceLoader;
@@ -91,6 +94,7 @@
// initialize default services
getServices().add(ResourceLoader.class, new DefaultResourceLoader());
getServices().add(NamingContext.class, new DefaultNamingContext());
+ getServices().add(EntityDiscovery.class, new DefaultEntityDiscovery(getServices()));
}
public void initialize()
@@ -124,6 +128,7 @@
ResourceLoader resourceLoader = getServices().get(ResourceLoader.class);
getServices().add(EJBApiAbstraction.class, new EJBApiAbstraction(resourceLoader));
getServices().add(JSFApiAbstraction.class, new JSFApiAbstraction(resourceLoader));
+ getServices().add(PersistenceApiAbstraction.class, new PersistenceApiAbstraction(resourceLoader));
getServices().add(ServletApiAbstraction.class, new ServletApiAbstraction(resourceLoader));
// Temporary workaround to provide context for building annotated class
// TODO expose AnnotatedClass on SPI and allow container to provide impl of this via ResourceLoader
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EJBApiAbstraction.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -35,22 +35,13 @@
{
super(resourceLoader);
ENTERPRISE_BEAN_CLASS = classForName("javax.ejb.EnterpriseBean");
- PERSISTENCE_CONTEXT_ANNOTATION_CLASS = annotationTypeForName("javax.persistence.PersistenceContext");
EJB_ANNOTATION_CLASS = annotationTypeForName("javax.ejb.EJB");
RESOURCE_ANNOTATION_CLASS = annotationTypeForName("javax.annotation.Resource");
- PERSISTENCE_CONTEXT_TYPE_CLASS = classForName("javax.persistence.PersistenceContextType");
- if (PERSISTENCE_CONTEXT_TYPE_CLASS.getClass().equals( Dummy.class)) {
- EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS, "EXTENDED");
- } else {
- EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = DummyEnum.DUMMY_VALUE;
- }
+
}
- public final Class<?> PERSISTENCE_CONTEXT_TYPE_CLASS;
public final Class<?> ENTERPRISE_BEAN_CLASS;
- public final Class<? extends Annotation> PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
public final Class<? extends Annotation> EJB_ANNOTATION_CLASS;
public final Class<? extends Annotation> RESOURCE_ANNOTATION_CLASS;
- public final Object EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -18,7 +18,7 @@
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -11,7 +11,7 @@
import javax.persistence.Entity;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
public class MockJpaServices implements JpaServices
{
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,164 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.persistence;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class DefaultEntityDiscovery implements EntityDiscovery
+{
+
+ private static final Log log = Logging.getLog(DefaultEntityDiscovery.class);
+
+ private final ServiceRegistry serviceRegistry;
+ private Set<Class<?>> entitiesFromAnnotations;
+ private Set<Class<?>> entitiesFromOrmXml;
+ private Set<Class<?>> entitiesFromPersistenceXml;
+
+ public DefaultEntityDiscovery(ServiceRegistry serviceRegistry)
+ {
+ this.serviceRegistry = serviceRegistry;
+
+ }
+
+ public void initialize()
+ {
+ this.entitiesFromAnnotations = new HashSet<Class<?>>();
+ this.entitiesFromOrmXml = new HashSet<Class<?>>();
+ this.entitiesFromPersistenceXml = new HashSet<Class<?>>();
+ PersistenceApiAbstraction jpaApiAbstraction = serviceRegistry.get(PersistenceApiAbstraction.class);
+ // TODO process persistence.xml
+ for (Class<?> clazz : serviceRegistry.get(WebBeanDiscovery.class).discoverWebBeanClasses())
+ {
+ if (clazz.isAnnotationPresent(jpaApiAbstraction.ENTITY_CLASS) || clazz.isAnnotationPresent(jpaApiAbstraction.EMBEDDABLE_CLASS) || clazz.isAnnotationPresent(jpaApiAbstraction.MAPPED_SUPERCLASS_CLASS))
+ {
+ entitiesFromAnnotations.add(clazz);
+ }
+ }
+ for (URL url : serviceRegistry.get(ResourceLoader.class).getResources("META-INF/orm.xml"))
+ {
+ try
+ {
+ parseOrmXml(getRootElementSafely(url));
+ }
+ catch (Exception e)
+ {
+ log.warn("Error parsing {0}, entities defined there will be detected as simple beans", e, url.toString());
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void parseOrmXml(Element root)
+ {
+ String packagePrefix = "";
+
+ Element pkg = root.element("package");
+ if (pkg!=null)
+ {
+ packagePrefix = pkg.getTextTrim() + ".";
+ }
+ ResourceLoader resourceLoader = serviceRegistry.get(ResourceLoader.class);
+ for (Element entity: (List<Element>) root.elements("entity"))
+ {
+ String className = packagePrefix + entity.attribute("class").getText();
+ entitiesFromOrmXml.add(resourceLoader.classForName(className));
+ }
+ for (Element entity: (List<Element>) root.elements("mapped-superclass"))
+ {
+ String className = packagePrefix + entity.attribute("class").getText();
+ entitiesFromOrmXml.add(resourceLoader.classForName(className));
+ }
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromAnnotations()
+ {
+ if (entitiesFromAnnotations == null)
+ {
+ initialize();
+ }
+ return Collections.unmodifiableCollection(entitiesFromAnnotations);
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits()
+ {
+ if (entitiesFromPersistenceXml == null)
+ {
+ initialize();
+ }
+ return Collections.unmodifiableCollection(entitiesFromPersistenceXml);
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromXml()
+ {
+ if (entitiesFromOrmXml == null)
+ {
+ initialize();
+ }
+ return Collections.unmodifiableCollection(entitiesFromOrmXml);
+ }
+
+ /**
+ * Parses an XML document safely, as to not resolve any external DTDs
+ * @throws IOException
+ */
+ public static Element getRootElementSafely(URL url) throws DocumentException, IOException
+ {
+ InputStream stream = url.openStream();
+ SAXReader saxReader = new SAXReader();
+ saxReader.setEntityResolver(new NullEntityResolver());
+ saxReader.setMergeAdjacentText(true);
+ return saxReader.read(stream).getRootElement();
+ }
+
+ private static class NullEntityResolver implements EntityResolver
+ {
+ private static final byte[] empty = new byte[0];
+
+ public InputSource resolveEntity(String systemId, String publicId) throws SAXException, IOException
+ {
+ return new InputSource(new ByteArrayInputStream(empty));
+ }
+
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/DefaultEntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans.persistence;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.util.ApiAbstraction;
+import org.jboss.webbeans.util.ApiAbstraction.Dummy;
+import org.jboss.webbeans.util.ApiAbstraction.DummyEnum;
+
+public class PersistenceApiAbstraction extends ApiAbstraction implements Service
+{
+
+ public final Class<? extends Annotation> PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
+ public final Object EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
+ public final Class<?> PERSISTENCE_CONTEXT_TYPE_CLASS;
+ public final Class<? extends Annotation> ENTITY_CLASS;
+ public final Class<? extends Annotation> MAPPED_SUPERCLASS_CLASS;
+ public final Class<? extends Annotation> EMBEDDABLE_CLASS;
+
+ /**
+ * @param resourceLoader
+ */
+ public PersistenceApiAbstraction(ResourceLoader resourceLoader)
+ {
+ super(resourceLoader);
+ PERSISTENCE_CONTEXT_ANNOTATION_CLASS = annotationTypeForName("javax.persistence.PersistenceContext");
+ PERSISTENCE_CONTEXT_TYPE_CLASS = classForName("javax.persistence.PersistenceContextType");
+ if (PERSISTENCE_CONTEXT_TYPE_CLASS.getClass().equals( Dummy.class))
+ {
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = enumValue(PERSISTENCE_CONTEXT_TYPE_CLASS, "EXTENDED");
+ }
+ else
+ {
+ EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE = DummyEnum.DUMMY_VALUE;
+ }
+ ENTITY_CLASS = annotationTypeForName("javax.persistence.Entity");
+ MAPPED_SUPERCLASS_CLASS = annotationTypeForName("javax.persistence.MappedSuperclass");
+ EMBEDDABLE_CLASS = annotationTypeForName("javax.persistence.Embeddable");
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/persistence/PersistenceApiAbstraction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -22,7 +22,8 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
@@ -40,12 +41,12 @@
/**
* Java EE5 or Java EE6
*/
- EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, EntityDiscovery.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
/**
* Java EE6 Web Profile
*/
- EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
+ EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, EntityDiscovery.class, JpaServices.class, ResourceServices.class, TransactionServices.class, NamingContext.class, ResourceLoader.class),
/**
* Servlet container such as Tomcat
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -6,8 +6,8 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
Deleted: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.jpa.spi;
-
-import java.util.Collection;
-
-import javax.inject.manager.InjectionPoint;
-
-import org.jboss.webbeans.bootstrap.api.Service;
-
-/**
- * A container should implement this interface to allow the Web Beans RI to
- * resolve JPA persistence units and discover entities
- *
- * @author Pete Muir
- *
- */
-public interface JpaServices extends Service
-{
-
- /**
- * Gets the class for each entity in the application
- *
- * @return the entity classes
- */
- public Collection<Class<?>> discoverEntities();
-
- /**
- * Resolve the value for the given @PersistenceContext injection point
- *
- * @param injectionPoint
- * the injection point metadata
- * @return an instance of the persistence unit
- * @throws IllegalArgumentException
- * if the injection point is not annotated with
- * @PersistenceContext, or, if the injection point is a method that doesn't
- * follow JavaBean conventions
- * @throws IllegalStateException
- * if no suitable persistence units can be resolved for injection
- */
- public Object resolvePersistenceContext(InjectionPoint injectionPoint);
-
-}
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.jpa.spi.helpers;
+
+import java.util.Collection;
+
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+
+public abstract class ForwardinEntityDiscovery implements EntityDiscovery
+{
+
+ protected abstract EntityDiscovery delegate();
+
+ public Collection<Class<?>> discoverEntitiesFromAnnotations()
+ {
+ return delegate().discoverEntitiesFromAnnotations();
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits()
+ {
+ return delegate().discoverEntitiesFromPersistenceUnits();
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromXml()
+ {
+ return delegate().discoverEntitiesFromXml();
+ }
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardinEntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/helpers/ForwardingJpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -20,7 +20,7 @@
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
/**
* An implementation of {@link JpaServices} which forwards all its method calls
@@ -37,11 +37,6 @@
protected abstract JpaServices delegate();
- public Collection<Class<?>> discoverEntities()
- {
- return delegate().discoverEntities();
- }
-
public Object resolvePersistenceContext(InjectionPoint injectionPoint)
{
return delegate().resolvePersistenceContext(injectionPoint);
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.persistence.spi;
+
+import java.util.Collection;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * A container should implement this interface to replace portions or all
+ * of the built in entity discovery in Web Beans.
+ *
+ * The built in discovery considers @Entity, parses any META-INF/orm.xml
+ * and META-INF/persistence.xml.
+ *
+ * @author Pete Muir
+ *
+ */
+public interface EntityDiscovery extends Service
+{
+ /**
+ * Discover any entities defined using annotations
+ *
+ * @return an iteration of the entity classes found
+ */
+ public Collection<Class<?>> discoverEntitiesFromAnnotations();
+
+ /**
+ * Discover any entities defined using XML
+ *
+ * @return an iteration of the entity classes found
+ */
+ public Collection<Class<?>> discoverEntitiesFromXml();
+
+ /**
+ * Discover any extra entities defined using persistence unit configuration
+ *
+ * @return an iteration of the entity classes found
+ */
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits();
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/EntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java (from rev 2360, ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/JpaServices.java)
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.persistence.spi;
+
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * A container should implement this interface to allow the Web Beans RI to
+ * resolve JPA persistence units and discover entities
+ *
+ * @author Pete Muir
+ *
+ */
+public interface JpaServices extends Service
+{
+
+ /**
+ * Resolve the value for the given @PersistenceContext injection point
+ *
+ * @param injectionPoint
+ * the injection point metadata
+ * @return an instance of the persistence unit
+ * @throws IllegalArgumentException
+ * if the injection point is not annotated with
+ * @PersistenceContext, or, if the injection point is a method that doesn't
+ * follow JavaBean conventions
+ * @throws IllegalStateException
+ * if no suitable persistence units can be resolved for injection
+ */
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint);
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/persistence/spi/JpaServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -5,7 +5,8 @@
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
@@ -37,6 +38,7 @@
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -52,10 +54,28 @@
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingEntityDiscovery()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE);
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(NamingContext.class, new MockNamingContext());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.initialize();
+ }
+
+
@Test
public void testEEEnv()
{
@@ -68,6 +88,7 @@
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -84,6 +105,7 @@
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -99,6 +121,7 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
}
@@ -114,6 +137,7 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(EntityDiscovery.class, new MockEntityDiscovery());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.initialize();
}
Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.util.Collection;
+
+import org.jboss.webbeans.persistence.spi.EntityDiscovery;
+
+public class MockEntityDiscovery implements EntityDiscovery
+{
+
+ public Collection<Class<?>> discoverEntitiesFromAnnotations()
+ {
+ return null;
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromPersistenceUnits()
+ {
+ return null;
+ }
+
+ public Collection<Class<?>> discoverEntitiesFromXml()
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockEntityDiscovery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockJpaServices.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -4,7 +4,7 @@
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.persistence.spi.JpaServices;
public class MockJpaServices implements JpaServices
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-09 14:45:30 UTC (rev 2363)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -76,7 +76,7 @@
assert getCurrentManager().resolveByType(Animal.class).size() == 0;
}
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "3.2.1", id = "e")
public void testEntityClassesNotDiscoveredAsSimpleBean()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at IntegrationTest
+ at Resources({
+ @Resource(source="package-mock-orm.xml", destination="WEB-INF/classes/META-INF/orm.xml")
+})
+public class SimpleBeanOrmMappedPackageTest extends AbstractJSR299Test
+{
+
+
+ @Test
+ @SpecAssertion(section = "3.2.1", id = "o")
+ public void testOrmMappedEntityClassesNotDiscoveredAsSimpleBean()
+ {
+ assert getCurrentManager().resolveByType(Vet.class).size() == 0;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at IntegrationTest
+ at Resources({
+ @Resource(source="mock-orm.xml", destination="WEB-INF/classes/META-INF/orm.xml")
+})
+public class SimpleBeanOrmMappedTest extends AbstractJSR299Test
+{
+
+
+ @Test
+ @SpecAssertion(section = "3.2.1", id = "o")
+ public void testOrmMappedEntityClassesNotDiscoveredAsSimpleBean()
+ {
+ assert getCurrentManager().resolveByType(Vet.class).size() == 0;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+public class Vet
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Vet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
+
+ <entity class="org.jboss.jsr299.tck.tests.implementation.simple.definition.Vet" />
+
+</entity-mappings>
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/mock-orm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml 2009-04-09 15:45:47 UTC (rev 2364)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
+
+ <package>org.jboss.jsr299.tck.tests.implementation.simple.definition</package>
+
+ <entity class="Vet" />
+
+</entity-mappings>
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/simple/definition/package-mock-orm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the weld-commits
mailing list