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


Java PreRemove类代码示例

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


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

示例1: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<Promotion> promotions = getPromotions();
	if (promotions != null) {
		for (Promotion promotion : promotions) {
			promotion.getCoupons().remove(this);
		}
	}
	List<Order> orders = getOrders();
	if (orders != null) {
		for (Order order : orders) {
			order.getCoupons().remove(this);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:19,代码来源:Coupon.java

示例2: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<PaymentMethod> paymentMethods = getPaymentMethods();
	if (paymentMethods != null) {
		for (PaymentMethod paymentMethod : paymentMethods) {
			paymentMethod.getShippingMethods().remove(this);
		}
	}
	Set<Order> orders = getOrders();
	if (orders != null) {
		for (Order order : orders) {
			order.setShippingMethod(null);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:19,代码来源:ShippingMethod.java

示例3: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<Article> articles = getArticles();
	if (articles != null) {
		for (Article article : articles) {
			article.getTags().remove(this);
		}
	}
	Set<Product> products = getProducts();
	if (products != null) {
		for (Product product : products) {
			product.getTags().remove(this);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:19,代码来源:Tag.java

示例4: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<Member> favoriteMembers = getFavoriteMembers();
	if (favoriteMembers != null) {
		for (Member favoriteMember : favoriteMembers) {
			favoriteMember.getFavoriteProducts().remove(this);
		}
	}
	Set<Promotion> promotions = getPromotions();
	if (promotions != null) {
		for (Promotion promotion : promotions) {
			promotion.getProducts().remove(this);
		}
	}
	Set<OrderItem> orderItems = getOrderItems();
	if (orderItems != null) {
		for (OrderItem orderItem : orderItems) {
			orderItem.setProduct(null);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:25,代码来源:Product.java

示例5: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<Product> products = getProducts();
	if (products != null) {
		for (Product product : products) {
			product.setBrand(null);
		}
	}
	Set<ProductCategory> productCategories = getProductCategories();
	if (productCategories != null) {
		for (ProductCategory productCategory : productCategories) {
			productCategory.getBrands().remove(this);
		}
	}
	Set<Promotion> promotions = getPromotions();
	if (promotions != null) {
		for (Promotion promotion : promotions) {
			promotion.getBrands().remove(this);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:25,代码来源:Brand.java

示例6: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
@PreRemove
public void preRemove() {
    if (getCertificates() != null) {
        // Dates are converted to UTC before saving into the DB
        Calendar cal = Calendar.getInstance();
        long offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
        Date now = new Date(cal.getTimeInMillis() - offset);
        for (Certificate cert : getCertificates()) {
            // Revoke certificates
            cert.setRevokedAt(now);
            cert.setRevokeReason("cessationofoperation");
            cert.setRevoked(true);
            // Detach certificate from entity - since the model type isn't known, just blank all.
            cert.setOrganization(null);
            cert.setDevice(null);
            cert.setService(null);
            cert.setUser(null);
            cert.setVessel(null);
        }
    }
}
 
开发者ID:MaritimeConnectivityPlatform,项目名称:IdentityRegistry,代码行数:22,代码来源:CertificateModel.java

示例7: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	// Set<User> favoriteUsers = getFavoriteUsers();
	// if (favoriteUsers != null) {
	// for (User favoriteMember : favoriteUsers) {
	// favoriteMember.getFavoriteProducts().remove(this);
	// }
	// }
	Set<Promotion> promotions = getPromotions();
	if (promotions != null) {
		for (Promotion promotion : promotions) {
			promotion.getProducts().remove(this);
		}
	}
	Set<OrderItem> orderItems = getOrderItems();
	if (orderItems != null) {
		for (OrderItem orderItem : orderItems) {
			orderItem.setProduct(null);
		}
	}
}
 
开发者ID:xiangxik,项目名称:java-platform,代码行数:25,代码来源:Product.java

示例8: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
@PreRemove
public void preRemove() {
	for (TmContactEasy arg0 : getTmContactEasies()) {
		arg0.setReqServHotel(null);
	}



	docDocumentsByDocumentForUserId = null;
	docDocumentsByDocumentForHotelId = null;
	paymentPrice = null;
	paymentTariff = null;
	servHotel = null;
	servHotelRoom = null;
	usersByRequestUserId = null;
	usersByResponseUserId = null;

}
 
开发者ID:gleb619,项目名称:hotel_shop,代码行数:19,代码来源:ReqServHotel.java

示例9: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
@PreRemove
public void preRemove() {
	for (ServTransferRoute arg0 : getServTransferRoutes()) {
		arg0.setServTransfer(null);
	}



	currCurrency = null;
	dictGlobalByPaymentTypeId = null;
	dictGlobalByTypeTransferId = null;
	dictGlobalByTransportId = null;
	locationCities = null;
	locationCountries = null;
	tmAccount = null;

}
 
开发者ID:gleb619,项目名称:hotel_shop,代码行数:18,代码来源:ServTransfer.java

示例10: processDefaultJpaCallbacks

import javax.persistence.PreRemove; //导入依赖的package包/类
private void processDefaultJpaCallbacks(String instanceCallbackClassName, List<JpaCallbackClass> jpaCallbackClassList) {
	ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

	// Process superclass first if available and not excluded
	if ( JandexHelper.getSingleAnnotation( callbackClassInfo, JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
		DotName superName = callbackClassInfo.superName();
		if ( superName != null ) {
			processDefaultJpaCallbacks( instanceCallbackClassName, jpaCallbackClassList );
		}
	}

	String callbackClassName = callbackClassInfo.name().toString();
	Map<Class<?>, String> callbacksByType = new HashMap<Class<?>, String>();
	createDefaultCallback(
			PrePersist.class, PseudoJpaDotNames.DEFAULT_PRE_PERSIST, callbackClassName, callbacksByType
	);
	createDefaultCallback(
			PreRemove.class, PseudoJpaDotNames.DEFAULT_PRE_REMOVE, callbackClassName, callbacksByType
	);
	createDefaultCallback(
			PreUpdate.class, PseudoJpaDotNames.DEFAULT_PRE_UPDATE, callbackClassName, callbacksByType
	);
	createDefaultCallback(
			PostLoad.class, PseudoJpaDotNames.DEFAULT_POST_LOAD, callbackClassName, callbacksByType
	);
	createDefaultCallback(
			PostPersist.class, PseudoJpaDotNames.DEFAULT_POST_PERSIST, callbackClassName, callbacksByType
	);
	createDefaultCallback(
			PostRemove.class, PseudoJpaDotNames.DEFAULT_POST_REMOVE, callbackClassName, callbacksByType
	);
	createDefaultCallback(
			PostUpdate.class, PseudoJpaDotNames.DEFAULT_POST_UPDATE, callbackClassName, callbacksByType
	);
	if ( !callbacksByType.isEmpty() ) {
		jpaCallbackClassList.add( new JpaCallbackClassImpl( instanceCallbackClassName, callbacksByType, true ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:EntityClass.java

示例11: processJpaCallbacks

import javax.persistence.PreRemove; //导入依赖的package包/类
private void processJpaCallbacks(String instanceCallbackClassName, boolean isListener, List<JpaCallbackClass> callbackClassList) {

		ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

		// Process superclass first if available and not excluded
		if ( JandexHelper.getSingleAnnotation( callbackClassInfo, JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
			DotName superName = callbackClassInfo.superName();
			if ( superName != null ) {
				processJpaCallbacks(
						instanceCallbackClassName,
						isListener,
						callbackClassList
				);
			}
		}

		Map<Class<?>, String> callbacksByType = new HashMap<Class<?>, String>();
		createCallback( PrePersist.class, JPADotNames.PRE_PERSIST, callbacksByType, callbackClassInfo, isListener );
		createCallback( PreRemove.class, JPADotNames.PRE_REMOVE, callbacksByType, callbackClassInfo, isListener );
		createCallback( PreUpdate.class, JPADotNames.PRE_UPDATE, callbacksByType, callbackClassInfo, isListener );
		createCallback( PostLoad.class, JPADotNames.POST_LOAD, callbacksByType, callbackClassInfo, isListener );
		createCallback( PostPersist.class, JPADotNames.POST_PERSIST, callbacksByType, callbackClassInfo, isListener );
		createCallback( PostRemove.class, JPADotNames.POST_REMOVE, callbacksByType, callbackClassInfo, isListener );
		createCallback( PostUpdate.class, JPADotNames.POST_UPDATE, callbacksByType, callbackClassInfo, isListener );
		if ( !callbacksByType.isEmpty() ) {
			callbackClassList.add( new JpaCallbackClassImpl( instanceCallbackClassName, callbacksByType, isListener ) );
		}
	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:EntityClass.java

示例12: onPreRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
@PreRemove
void onPreRemove(Object o) {
	String txId = (String)ThreadLocalContext.get(CompositeTransactionParticipantService.CURRENT_TRANSACTION_KEY);
	if (null == txId){
		LOG.info("onPreRemove outside any transaction");
	} else {	
		LOG.info("onPreRemove inside transaction [{}]", txId);
		enlist(o, EntityCommand.Action.DELETE, txId);
	}
}
 
开发者ID:jotorren,项目名称:microservices-transactions-tcc,代码行数:11,代码来源:ChangeStateJpaListener.java

示例13: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	if (getDeposit() != null) {
		getDeposit().setPayment(null);
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:10,代码来源:Payment.java

示例14: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<Deposit> deposits = getDeposits();
	if (deposits != null) {
		for (Deposit deposit : deposits) {
			deposit.setOrder(null);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:13,代码来源:Order.java

示例15: preRemove

import javax.persistence.PreRemove; //导入依赖的package包/类
/**
 * 删除前处理
 */
@PreRemove
public void preRemove() {
	Set<Promotion> promotions = getPromotions();
	if (promotions != null) {
		for (Promotion promotion : promotions) {
			promotion.getProductCategories().remove(this);
		}
	}
}
 
开发者ID:justinbaby,项目名称:my-paper,代码行数:13,代码来源:ProductCategory.java


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