當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。