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!