项目:my-paper
文件:Coupon.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:my-paper
文件:ShippingMethod.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:my-paper
文件:Tag.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:my-paper
文件:Product.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:my-paper
文件:Brand.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:IdentityRegistry
文件:CertificateModel.java
@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);
}
}
}
项目:java-platform
文件:Product.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:java-platform
文件:Brand.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:java-platform
文件:ShippingMethod.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:java-platform
文件:Coupon.java
/**
* 删除前处理
*/
@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);
}
}
}
项目:hotel_shop
文件:ReqServHotel.java
@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;
}
项目:hotel_shop
文件:ServTransfer.java
@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;
}
项目:Pet-Supply-Store
文件:PersistenceOrder.java
/**
* Delete orders and order items.
*/
@PreRemove
private void deleteOrders() {
EntityManager em = OrderRepository.REPOSITORY.getEMF().createEntityManager();
try {
em.getTransaction().begin();
em.createquery("DELETE FROM PersistenceOrderItem oi WHERE oi.order = :order")
.setParameter("order",this).executeUpdate();
em.getTransaction().commit();
} finally {
em.close();
}
}
项目:Pet-Supply-Store
文件:PersistenceUser.java
/**
* Delete orders and order items.
*/
@PreRemove
private void deleteOrders() {
EntityManager em = UserRepository.REPOSITORY.getEMF().createEntityManager();
try {
em.getTransaction().begin();
em.createquery("DELETE FROM PersistenceOrderItem oi WHERE oi.order.user = :user")
.setParameter("user",this).executeUpdate();
em.createquery("DELETE FROM PersistenceOrder o WHERE o.user = :user")
.setParameter("user",this).executeUpdate();
em.getTransaction().commit();
} finally {
em.close();
}
}
项目:lams
文件:EntityClass.java
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,callbacksByType
);
createDefaultCallback(
PreUpdate.class,PseudoJpaDotNames.DEFAULT_PRE_UPDATE,callbacksByType
);
createDefaultCallback(
PostLoad.class,PseudoJpaDotNames.DEFAULT_POST_LOAD,callbacksByType
);
createDefaultCallback(
PostPersist.class,PseudoJpaDotNames.DEFAULT_POST_PERSIST,callbacksByType
);
createDefaultCallback(
PostRemove.class,PseudoJpaDotNames.DEFAULT_POST_REMOVE,callbacksByType
);
createDefaultCallback(
PostUpdate.class,PseudoJpaDotNames.DEFAULT_POST_UPDATE,callbacksByType
);
if ( !callbacksByType.isEmpty() ) {
jpaCallbackClassList.add( new JpaCallbackClassImpl( instanceCallbackClassName,callbacksByType,true ) );
}
}
项目:lams
文件:EntityClass.java
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>();
createCallback( PrePersist.class,JPADotNames.PRE_PERSIST,callbackClassInfo,isListener );
createCallback( PreRemove.class,JPADotNames.PRE_REMOVE,isListener );
createCallback( PreUpdate.class,JPADotNames.PRE_UPDATE,isListener );
createCallback( PostLoad.class,JPADotNames.POST_LOAD,isListener );
createCallback( PostPersist.class,JPADotNames.POST_PERSIST,isListener );
createCallback( PostRemove.class,JPADotNames.POST_REMOVE,isListener );
createCallback( PostUpdate.class,JPADotNames.POST_UPDATE,isListener );
if ( !callbacksByType.isEmpty() ) {
callbackClassList.add( new JpaCallbackClassImpl( instanceCallbackClassName,isListener ) );
}
}
项目:microservices-transactions-tcc
文件:ChangeStateJpaListener.java
@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);
}
}
项目:my-paper
文件:Payment.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
if (getDeposit() != null) {
getDeposit().setPayment(null);
}
}
项目:my-paper
文件:Order.java
项目:my-paper
文件:ProductCategory.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Promotion> promotions = getPromotions();
if (promotions != null) {
for (Promotion promotion : promotions) {
promotion.getProductCategories().remove(this);
}
}
}
项目:my-paper
文件:PaymentMethod.java
项目:my-paper
文件:Admin.java
项目:my-paper
文件:MemberRank.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Promotion> promotions = getPromotions();
if (promotions != null) {
for (Promotion promotion : promotions) {
promotion.getMemberRanks().remove(this);
}
}
}
项目:my-paper
文件:Area.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Member> members = getMembers();
if (members != null) {
for (Member member : members) {
member.setArea(null);
}
}
Set<Receiver> receivers = getReceivers();
if (receivers != null) {
for (Receiver receiver : receivers) {
receiver.setArea(null);
}
}
Set<Order> orders = getorders();
if (orders != null) {
for (Order order : orders) {
order.setArea(null);
}
}
Set<DeliveryCenter> deliveryCenters = getDeliveryCenters();
if (deliveryCenters != null) {
for (DeliveryCenter deliveryCenter : deliveryCenters) {
deliveryCenter.setArea(null);
}
}
}
项目:my-paper
文件:DeliveryCorp.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<ShippingMethod> shippingMethods = getShippingMethods();
if (shippingMethods != null) {
for (ShippingMethod shippingMethod : shippingMethods) {
shippingMethod.setDefaultDeliveryCorp(null);
}
}
}
项目:my-paper
文件:CouponCode.java
项目:java-platform
文件:ArticleTag.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Article> articles = getArticles();
if (articles != null) {
for (Article article : articles) {
article.getTags().remove(this);
}
}
}
项目:java-platform
文件:ProductCategory.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Promotion> promotions = getPromotions();
if (promotions != null) {
for (Promotion promotion : promotions) {
promotion.getProductCategories().remove(this);
}
}
}
项目:java-platform
文件:ProductTag.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Product> products = getProducts();
if (products != null) {
for (Product product : products) {
product.getTags().remove(this);
}
}
}
项目:java-platform
文件:Payment.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
if (getDeposit() != null) {
getDeposit().setPayment(null);
}
}
项目:java-platform
文件:Order.java
项目:java-platform
文件:PaymentMethod.java
项目:java-platform
文件:DeliveryCorp.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<ShippingMethod> shippingMethods = getShippingMethods();
if (shippingMethods != null) {
for (ShippingMethod shippingMethod : shippingMethods) {
shippingMethod.setDefaultDeliveryCorp(null);
}
}
}
项目:java-platform
文件:Rank.java
/**
* 删除前处理
*/
@PreRemove
public void preRemove() {
Set<Promotion> promotions = getPromotions();
if (promotions != null) {
for (Promotion promotion : promotions) {
promotion.getMemberRanks().remove(this);
}
}
}
项目:java-platform
文件:CouponCode.java
项目:hotel_shop
文件:ServHotelRoom.java
@PreRemove
public void preRemove() {
for (ReqServHotel arg0 : getReqServHotels()) {
arg0.setServHotelRoom(null);
}
dictGlobal = null;
paymentTariffByCostTarriffId = null;
paymentTariffByRrTarriffId = null;
paymentTariffShop = null;
servHotel = null;
}
项目:GamificationEngine-Kinben
文件:FinishedTask.java
/**
* Before a finishedTask is removed from the dataBase it should have to be removed from the player's
* list of finished tasks.
*/
@PreRemove
private void removeFTaskFromPlayer() {
if(player!=null){
player.removeFinishedTask(this);
}
}
项目:MathMLCanEval
文件:CanonicOutput.java
@PreRemove
private void removeOutputFromParents()
{
for (Formula f : parents)
{
f.getoutputs().remove(this);
}
}
项目:MathMLCanEval
文件:Formula.java
@PreRemove
private void removeFormulaFromOutputs()
{
for (CanonicOutput co : outputs)
{
co.getParents().remove(this);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。