
com.blazebit.persistence.testsuite.entity.EmbeddableTestEntityEmbeddable Maven / Gradle / Ivy
The newest version!
package com.blazebit.persistence.testsuite.entity;
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.persistence.*;
@Embeddable
public class EmbeddableTestEntityEmbeddable implements Serializable {
private static final long serialVersionUID = 1L;
private EmbeddableTestEntity manyToOne;
private Set oneToMany = new HashSet(0);
private Map elementCollection = new HashMap(0);
private Map manyToMany = new HashMap(0);
private EmbeddableTestEntityNestedEmbeddable nestedEmbeddable = new EmbeddableTestEntityNestedEmbeddable();
@ManyToOne(fetch = FetchType.LAZY)
public EmbeddableTestEntity getManyToOne() {
return manyToOne;
}
public void setManyToOne(EmbeddableTestEntity manyToOne) {
this.manyToOne = manyToOne;
}
@OneToMany(mappedBy = "embeddable.manyToOne")
public Set getOneToMany() {
return oneToMany;
}
public void setOneToMany(Set oneToMany) {
this.oneToMany = oneToMany;
}
// Fixed size because mysql has size limitations
@ElementCollection
@MapKeyColumn(nullable = false, length = 20)
public Map getElementCollection() {
return elementCollection;
}
public void setElementCollection(Map elementCollection) {
this.elementCollection = elementCollection;
}
@ManyToMany
@MapKeyColumn(nullable = false, length = 20)
public Map getManyToMany() {
return manyToMany;
}
public void setManyToMany(Map manyToMany) {
this.manyToMany = manyToMany;
}
@Embedded
public EmbeddableTestEntityNestedEmbeddable getNestedEmbeddable() {
return nestedEmbeddable;
}
public void setNestedEmbeddable(EmbeddableTestEntityNestedEmbeddable nestedEmbeddable) {
this.nestedEmbeddable = nestedEmbeddable;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy