users@glassfish.java.net

topLink, bean managed transaction, cascadeType.ALL

From: Hilmi Hilmiev <hhilmiev_at_gmail.com>
Date: Tue, 15 May 2007 16:37:49 +0300

Hello all,

I have following case:

//Entity
public class SupplierPriceLists implements Serializable {
    @Id
    @Column(name = "ArtID", nullable = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer artID;
}

//Entity
public class SupplierContracts implements Serializable {
     @Id
     @Column(name = "ContractID", nullable = false)
     @GeneratedValue(strategy=GenerationType.IDENTITY)
     private Integer contractID;

     @OneToMany(cascade = {CascadeType.ALL}, mappedBy = "contractID", fetch=
FetchType.EAGER)
     private Collection<SupplierPriceLists> supplierPriceListsCollection;
}

//Facade
public void edit( SupplierContracts supplierContracts ){
    SupplierContracts supplierContractsNew = (SupplierContracts) em.find(
SupplierContracts.class, supplierContracts.getContractID());
    List<SupplierPriceLists> lSupplierPriceLists = new
ArrayList<SupplierPriceLists>();
    supplierContractsNew.setSupplierPriceListsCollection
(lSupplierPriceLists);
    supplierContractsNew.setLastChangeDate(new Date());
    supplierContractsNew = em.merge(supplierContractsNew);
}

Result from topLink logging
UPDATE SupplierContracts SET LastChangeDate = ? WHERE (ContractID = ?)

How to delete all SupplierPriceLists items from SupplierContracts?
What is wrong to get delete query produced from
List<SupplierPriceLists> lSupplierPriceLists = new
ArrayList<SupplierPriceLists>();
supplierContractsNew.setSupplierPriceListsCollection(lSupplierPriceLists);

What i miss? Any subject on possible bug, anything in category "known
issues"?

Server: SunOne AS PE 9

Thanks in advance to all your attentions!