Hi,
I’m trying to use the taggable add-on in my Cuba project and I was trying to understand how it works with the aim to adapt to the requirements of the project.
I downloaded the example project from https://github.com/mariodavid/cuba-example-using-taggable.git and I don’t understand why the reference to the customer entity is saved in the attribute TAGGABLE instead of the attribute CUSTOMER_ID, created in the PersistentTagging class, like as follows:
package de.diedavids.cuba.ceut.entity;
import com.haulmont.cuba.core.entity.annotation.Extends;
import de.diedavids.cuba.taggable.entity.Tagging;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@Extends(Tagging.class)
@Entity(name = "ceut$PersistentTagging")
public class PersistentTagging extends Tagging {
private static final long serialVersionUID = 6795917365659671988L;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CUSTOMER_ID")
protected Customer customer;
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Customer getCustomer() {
return customer;
}
}
As you can see on the next screen capture of the query result for database records from TAGGING table:
Why customer property is defined in PersistentTagging class, which extends from Tagging class, if it doesn’t contains the reference to the customer entity?
I’ll appreciate your help to understand this key point.
Cheers
Xavier