Package com.googlecode.objectify

Examples of com.googlecode.objectify.ObjectifyFactory


  }
 
  @Provides @Singleton
  ObjectifyFactory getOfyFact() {
    log.fine("Configuring ObjectifyFactory");
    ObjectifyFactory fact = new ObjectifyFactory();
    fact.register(WebdavUser.class);
    fact.register(WebdavFileData.class);
    fact.register(WebdavFolder.class);
    fact.register(WebdavFile.class);
    return fact;
  }
View Full Code Here


    @Test
    public void testGetObjectWithJavaPersisitenceEntity() throws Exception {
        factory.setBasePackage("com.mycompany.domain");
        factory.afterPropertiesSet();
       
        ObjectifyFactory objectifyFactory = factory.getObject();
       
        Class<?> clazz = Car.class; // Car is annotated with javax.persistence.Entity
        assertNotNull(objectifyFactory.getMetadata(clazz));
        assertNotNull(clazz.getAnnotation(javax.persistence.Entity.class));
    }
View Full Code Here

    @Test
    public void testGetObjectWithObjectifyEntity() throws Exception {
        factory.setBasePackage("com.othercompany.domain");
        factory.afterPropertiesSet();
       
        ObjectifyFactory objectifyFactory = factory.getObject();
       
        Class<?> clazz = Insurance.class; // Insurance is annotated with com.googlecode.objectify.annotation.Entity
        assertNotNull(objectifyFactory.getMetadata(clazz));
        assertNotNull(clazz.getAnnotation(com.googlecode.objectify.annotation.Entity.class));
    }
View Full Code Here

    @Test
    public void testGetObjectWithBasePackage() throws Exception {
        factory.setBasePackage("com.mycompany.domain");
        factory.afterPropertiesSet();
       
        ObjectifyFactory objectifyFactory = factory.getObject();
       
        assertNotNull(objectifyFactory.getMetadata(Car.class));
        assertNotNull(objectifyFactory.getMetadata(Person.class));
    }
View Full Code Here

    @Test
    public void testGetObjectWithBasePackages() throws Exception {
        factory.setBasePackage("com.mycompany.domain;com.othercompany.domain;com.notexistingcompany.domain");
        factory.afterPropertiesSet();
       
        ObjectifyFactory objectifyFactory = factory.getObject();
       
        assertNotNull(objectifyFactory.getMetadata(Car.class));
        assertNotNull(objectifyFactory.getMetadata(Person.class));
        assertNotNull(objectifyFactory.getMetadata(Insurance.class));
    }
View Full Code Here

        classes.add(Insurance.class);
       
        factory.setClasses(classes);
        factory.afterPropertiesSet();
       
        ObjectifyFactory objectifyFactory = factory.getObject();
       
        assertNotNull(objectifyFactory.getMetadata(Car.class));
        assertNotNull(objectifyFactory.getMetadata(Person.class));
        assertNotNull(objectifyFactory.getMetadata(Insurance.class));
    }
View Full Code Here

       
        factory.setBasePackage("com.mycompany.domain");
        factory.setClasses(classes);
        factory.afterPropertiesSet();
       
        ObjectifyFactory objectifyFactory = factory.getObject();
       
        assertNotNull(objectifyFactory.getMetadata(Car.class));
        assertNotNull(objectifyFactory.getMetadata(Person.class));
        assertNotNull(objectifyFactory.getMetadata(Insurance.class));
    }
View Full Code Here

       
        if (basePackage != null && basePackage.length() > 0) {
            classes.addAll(doScan());
        }
       
        this.objectifyFactory = new ObjectifyFactory();
       
        for (Class<?> clazz : classes) {
            this.objectifyFactory.register(clazz);
            if (this.logger.isInfoEnabled()) {
                this.logger.info("Registered entity class [" + clazz.getName() + "]");
View Full Code Here

  }

  @Test
  public void testGetFactory() {

    ObjectifyFactory factory = persiter.getFactory();

    assertNotNull(factory);
    assertEquals(objectifyFactory, factory);

  }
View Full Code Here

    @Override
    public void prepare() throws Exception {
        request.setAttribute(GUI_SERVICE, getGuiService());
        request.setAttribute(CURRENT_PAGE, getCurrentUrl());
        ObjectifyFactory objectifyFactory = getGuiService().getObjectifyFactory();
        ObjectifyOpts opts = new ObjectifyOpts().setSessionCache(true);
        Objectify objectify = objectifyFactory.begin(opts);
        request.setAttribute(OBJECTIFY, objectify);
        this.objectify = objectify;

        if (request.getParameter("errorMessages") !=null) {
            List<String> errorMessages = new ArrayList<String>() ;
View Full Code Here

TOP

Related Classes of com.googlecode.objectify.ObjectifyFactory

Copyright © 2018 www.massapicom. 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.