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


Java DataFactory.getCity方法代码示例

本文整理汇总了Java中org.fluttercode.datafactory.impl.DataFactory.getCity方法的典型用法代码示例。如果您正苦于以下问题:Java DataFactory.getCity方法的具体用法?Java DataFactory.getCity怎么用?Java DataFactory.getCity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fluttercode.datafactory.impl.DataFactory的用法示例。


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

示例1: setupUser

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@GET
@Path("/setupuser")
@Produces(MediaType.APPLICATION_JSON)
public String setupUser() {
	logger.info("Setup aufrufen");
	DataFactory df = DataFactory.create();
	
	User user = new User(df.getFirstName(),df.getLastName(), df.getEmailAddress());
	Key<User> userKey = ObjectifyService.ofy().save().entity(user).now();
	User user2 = new User(df.getFirstName(),df.getLastName(), df.getEmailAddress());
	Key<User> user2Key = ObjectifyService.ofy().save().entity(user2).now();
	
	Address addr = new Address(df.getCity(),String.valueOf( df.getNumberBetween(10000, 99999)), df.getStreetName(), 
			String.valueOf(df.getNumberUpTo(300)));
	// need to store to db, so the address entity gets a key in the db that can be assigned to the item
	Key<Address> key = ObjectifyService.ofy().save().entity(addr).now();
	
	Address addr2 = new Address(df.getCity(),String.valueOf( df.getNumberBetween(10000, 99999)), df.getStreetName(), 
			String.valueOf(df.getNumberUpTo(300)));
	// need to store to db, so the address entity gets a key in the db that can be assigned to the item
	Key<Address> key2 = ObjectifyService.ofy().save().entity(addr2).now();
	
	user.addAddress(key2);
	user2.addAddress(key);
	
	UserRating userRating = new UserRating(userKey.getId(), user2Key.getId(), df.getNumberBetween(0, 5));
	ObjectifyService.ofy().save().entity(userRating).now();
	
	UserRating userRating2 = new UserRating(userKey.getId(), user2Key.getId(), df.getNumberBetween(0, 5));
	ObjectifyService.ofy().save().entity(userRating2).now();
	
    ObjectifyService.ofy().save().entity(user).now();
    ObjectifyService.ofy().save().entity(user2).now();
    logger.info("Saved user with address.");
	
    return "{\"status\":\"done\"}";
}
 
开发者ID:johanordin,项目名称:Shero,代码行数:38,代码来源:TestItemRestServices.java

示例2: mock

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@Override
  public void mock() {
  	person.mock();
DataFactory df = new DataFactory();
address = df.getAddress();
city = df.getCity();
  	telephone = String.valueOf(100000 + new Random().nextInt(900000));
  }
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:9,代码来源:Owner.java

示例3: mock

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@Override
  public void mock() {
DataFactory df = new DataFactory();
name1 = df.getName();
matchcode = name1;
address.city = df.getCity();
address.street = df.getStreetName();
  }
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:9,代码来源:Project.java

示例4: mock

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@Override
  public void mock() {
DataFactory df = new DataFactory();
name1 = df.getName();
matchcode = name1;
address.city = df.getCity();
address.street = df.getStreetName();
contact.email = df.getEmailAddress();
  }
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:10,代码来源:Customer.java

示例5: Person

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
public Person(int id, DataFactory dataFactory, SimpleDateFormat simpleDateFormat) {
    this.id = id;
    this.firstName = dataFactory.getFirstName();
    this.lastName = dataFactory.getLastName();
    this.city = dataFactory.getCity();
    this.company = new CustomCompany(dataFactory.getBusinessName());
    this.birthday = simpleDateFormat.format(dataFactory.getBirthDate());
    this.email = dataFactory.getEmailAddress();
    this.gender = id % 3 == 0;
}
 
开发者ID:lucas34,项目名称:android-spreadsheet-lib,代码行数:11,代码来源:Person.java

示例6: setupItem

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@GET
@Path("/setupitem")
@Produces(MediaType.APPLICATION_JSON)
public String setupItem() {
	logger.info("Setup aufrufen");
	DataFactory df = DataFactory.create();
	User user = new User(df.getFirstName(),df.getLastName(), df.getEmailAddress());
	Key<User> userKey = ObjectifyService.ofy().save().entity(user).now();
	User user2 = new User(df.getFirstName(),df.getLastName(), df.getEmailAddress());
	Key<User> user2Key = ObjectifyService.ofy().save().entity(user2).now();
	
	
	Item item = new Item(df.getRandomWord(5, 20), new Double(df.getNumber()), "description");
	Address addr = new Address(df.getCity(),String.valueOf( df.getNumberBetween(10000, 99999)), df.getStreetName(), 
			String.valueOf(df.getNumberUpTo(300)));
	// need to store to db, so the address entity gets a key in the db that can be assigned to the item
	ObjectifyService.ofy().save().entity(addr).now();
	item.setAddress(addr);
	
	Tag tag1 = new Tag("sports");
	Tag tag2 = new Tag("summer");
	Key<Tag> tag1Key = ObjectifyService.ofy().save().entity(tag1).now();
	Key<Tag> tag2Key = ObjectifyService.ofy().save().entity(tag2).now();
	 
	item.addTag(Ref.create(tag1Key));
	item.addTag(Ref.create(tag2Key));
	
	Key<Item> itemKey = ObjectifyService.ofy().save().entity(item).now();
	user.addItem(item);
	ObjectifyService.ofy().save().entity(user).now();
	
	int ratingValue = df.getNumberBetween(0, 5);
	ItemRating itemRating = new ItemRating(itemKey.getId(), userKey.getId(), ratingValue);
	item.updateRatingCount(ratingValue);
	ObjectifyService.ofy().save().entity(itemRating).now();
	
	ratingValue = df.getNumberBetween(0, 5);
	ItemRating itemRating2 = new ItemRating(itemKey.getId(), user2Key.getId(), ratingValue);
	item.updateRatingCount(ratingValue);
	
	// save item again to store updated rating counts
	ObjectifyService.ofy().save().entity(item).now();
	
	ObjectifyService.ofy().save().entity(itemRating2).now();
	logger.info("Saved successfully.");
    return "{\"status\":\"done\"}";
}
 
开发者ID:johanordin,项目名称:Shero,代码行数:48,代码来源:TestItemRestServices.java


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