当前位置: 首页>>代码示例>>Java>>正文


Java ObjectifyFactory类代码示例

本文整理汇总了Java中com.googlecode.objectify.ObjectifyFactory的典型用法代码示例。如果您正苦于以下问题:Java ObjectifyFactory类的具体用法?Java ObjectifyFactory怎么用?Java ObjectifyFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ObjectifyFactory类属于com.googlecode.objectify包,在下文中一共展示了ObjectifyFactory类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initOfyOnce

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
/**
 * Performs static initialization for Objectify to register types and do other setup.
 *
 * <p>This method is non-idempotent, so it should only be called exactly once, which is achieved
 * by calling it from this class's static initializer block.
 */
private static void initOfyOnce() {
  // Set an ObjectifyFactory that uses our extended ObjectifyImpl.
  // The "false" argument means that we are not using the v5-style Objectify embedded entities.
  com.googlecode.objectify.ObjectifyService.setFactory(new ObjectifyFactory(false) {
    @Override
    public Objectify begin() {
      return new SessionKeyExposingObjectify(this);
    }

    @Override
    protected AsyncDatastoreService createRawAsyncDatastoreService(DatastoreServiceConfig cfg) {
      // In the unit test environment, wrap the Datastore service in a proxy that can be used to
      // examine the number of requests sent to Datastore.
      AsyncDatastoreService service = super.createRawAsyncDatastoreService(cfg);
      return RegistryEnvironment.get().equals(RegistryEnvironment.UNITTEST)
          ? new RequestCapturingAsyncDatastoreService(service)
          : service;
    }});

  // Translators must be registered before any entities can be registered.
  registerTranslators();
  registerEntityClasses(EntityClasses.ALL_CLASSES);
}
 
开发者ID:google,项目名称:nomulus,代码行数:30,代码来源:ObjectifyService.java

示例2: before

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
@Before
public void before() {
  helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig()).setUp();
  // Clear out the factory so that it requires re-registration on each test method.
  // Otherwise, static registration of types in one method would persist across methods.
  initOfy();
  factory = ObjectifyService.factory();
  ObjectifyService.setFactory(new ObjectifyFactory(false));
}
 
开发者ID:google,项目名称:nomulus,代码行数:10,代码来源:OfyFilterTest.java

示例3: setUpBeforeClass

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() {
  // Reset the Factory so that all translators work properly.
  ObjectifyService.setFactory(new ObjectifyFactory());
  ObjectifyService.register(Game.class);
  // Mock out the firebase config
  FirebaseChannel.firebaseConfigStream = new ByteArrayInputStream(
      String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
}
 
开发者ID:GoogleCloudPlatform,项目名称:java-docs-samples,代码行数:10,代码来源:TicTacToeServletTest.java

示例4: setUpBeforeClass

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() {
  // Reset the Factory so that all translators work properly.
  ObjectifyService.setFactory(new ObjectifyFactory());
  ObjectifyService.register(Game.class);
  // Mock out the firebase config
  FirebaseChannel.firebaseConfigStream =
      new ByteArrayInputStream(String.format("databaseURL: \"%s\"", FIREBASE_DB_URL).getBytes());
}
 
开发者ID:GoogleCloudPlatform,项目名称:java-docs-samples,代码行数:10,代码来源:TicTacToeServletTest.java

示例5: init

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
@Override
public void init(final ObjectifyFactory fact, final Field field)
{
	Preconditions.checkNotNull(fact);
	Preconditions.checkNotNull(field);

	// Store off the field for use in the matches method.
	this.field = field;
}
 
开发者ID:instacount,项目名称:appengine-counter,代码行数:10,代码来源:IfCounterDataIndexable.java

示例6: before

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
@Before
public void before() throws NoSuchFieldException
{
	this.fact = new ObjectifyFactory();

	this.numShardsField = CounterData.class.getDeclaredField("numShards");
	this.counterStatusField = CounterData.class.getDeclaredField("counterStatus");
	this.counterDescriptionField = CounterData.class.getDeclaredField("description");
	this.counterCountField = CounterGroupData.class.getDeclaredField("eventuallyConsistentCount");

	this.counterData = new CounterData("testCounterName", 3);
}
 
开发者ID:instacount,项目名称:appengine-counter,代码行数:13,代码来源:IfCounterDataIndexableTest.java

示例7: addTranslators

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
@Override
protected void addTranslators(ObjectifyFactory factory) {
    for (TranslatorFactory translatorFactory : ApplicationModule.objectifyTranslatorFactories()) {
        factory.getTranslators().add(translatorFactory);
    }
}
 
开发者ID:3wks,项目名称:generator-thundr-gae-react,代码行数:7,代码来源:TestObjectify.java

示例8: addDefaultTranslators

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
public static void addDefaultTranslators() {
    // register Objectify converter to convert between java.uil.Date and org.joda.time.DateTime
    ObjectifyFactory objectifyFactory = ObjectifyService.factory();
    JodaTimeTranslators.add(objectifyFactory);
    objectifyFactory.getTranslators().add(new UUIDTranslatorFactory());
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:7,代码来源:ObjectifyModule.java

示例9: addTranslators

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
protected void addTranslators(ObjectifyFactory factory) {
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:3,代码来源:SetupObjectify.java

示例10: newObjectifyFactory

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
protected ObjectifyFactory newObjectifyFactory() {
    return new ObjectifyFactory();
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:4,代码来源:SetupObjectify.java

示例11: factory

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
public static ObjectifyFactory factory() {
    return ObjectifyService.factory();
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:4,代码来源:OfyService.java

示例12: factory

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
public static ObjectifyFactory factory() {
	return ObjectifyService.factory();
}
 
开发者ID:LabPLC,项目名称:MapatonAPI,代码行数:4,代码来源:OfyService.java

示例13: factory

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
/** Returns the wrapped Objectify's ObjectifyFactory. */
public ObjectifyFactory factory() {
  return ofy().factory();
}
 
开发者ID:google,项目名称:nomulus,代码行数:5,代码来源:Ofy.java

示例14: SessionKeyExposingObjectify

import com.googlecode.objectify.ObjectifyFactory; //导入依赖的package包/类
public SessionKeyExposingObjectify(ObjectifyFactory factory) {
  super(factory);
}
 
开发者ID:google,项目名称:nomulus,代码行数:4,代码来源:SessionKeyExposingObjectify.java


注:本文中的com.googlecode.objectify.ObjectifyFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。