« Return to Thread: Static weaving issue? New object not persisted

Re: Static weaving issue? New object not persisted

by James Sutherland :: Rate this Message:

Reply to Author | View in Thread

Very odd.

When you don't use static weaving, are you using dynamic weaving or no weaving?
Do any errors occur during weaving or anywhere?

It may have something to do with change tracking, try setting "eclipselink.weaving.changetracking" to false to test if this is the case.

It may have something to do with the variable init, try moving this to the constructor to see if it changes things.


Jan Vissers wrote:
Sorry - hit sent far to early. Trying it again

Hi,

I've noticed (at least one) issue with static weaving, using
EclipseLinkM6. The issue is with a OneToMany mapping as stated here:

public class IndustrialFamily extends BaseEntity {
...
  @OneToMany(mappedBy = "industrialFamily", cascade = PERSIST)
  private List<DisplayedFamilyCharacteristic>
displayedFamilyCharacteristics = new
ArrayList<DisplayedFamilyCharacteristic>();
...

  public void addDisplayCharacteristic(DisplayedFamilyCharacteristic
displayCharacteristic) {
     displayCharacteristic.setIndustrialFamily(this);
     displayedFamilyCharacteristics.add(displayCharacteristic);
  }

The other end is mapped like:


public class DisplayedFamilyCharacteristic extends BaseEntity {
...
  @ManyToOne
  @JoinColumn(name = "family_id", referencedColumnName = "ID")
  private IndustrialFamily industrialFamily;



In our code we call this operation on the IndustrialFamily class:

  addDisplayCharacteristic(...);

With statically woven classes, no object is persisted. When we build our
app without static weaving, everything works beautifully.

Any ideas why this happening.
Thanks,
Jan.

 « Return to Thread: Static weaving issue? New object not persisted