Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mongodb QueryDSL不';t为特定实体生成QType_Mongodb_Jpa_Spring Data_Querydsl - Fatal编程技术网

Mongodb QueryDSL不';t为特定实体生成QType

Mongodb QueryDSL不';t为特定实体生成QType,mongodb,jpa,spring-data,querydsl,Mongodb,Jpa,Spring Data,Querydsl,真的很困惑。我正在使用Spring-Data-MongoAnnotationProcessor为我的域模型生成QTypes。那些mongo模型碰巧使用了依赖项中的一些其他模型,这些依赖项是jpa模型。即使我使用的是mongo处理器,QueryDSL最终还是会为这些jpa注释的@实体生成QTypes,除了一个特定的实体。我尝试将它与其他生成的实体进行比较,但没有发现任何巨大的差异 以下是实体: import com.fasterxml.jackson.annotation.JsonIgnore;

真的很困惑。我正在使用
Spring-Data-MongoAnnotationProcessor
为我的域模型生成
QTypes
。那些
mongo
模型碰巧使用了依赖项中的一些其他模型,这些依赖项是
jpa模型
。即使我使用的是mongo处理器,QueryDSL最终还是会为这些jpa注释的
@实体生成
QTypes
,除了一个特定的实体。我尝试将它与其他生成的实体进行比较,但没有发现任何巨大的差异

以下是实体:

import com.fasterxml.jackson.annotation.JsonIgnore;
import base.lexicon.model.Literal;
import base.lexicon.model.Sport;
import base.lexicon.model.Tournament;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@Entity
@Cache(
    usage = CacheConcurrencyStrategy.READ_WRITE,
    region = "base.lexicon.model.Category"
)
@SequenceGenerator(
    name = "CATEGORY_SEQ",
    sequenceName = "CATEGORY_SEQ",
    allocationSize = 1
)
public class Category implements Serializable {
    private static final long serialVersionUID = 6989006403439170511L;
    @Id
    @GeneratedValue(
        strategy = GenerationType.SEQUENCE,
        generator = "CATEGORY_SEQ"
    )
    @Column(
        name = "CATEGORY_ID"
    )
    private int id;
    private String description;
    @OneToMany(
        mappedBy = "category"
    )
    @Cascade({CascadeType.ALL})
    @Cache(
        usage = CacheConcurrencyStrategy.READ_WRITE,
        region = "base.lexicon.model.Category.tournaments"
    )
    @XmlTransient
    private List<Tournament> tournaments;
    @ManyToOne
    @ForeignKey(
        name = "FK_SPORT_CATEGORY"
    )
    @JoinColumn(
        name = "SPORT_ID",
        nullable = false
    )
    @XmlTransient
    private Sport sport;
    @LazyCollection(LazyCollectionOption.FALSE)
    @OneToMany
    @Cascade({CascadeType.ALL})
    @Cache(
        usage = CacheConcurrencyStrategy.READ_WRITE,
        region = "base.lexicon.model.Category.literals"
    )
    @JoinTable(
        name = "CATEGORY_LITERAL",
        joinColumns = {            @JoinColumn(
                name = "CATEGORY_ID",
                referencedColumnName = "CATEGORY_ID"
            )},
        inverseJoinColumns = {            @JoinColumn(
                name = "LITERAL_ID",
                referencedColumnName = "LITERAL_ID"
            )}
    )
    private Set<Literal> literals;

    public Category() {
    }

    public int getCategoryId() {
        return this.id;
    }

    public void setCategoryId(int id) {
        this.id = id;
    }

    @JsonIgnore
    public List<Tournament> getTournaments() {
        if(this.tournaments == null) {
            this.tournaments = new ArrayList();
        }

        return this.tournaments;
    }

    public void setTournaments(List<Tournament> tournaments) {
        if(tournaments != null) {
            Iterator var2 = tournaments.iterator();

            while(var2.hasNext()) {
                Tournament tournament = (Tournament)var2.next();
                if(tournament.getCategory() == null) {
                    tournament.setCategory(this);
                }
            }

            this.tournaments = tournaments;
        }

    }

    public Set<Literal> getLiterals() {
        if(this.literals == null) {
            this.literals = new HashSet();
        }

        return this.literals;
    }

    public void setLiterals(Set<Literal> literals) {
        this.literals = literals;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @XmlTransient
    public Sport getSport() {
        return this.sport;
    }

    public void setSport(Sport sport) {
        this.sport = sport;
    }

    public boolean equals(Object o) {
        if(this == o) {
            return true;
        } else if(!(o instanceof Category)) {
            return false;
        } else {
            Category category = (Category)o;
            if(this.id != category.id) {
                return false;
            } else {
                if(this.description != null) {
                    if(this.description.equalsIgnoreCase(category.description)) {
                        return this.sport != null?this.sport.equals(category.sport):category.sport == null;
                    }
                } else if(category.description == null) {
                    return this.sport != null?this.sport.equals(category.sport):category.sport == null;
                }

                return false;
            }
        }
    }

    public int hashCode() {
        int result = this.id;
        result = 31 * result + (this.description != null?this.description.toLowerCase().hashCode():0);
        result = 31 * result + (this.sport != null?this.sport.hashCode():0);
        return result;
    }
}
import com.fasterxml.jackson.annotation.JsonIgnore;
导入base.lexicon.model.Literal;
导入base.lexicon.model.Sport;
导入base.lexicon.model.Tournament;
导入java.io.Serializable;
导入java.util.ArrayList;
导入java.util.HashSet;
导入java.util.Iterator;
导入java.util.List;
导入java.util.Set;
导入javax.persistence.Column;
导入javax.persistence.Entity;
导入javax.persistence.GeneratedValue;
导入javax.persistence.GenerationType;
导入javax.persistence.Id;
导入javax.persistence.JoinColumn;
导入javax.persistence.JoinTable;
导入javax.persistence.manytone;
导入javax.persistence.OneToMany;
导入javax.persistence.SequenceGenerator;
导入javax.xml.bind.annotation.XmlAccessType;
导入javax.xml.bind.annotation.XmlAccessorType;
导入javax.xml.bind.annotation.XmlRootElement;
导入javax.xml.bind.annotation.XmlTransient;
导入org.hibernate.annotations.Cache;
导入org.hibernate.annotations.cacheconcurrency策略;
导入org.hibernate.annotations.Cascade;
导入org.hibernate.annotations.CascadeType;
导入org.hibernate.annotations.ForeignKey;
导入org.hibernate.annotations.LazyCollection;
导入org.hibernate.annotations.LazyCollectionOption;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@实体
@缓存(
用法=cacheconcurrentystrategy.READ\u WRITE,
region=“base.lexicon.model.Category”
)
@序列发生器(
name=“CATEGORY_SEQ”,
sequenceName=“分类顺序”,
allocationSize=1
)
公共类类别实现可序列化{
私有静态最终长serialVersionUID=6989006403439170511L;
@身份证
@生成值(
策略=GenerationType.SEQUENCE,
generator=“类别”
)
@纵队(
name=“分类号”
)
私有int-id;
私有字符串描述;
@独身癖(
mappedBy=“类别”
)
@级联({CascadeType.ALL})
@缓存(
用法=cacheconcurrentystrategy.READ\u WRITE,
region=“base.lexicon.model.Category.tournames”
)
@XmlTransient
私人名单比赛;
@许多酮
@外侨(
name=“FK\U运动\U类别”
)
@连接柱(
name=“SPORT\u ID”,
nullable=false
)
@XmlTransient
私人体育;
@LazyCollection(LazyCollectionOption.FALSE)
@独身癖
@级联({CascadeType.ALL})
@缓存(
用法=cacheconcurrentystrategy.READ\u WRITE,
region=“base.lexicon.model.Category.literals”
)
@可接合(
name=“CATEGORY\u LITERAL”,
joinColumns={@JoinColumn(
name=“CATEGORY\u ID”,
referencedColumnName=“类别\u ID”
)},
inverseJoinColumns={@JoinColumn(
name=“LITERAL\u ID”,
referencedColumnName=“LITERAL\u ID”
)}
)
私有集合文本;
公共类别(){
}
public int getCategoryId(){
返回此.id;
}
public void setCategoryId(内部id){
this.id=id;
}
@杰索尼奥雷
公共列表getTournaments(){
if(this.tournaments==null){
this.tournaments=新的ArrayList();
}
返回这个。比赛;
}
公开赛(列表赛){
如果(锦标赛!=null){
迭代器var2=tournaments.Iterator();
while(var2.hasNext()){
锦标赛=(锦标赛)var2.next();
if(tournament.getCategory()==null){
锦标赛。设置类别(本);
}
}
这个。tournaments=tournaments;
}
}
公共集合getLiterals(){
if(this.literals==null){
this.literals=new HashSet();
}
返回这个.literals;
}
公共void setLiterals(Set literals){
this.literals=文本;
}
公共字符串getDescription(){
返回此.description;
}
公共void集合描述(字符串描述){
this.description=描述;
}
@XmlTransient
公共体育{
还这个。运动;
}
公共体育(体育){
这个运动=运动;
}
公共布尔等于(对象o){
if(this==o){
返回true;
}如果(!(类别实例)){
返回false;
}否则{
类别=(类别)o;
if(this.id!=category.id){
返回false;
}否则{
if(this.description!=null){
if(本说明.等效信号案例(类别说明)){
返回this.sport!=null?this.sport.equals(category.sport):category.sport==null;
}
}else if(category.description==null){
返回this.sport!=null?this.sport.equals(category.sport):category.sport==null;
}
返回false;
}
}
}
公共int hashCode(){
int result=this.id;
result=31*result+(this.description!=null?this.description.toLowerCase().hashCode():0);
result=31*result+(this.sport!=null?this.sport.hashCode():0);
返回结果;
}
}
它是否包含任何注释或其他阻塞的内容