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


Java Author类代码示例

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


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

示例1: saveBusinessObject

import edu.sampleu.bookstore.bo.Author; //导入依赖的package包/类
@Override
public void saveBusinessObject() {
	// TODO Auto-generated method stub
	Book book = (Book) this.getBusinessObject();


	// /-----------------------------------------------------///
	// /-----------------------------------------------------///
	// /---IF author has to be edited from Book Document-----///
	// /---follow the below mentioned code else comment out--///
	// /-----------------------------------------------------///
	// /-----------------------------------------------------///
	List<Author> authors = book.getAuthors();
	for (Author author : authors) {
		Account account = (Account) author.getExtension();
		if (account != null && account.getAuthorId() == null) {
			author.setExtension(null);
		}

           KNSServiceLocator.getBusinessObjectService().save(author);

		if (account != null && account.getAuthorId() == null) {
			account.setAuthorId(author.getAuthorId());
               KNSServiceLocator.getBusinessObjectService().save(account);
		}
	}

	book.setAuthors(authors);
       KNSServiceLocator.getBusinessObjectService().save(book);

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:BookMaintainable.java

示例2: saveBusinessObject

import edu.sampleu.bookstore.bo.Author; //导入依赖的package包/类
@Override
public void saveBusinessObject() {
	// TODO Auto-generated method stub
	Book book = (Book) this.getBusinessObject();


	// /-----------------------------------------------------///
	// /-----------------------------------------------------///
	// /---IF author has to be edited from Book Document-----///
	// /---follow the below mentioned code else comment out--///
	// /-----------------------------------------------------///
	// /-----------------------------------------------------///
	List<Author> authors = book.getAuthors();
	for (Author author : authors) {
		Account account = (Account) author.getExtension();
		if (account != null && account.getAuthorId() == null) {
			author.setExtension(null);
		}

		KRADServiceLocator.getBusinessObjectService().save(author);

		if (account != null && account.getAuthorId() == null) {
			account.setAuthorId(author.getAuthorId());
			KRADServiceLocator.getBusinessObjectService().save(account);
		}
	}

	book.setAuthors(authors);
	KRADServiceLocator.getBusinessObjectService().save(book);

}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:32,代码来源:BookMaintainable.java

示例3: processGlobalRouteDocumentBusinessRules

import edu.sampleu.bookstore.bo.Author; //导入依赖的package包/类
@Override
protected boolean processGlobalRouteDocumentBusinessRules(
		MaintenanceDocument document) {
	// TODO Auto-generated method stub
	System.out.println("****Inside Global*****");
	// cast the document to a Author Document
	Author author = (Author)document.getDocumentDataObject();
	System.out.println("Inside Global Aothor Got is : " + author);
	System.out.println("****Inside Global*****");
	// get the list of book order entries off of the book order document
	List<Address> addressEntries = author.getAddresses();
	System.out.println("Inside Global Aothor address is : " + addressEntries);
	
	// make sure that the list is not empty
	if (addressEntries == null || addressEntries.isEmpty()) {
		System.out.println("--Got addressEntries Null--");
		GlobalVariables.getMessageMap().putError(
				AUTHOR_ENTRIES_PROPERTY_PATH,NO_ADDRESS_TYPE_ERROR_KEY,
				ERROR_MESSAGE_NO_ADDTYPE_FOUND);
		return false;
	} else {
		System.out.println("--Got addressEntries Obj--");
		System.out.println("Inside Global Aothor address Size is : " + addressEntries.size());
		Address tempAddress = null;
		for(Address address : addressEntries){
			tempAddress = address;
			for(Address address2 : addressEntries){
				if(!tempAddress.equals(address2)){
					if(tempAddress.getAddressType()!= null && tempAddress.getAddressType().getType().equals(address2.getAddressType().getType())){
						System.out.println("Got Same Address Typr");
						GlobalVariables.getMessageMap().putError(
								AUTHOR_ENTRIES_PROPERTY_PATH,SAME_ADDRESS_TYPE_ERROR_KEY,
								ERROR_MESSAGE_SAME_ADDTYPR_FOUND);
						return false;
					}
				}else {
					System.out.println("Got Same Address Object");
				} 
			}
		}
		
	}
	
	
	
	return super.processGlobalRouteDocumentBusinessRules(document);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:48,代码来源:AuthorMaintenanceDocumentRule.java

示例4: processGlobalRouteDocumentBusinessRules

import edu.sampleu.bookstore.bo.Author; //导入依赖的package包/类
@Override
protected boolean processGlobalRouteDocumentBusinessRules(
		MaintenanceDocument document) {
	// TODO Auto-generated method stub
	System.out.println("****Inside Global*****");
	// cast the document to a Author Document
	Author author = (Author)document.getDocumentDataObject();
	System.out.println("Inside Global Aothor Got is : " + author);
	System.out.println("****Inside Global*****");
	// get the list of book order entries off of the book order document
	List<Address> addressEntries = author.getAddresses();
	System.out.println("Inside Global Aothor address is : " + addressEntries);
	
	// make sure that the list is not empty
	if (addressEntries == null || addressEntries.isEmpty()) {
		System.out.println("--Got addressEntries Null--");
		GlobalVariables.getMessageMap().putError(
				AUTHOR_ENTRIES_PROPERTY_PATH,NO_ADDRESS_TYPE_ERROR_KEY,
				ERROR_MESSAGE_NO_ADDTYPE_FOUND);
		return false;
	} else {
		System.out.println("--Got addressEntries Obj--");
		System.out.println("Inside Global Aothor address Size is : " + addressEntries.size());
		Address tempAddress = null;
		for(Address address : addressEntries){
			tempAddress = address;
			for(Address address2 : addressEntries){
				if(!tempAddress.equals(address2)){
					if(tempAddress.getAddressType()!= null && tempAddress.getAddressType() != null && tempAddress.getAddressType().getType().equals(address2.getAddressType().getType())){
						System.out.println("Got Same Address Typr");
						GlobalVariables.getMessageMap().putError(
								AUTHOR_ENTRIES_PROPERTY_PATH,SAME_ADDRESS_TYPE_ERROR_KEY,
								ERROR_MESSAGE_SAME_ADDTYPR_FOUND);
						return false;
					}
				}else {
					System.out.println("Got Same Address Object");
				} 
			}
		}
		
	}
	
	
	
	return super.processGlobalRouteDocumentBusinessRules(document);
}
 
开发者ID:kuali,项目名称:rice,代码行数:48,代码来源:AuthorMaintenanceDocumentRule.java


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