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