Problem with merging / persisitng objects with @Embeddable field

#1

Hi,

After migration to version 2.4.2_01, I have noticed a strange problem with persisting object with field that contains @Embeddable object. Please check attached exception.

Relation between entities looks like this:

@Entity
public class ProductKit extends BaseEntity implements Serializable, Convertable {
(...)
@ElementCollection(fetch = FetchType.EAGER)
List<ProductSet> productSets;
@Embeddable
public class ProductSet implements Serializable {
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
List<ProductDemand> productDemands;
@Entity
public class ProductDemand extends BaseEntity implements Serializable, Convertable {
@ManyToMany(targetEntity = ProductSet.class, mappedBy = "productDemands")
List<ProductSet> productSets;

 

#2

There were some changes (fixes) in merge in the last builds.

However, apparently the model in your post is invalid, since targetEntity should refer to an entity class rather than to an embeddable class.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Yes, you are right. Model is wrong. I realized that some time after the post. Sorry for false alarm and thanks for pointing error in my model.


Post Reply

To post a reply and/or subscribe to update notifications - please login