soft delete is deleting relations [message #731366] |
Fri, 30 September 2011 18:28 |
Luiz E. Messages: 100 Registered: September 2010 |
Senior Member |
|
|
hi all
i have entities like this
@Entity
@Table(schema=Schemas.ECF)
@Index(name="id_impressora_fiscal", columnNames={"marca","modelo","numeroFabricacao"})
@Customizer(value=ImpressoraFiscalCustomizer.class)
public class ImpressoraFiscal implements Serializable{
private static final long serialVersionUID = 6246259319048104042L;
@OneToMany(cascade={CascadeType.PERSIST}, orphanRemoval=false)
@JoinTable(schema=Schemas.ECF)
private List<Aliquota> aliquotas = new ArrayList<Aliquota>();
and
@Entity
@Table(schema=Schemas.ECF)
public class Aliquota implements Serializable {
private static final long serialVersionUID = -1473589350884030504L;
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@Column(nullable=false)
private Double valor;
my 'ImpressoraFiscal' class is using soft delete, where i just set a boolean value to false, turning it to disabled.
but as you can see on sql logs, eclipselink is deleting all the data from the relational table
[EL Fine]: 2011-09-30 18:28:04.5--Connection(7033304)--Thread(Thread[main,6,main])--DELETE FROM ecf.IMPRESSORAFISCAL_ALIQUOTA WHERE (ImpressoraFiscal_ID = ?)
[EL Fine]: 2011-09-30 18:28:04.515--Connection(7033304)--Thread(Thread[main,6,main])-- bind => [1]
[EL Fine]: 2011-09-30 18:28:04.515--Connection(7033304)--Thread(Thread[main,6,main])--update ecf.ImpressoraFiscal set ativa = false where id = ?
[EL Fine]: 2011-09-30 18:28:04.515--Connection(7033304)--Thread(Thread[main,6,main])-- bind => [1]
what i am missing?
thanks a lot!
[Updated on: Fri, 30 September 2011 18:29] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03966 seconds