Examples of addResource()


Examples of org.hibernate.cfg.AnnotationConfiguration.addResource()

    AnnotationConfiguration cfg = new AnnotationConfiguration();
    cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
    try {
      cfg.addAnnotatedClass( Flight.class );
      cfg.addAnnotatedClass( org.hibernate.test.annotations.Flight.class );
      cfg.addResource( "org/hibernate/test/annotations/orm.xml" );
      cfg.addResource( "org/hibernate/test/annotations/duplicatedgenerator/orm.xml" );
      cfg.buildSessionFactory();
      fail( "Should not be able to map the same entity name twice" );
    }
    catch (AnnotationException ae) {
View Full Code Here

Examples of org.hibernate.cfg.Configuration.addResource()

    public AddResource(String resource) {
      this.resource = resource;
    }
    public void apply(Object target, WireContext wireContext) {
      Configuration configuration = (Configuration) target;
      configuration.addResource(resource, wireContext.getClassLoader());
    }
    public String toString() {
      return "adding mapping resource "+resource+" to hibernate configuration";
    }
  }
View Full Code Here

Examples of org.hibernate.cfg.reveng.OverrideRepository.addResource()

  public void testSetAndManyToOne() {
   
    OverrideRepository or = buildOverrideRepository();
   
    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
 
    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.addResource()

                Logger.info("JPA -> Adding package: %s", p.getName());
                cfg.addPackage(p.getName());
            }
            String mappingFile = Play.configuration.getProperty("jpa.mapping-file", "");
            if (mappingFile != null && mappingFile.length() > 0) {
                cfg.addResource(mappingFile);
            }
            Logger.trace("Initializing JPA ...");
            try {
                JPA.entityManagerFactory = cfg.buildEntityManagerFactory();
            } catch (PersistenceException e) {
View Full Code Here

Examples of org.hivedb.Hive.addResource()

      Hive hive = Hive.create(getConnectString(H2TestCase.TEST_DB), partitionDimensionName(), Types.INTEGER, CachingDataSourceProvider.getInstance(), null);
      dimension = createPopulatedPartitionDimension();
      dimension.setId(hive.getPartitionDimension().getId());
      hive.setPartitionDimension(dimension);
      resource = Atom.getFirstOrThrow(dimension.getResources());
      hive.addResource(resource);
      numIndex = resource.getSecondaryIndex("num");
      nameIndex = resource.getSecondaryIndex("name");
      for (SecondaryIndex secondaryIndex : resource.getSecondaryIndexes()) {
        hive.addSecondaryIndex(resource, secondaryIndex);
      }
View Full Code Here

Examples of org.jboss.as.test.module.util.TestModule.addResource()

                .getResource(JPAEMFFromModuleBasedPartitionManagerTestCase.class
                    .getSimpleName() + "-module.xml").getFile());

            TestModule module = new TestModule("test.picketlink-emf-module-test", moduleXml);

            module.addResource("picketlink-emf-module-test.jar")
                .addClass(CustomCredential.class)
                .addClass(CustomCredentialHandler.class)
                .addClass(AbstractCredentialTypeEntity.class)
                .addClass(AttributedTypeEntity.class)
                .addClass(AttributeTypeEntity.class)
View Full Code Here

Examples of org.jboss.gravia.provision.Environment.addResource()

        List<Resource> unresolved = new ArrayList<Resource>();
        Environment envclone = cloneEnvironment(env);
        for (Requirement req : reqs) {
            Resource res = req.getResource();
            if (env.getResource(res.getIdentity()) == null) {
                envclone.addResource(res);
                unresolved.add(res);
            }
        }

        // Find the resources in the cloned environment
View Full Code Here

Examples of org.jboss.gravia.repository.Repository.addResource()

            RepositoryReader reader = new DefaultRepositoryXMLReader(input);
            Resource auxres = reader.nextResource();
            while (auxres != null) {
                ResourceIdentity identity = auxres.getIdentity();
                if (repository.getResource(identity) == null) {
                    repository.addResource(auxres);
                    result.add(identity);
                }
                auxres = reader.nextResource();
            }
        } finally {
View Full Code Here

Examples of org.jboss.gravia.repository.RepositoryMBean.addResource()

                RepositoryReader reader = new DefaultRepositoryXMLReader(input);
                Resource auxres = reader.nextResource();
                while (auxres != null) {
                    ResourceIdentity identity = auxres.getIdentity();
                    if (repository.getResource(identity.getCanonicalForm()) == null) {
                        repository.addResource(auxres.adapt(CompositeData.class));
                        result.add(identity);
                    }
                    auxres = reader.nextResource();
                }
            } finally {
View Full Code Here

Examples of org.jboss.gravia.repository.RepositoryStorage.addResource()

                InputStream input = res.openStream();
                RepositoryReader reader = new DefaultRepositoryXMLReader(input);
                org.jboss.gravia.resource.Resource auxres = reader.nextResource();
                while (auxres != null) {
                    if (storage.getResource(auxres.getIdentity()) == null) {
                        storage.addResource(auxres);
                    }
                    auxres = reader.nextResource();
                }
            } catch (IOException e) {
                throw new IllegalStateException("Cannot install feature to repository: " + res.getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.