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


Java DataFactory.getLastName方法代码示例

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


在下文中一共展示了DataFactory.getLastName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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() {
	customerNr = "CN - " + (int)(Math.random() * 9000 + 1000);
	DataFactory df = new DataFactory();
	surname = df.getLastName();
	firstname = df.getFirstName();
	boolean male = Math.random() < 0.5;
	email = firstname.toLowerCase() + "." + surname.toLowerCase() + "@loremipsum.com";
	company = surname + " " + (Math.random() < 0.5 ? "AG" : "GmbH");
	salutation = male ? Salutation.Male : Salutation.Female;
	customersince = LocalDate.now();
}
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:13,代码来源:Customer.java

示例3: fillWithDemoData

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@Override
protected void fillWithDemoData(Customer customer) {
	super.fillWithDemoData(customer);
	DataFactory df = new DataFactory();
	customer.name = df.getLastName();
	customer.firstName = df.getFirstName();
}
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:8,代码来源:CustomerForm.java

示例4: 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

示例5: 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

示例6: mock

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@Override
public void mock() {
	DataFactory df = new DataFactory();
	firstName = df.getFirstName();
	lastName = df.getLastName();
}
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:7,代码来源:Person.java

示例7: mock

import org.fluttercode.datafactory.impl.DataFactory; //导入方法依赖的package包/类
@Override
public void mock() {		
	DataFactory df = new DataFactory();
	firstName = df.getFirstName();
	lastName = df.getLastName();
}
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:7,代码来源:Person.java


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