Java 执行计数语句时JPA和Hibernate库出现问题

Java 执行计数语句时JPA和Hibernate库出现问题,java,hibernate,jpa,Java,Hibernate,Jpa,在前一周左右的时间里,我一直在徒劳地努力工作 我可以执行简单的查询,例如按id查找实体,或获取实体集合等,但是,当我尝试执行更复杂的查询时,我似乎总是遇到错误。是否有人可以帮助调试此COUNT语句,该语句会产生以下错误堆栈跟踪: Caused by: org.hibernate.query.sqm.InterpretationException: Error interpreting query [SELECT COUNT(a.id) FROM AgreementEntity a]; this

在前一周左右的时间里,我一直在徒劳地努力工作

我可以执行简单的查询,例如按id查找实体,或获取实体集合等,但是,当我尝试执行更复杂的查询时,我似乎总是遇到错误。是否有人可以帮助调试此COUNT语句,该语句会产生以下错误堆栈跟踪:

Caused by: org.hibernate.query.sqm.InterpretationException: Error interpreting query [SELECT COUNT(a.id) FROM AgreementEntity a]; this may indicate a semantic (user query) problem or a bug in the parser
Caused by: java.lang.NullPointerException
以下是导致错误的代码:

    EntityManager em = getFirstEntityManager();
    Session session = em.unwrap(Session.class);
    // The following line of code causes an error
    session.createQuery("SELECT COUNT(a.id) FROM AgreementEntity a");
下面是整个
AgreementEntity
类:


package com.profectus.rdm.entities;

import java.sql.Timestamp;
import java.util.Collection;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "agreement", schema = "rdm_demovendorxa_prod", catalog = "")
public class AgreementEntity {
  private Long id;
  private Long version;
  private String agreementType;
  private Boolean autoextend;
  private Boolean isAutoextendAgreement;
  private Long parentAgreementId;
  private String comments;
  private Timestamp creationDate;
  private String datasource;
  private String description;
  private Timestamp endDate;
  private String fEmail;
  private String fName;
  private String fPhone;
  private Boolean journal;
  private Boolean pdfemail;
  private String sEmail;
  private String sName;
  private String sPhone;
  private Timestamp startDate;
  private String status;
  private String terms;
  private String termsAmendments;
  private Boolean vendorClaims;
  private String notifyEmail;
  private Timestamp ceaseDate;
  private String sTitle;
  private String sMobile;
  private String sFax;
  private String fTitle;
  private String fMobile;
  private String fFax;
  private String ceaseReason;
  private Boolean isCeasedAlerted;
  private Integer isExpiringAlerted;
  private Timestamp contractEndDate;
  private String contractReference;
  private String confidenceLevel;
  private String collectionMethod;
  private Boolean autoextended;
  private String arNumber;
  private String journalPostingCompanyCode;
  private Long marketingEventId;
  private UsersEntity usersByLeadBuyerId;
  private UsersEntity usersByBuyerId;
  private RetailerVendorEntity retailerVendorByRetailerVendorId;
  private RetailerVendorEntity retailerVendorByDistributorRetailerVendorId;
  private UsersEntity usersByUserId;
  private CountryEntity countryByCountryId;
  private CountryEntity countryByCountryId_0;
  private Collection<AgreementAttachmentEntity> agreementAttachmentsById;
  private Collection<AgreementCommentEntity> agreementCommentsById;
  private Collection<AgreementCopyEntity> agreementCopiesById;
  private Collection<AgreementCopyEntity> agreementCopiesById_0;
  //  private Collection<AgreementDistributorRetailerVendorEntity> agreementDistributorRetailerVendorsById;
//  private Collection<AgreementDistributorVendorGroupEntity> agreementDistributorVendorGroupsById;
  private Collection<AgreementHistoryEntity> agreementHistoriesById;
  private Collection<AgreementImportEntity> agreementImportsById;
  private Collection<AgreementNoteEntity> agreementNotesById;
  private Collection<AttachmentEntity> attachmentsById;
  private Collection<RuleEntity> rulesById;
  private Collection<TierReportResultEntity> tierReportResultsById;

  @Id
  @Column(name = "id", nullable = false)
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  @Basic
  @Column(name = "version", nullable = true)
  public Long getVersion() {
    return version;
  }

  public void setVersion(Long version) {
    this.version = version;
  }

  @Basic
  @Column(name = "agreement_type", nullable = true, length = 255)
  public String getAgreementType() {
    return agreementType;
  }

  public void setAgreementType(String agreementType) {
    this.agreementType = agreementType;
  }

  @Basic
  @Column(name = "autoextend", nullable = false)
  public Boolean getAutoextend() {
    return autoextend;
  }

  public void setAutoextend(Boolean autoextend) {
    this.autoextend = autoextend;
  }

  @Basic
  @Column(name = "is_autoextend_agreement", nullable = true)
  public Boolean getAutoextendAgreement() {
    return isAutoextendAgreement;
  }

  public void setAutoextendAgreement(Boolean autoextendAgreement) {
    isAutoextendAgreement = autoextendAgreement;
  }

  @Basic
  @Column(name = "parent_agreement_id", nullable = true)
  public Long getParentAgreementId() {
    return parentAgreementId;
  }

  public void setParentAgreementId(Long parentAgreementId) {
    this.parentAgreementId = parentAgreementId;
  }

  @Basic
  @Column(name = "comments", nullable = true, length = -1)
  public String getComments() {
    return comments;
  }

  public void setComments(String comments) {
    this.comments = comments;
  }

  @Basic
  @Column(name = "creation_date", nullable = false)
  public Timestamp getCreationDate() {
    return creationDate;
  }

  public void setCreationDate(Timestamp creationDate) {
    this.creationDate = creationDate;
  }

  @Basic
  @Column(name = "datasource", nullable = false, length = 255)
  public String getDatasource() {
    return datasource;
  }

  public void setDatasource(String datasource) {
    this.datasource = datasource;
  }

  @Basic
  @Column(name = "description", nullable = true, length = 255)
  public String getDescription() {
    return description;
  }

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

  @Basic
  @Column(name = "end_date", nullable = true)
  public Timestamp getEndDate() {
    return endDate;
  }

  public void setEndDate(Timestamp endDate) {
    this.endDate = endDate;
  }

  @Basic
  @Column(name = "fEmail", nullable = true, length = 255)
  public String getfEmail() {
    return fEmail;
  }

  public void setfEmail(String fEmail) {
    this.fEmail = fEmail;
  }

  @Basic
  @Column(name = "fName", nullable = true, length = 255)
  public String getfName() {
    return fName;
  }

  public void setfName(String fName) {
    this.fName = fName;
  }

  @Basic
  @Column(name = "fPhone", nullable = true, length = 255)
  public String getfPhone() {
    return fPhone;
  }

  public void setfPhone(String fPhone) {
    this.fPhone = fPhone;
  }

  @Basic
  @Column(name = "journal", nullable = false)
  public Boolean getJournal() {
    return journal;
  }

  public void setJournal(Boolean journal) {
    this.journal = journal;
  }

  @Basic
  @Column(name = "pdfemail", nullable = false)
  public Boolean getPdfemail() {
    return pdfemail;
  }

  public void setPdfemail(Boolean pdfemail) {
    this.pdfemail = pdfemail;
  }

  @Basic
  @Column(name = "sEmail", nullable = true, length = 255)
  public String getsEmail() {
    return sEmail;
  }

  public void setsEmail(String sEmail) {
    this.sEmail = sEmail;
  }

  @Basic
  @Column(name = "sName", nullable = true, length = 255)
  public String getsName() {
    return sName;
  }

  public void setsName(String sName) {
    this.sName = sName;
  }

  @Basic
  @Column(name = "sPhone", nullable = true, length = 255)
  public String getsPhone() {
    return sPhone;
  }

  public void setsPhone(String sPhone) {
    this.sPhone = sPhone;
  }

  @Basic
  @Column(name = "start_date", nullable = true)
  public Timestamp getStartDate() {
    return startDate;
  }

  public void setStartDate(Timestamp startDate) {
    this.startDate = startDate;
  }

  @Basic
  @Column(name = "status", nullable = false, length = 255)
  public String getStatus() {
    return status;
  }

  public void setStatus(String status) {
    this.status = status;
  }

  @Basic
  @Column(name = "terms", nullable = true, length = -1)
  public String getTerms() {
    return terms;
  }

  public void setTerms(String terms) {
    this.terms = terms;
  }

  @Basic
  @Column(name = "terms_amendments", nullable = true, length = -1)
  public String getTermsAmendments() {
    return termsAmendments;
  }

  public void setTermsAmendments(String termsAmendments) {
    this.termsAmendments = termsAmendments;
  }

  @Basic
  @Column(name = "vendorClaims", nullable = false)
  public Boolean getVendorClaims() {
    return vendorClaims;
  }

  public void setVendorClaims(Boolean vendorClaims) {
    this.vendorClaims = vendorClaims;
  }

  @Basic
  @Column(name = "notify_email", nullable = true, length = 512)
  public String getNotifyEmail() {
    return notifyEmail;
  }

  public void setNotifyEmail(String notifyEmail) {
    this.notifyEmail = notifyEmail;
  }

  @Basic
  @Column(name = "cease_date", nullable = true)
  public Timestamp getCeaseDate() {
    return ceaseDate;
  }

  public void setCeaseDate(Timestamp ceaseDate) {
    this.ceaseDate = ceaseDate;
  }

  @Basic
  @Column(name = "sTitle", nullable = true, length = 255)
  public String getsTitle() {
    return sTitle;
  }

  public void setsTitle(String sTitle) {
    this.sTitle = sTitle;
  }

  @Basic
  @Column(name = "sMobile", nullable = true, length = 255)
  public String getsMobile() {
    return sMobile;
  }

  public void setsMobile(String sMobile) {
    this.sMobile = sMobile;
  }

  @Basic
  @Column(name = "sFax", nullable = true, length = 255)
  public String getsFax() {
    return sFax;
  }

  public void setsFax(String sFax) {
    this.sFax = sFax;
  }

  @Basic
  @Column(name = "fTitle", nullable = true, length = 255)
  public String getfTitle() {
    return fTitle;
  }

  public void setfTitle(String fTitle) {
    this.fTitle = fTitle;
  }

  @Basic
  @Column(name = "fMobile", nullable = true, length = 255)
  public String getfMobile() {
    return fMobile;
  }

  public void setfMobile(String fMobile) {
    this.fMobile = fMobile;
  }

  @Basic
  @Column(name = "fFax", nullable = true, length = 255)
  public String getfFax() {
    return fFax;
  }

  public void setfFax(String fFax) {
    this.fFax = fFax;
  }

  @Basic
  @Column(name = "cease_reason", nullable = true, length = 255)
  public String getCeaseReason() {
    return ceaseReason;
  }

  public void setCeaseReason(String ceaseReason) {
    this.ceaseReason = ceaseReason;
  }

  @Basic
  @Column(name = "is_ceased_alerted", nullable = true)
  public Boolean getCeasedAlerted() {
    return isCeasedAlerted;
  }

  public void setCeasedAlerted(Boolean ceasedAlerted) {
    isCeasedAlerted = ceasedAlerted;
  }

  @Basic
  @Column(name = "is_expiring_alerted", nullable = true)
  public Integer getIsExpiringAlerted() {
    return isExpiringAlerted;
  }

  public void setIsExpiringAlerted(Integer isExpiringAlerted) {
    this.isExpiringAlerted = isExpiringAlerted;
  }

  @Basic
  @Column(name = "contract_end_date", nullable = true)
  public Timestamp getContractEndDate() {
    return contractEndDate;
  }

  public void setContractEndDate(Timestamp contractEndDate) {
    this.contractEndDate = contractEndDate;
  }

  @Basic
  @Column(name = "contract_reference", nullable = true, length = 50)
  public String getContractReference() {
    return contractReference;
  }

  public void setContractReference(String contractReference) {
    this.contractReference = contractReference;
  }

  @Basic
  @Column(name = "confidence_level", nullable = true, length = 50)
  public String getConfidenceLevel() {
    return confidenceLevel;
  }

  public void setConfidenceLevel(String confidenceLevel) {
    this.confidenceLevel = confidenceLevel;
  }

  @Basic
  @Column(name = "collection_method", nullable = true, length = 2)
  public String getCollectionMethod() {
    return collectionMethod;
  }

  public void setCollectionMethod(String collectionMethod) {
    this.collectionMethod = collectionMethod;
  }

  @Basic
  @Column(name = "autoextended", nullable = true)
  public Boolean getAutoextended() {
    return autoextended;
  }

  public void setAutoextended(Boolean autoextended) {
    this.autoextended = autoextended;
  }

  @Basic
  @Column(name = "ar_number", nullable = true, length = 50)
  public String getArNumber() {
    return arNumber;
  }

  public void setArNumber(String arNumber) {
    this.arNumber = arNumber;
  }

  @Basic
  @Column(name = "journal_posting_company_code", nullable = true, length = 50)
  public String getJournalPostingCompanyCode() {
    return journalPostingCompanyCode;
  }

  public void setJournalPostingCompanyCode(String journalPostingCompanyCode) {
    this.journalPostingCompanyCode = journalPostingCompanyCode;
  }

  @Basic
  @Column(name = "marketing_event_id", nullable = true)
  public Long getMarketingEventId() {
    return marketingEventId;
  }

  public void setMarketingEventId(Long marketingEventId) {
    this.marketingEventId = marketingEventId;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    AgreementEntity that = (AgreementEntity) o;
    return Objects.equals(id, that.id) &&
        Objects.equals(version, that.version) &&
        Objects.equals(agreementType, that.agreementType) &&
        Objects.equals(autoextend, that.autoextend) &&
        Objects.equals(isAutoextendAgreement, that.isAutoextendAgreement) &&
        Objects.equals(parentAgreementId, that.parentAgreementId) &&
        Objects.equals(comments, that.comments) &&
        Objects.equals(creationDate, that.creationDate) &&
        Objects.equals(datasource, that.datasource) &&
        Objects.equals(description, that.description) &&
        Objects.equals(endDate, that.endDate) &&
        Objects.equals(fEmail, that.fEmail) &&
        Objects.equals(fName, that.fName) &&
        Objects.equals(fPhone, that.fPhone) &&
        Objects.equals(journal, that.journal) &&
        Objects.equals(pdfemail, that.pdfemail) &&
        Objects.equals(sEmail, that.sEmail) &&
        Objects.equals(sName, that.sName) &&
        Objects.equals(sPhone, that.sPhone) &&
        Objects.equals(startDate, that.startDate) &&
        Objects.equals(status, that.status) &&
        Objects.equals(terms, that.terms) &&
        Objects.equals(termsAmendments, that.termsAmendments) &&
        Objects.equals(vendorClaims, that.vendorClaims) &&
        Objects.equals(notifyEmail, that.notifyEmail) &&
        Objects.equals(ceaseDate, that.ceaseDate) &&
        Objects.equals(sTitle, that.sTitle) &&
        Objects.equals(sMobile, that.sMobile) &&
        Objects.equals(sFax, that.sFax) &&
        Objects.equals(fTitle, that.fTitle) &&
        Objects.equals(fMobile, that.fMobile) &&
        Objects.equals(fFax, that.fFax) &&
        Objects.equals(ceaseReason, that.ceaseReason) &&
        Objects.equals(isCeasedAlerted, that.isCeasedAlerted) &&
        Objects.equals(isExpiringAlerted, that.isExpiringAlerted) &&
        Objects.equals(contractEndDate, that.contractEndDate) &&
        Objects.equals(contractReference, that.contractReference) &&
        Objects.equals(confidenceLevel, that.confidenceLevel) &&
        Objects.equals(collectionMethod, that.collectionMethod) &&
        Objects.equals(autoextended, that.autoextended) &&
        Objects.equals(arNumber, that.arNumber) &&
        Objects.equals(journalPostingCompanyCode, that.journalPostingCompanyCode) &&
        Objects.equals(marketingEventId, that.marketingEventId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, version, agreementType, autoextend, isAutoextendAgreement, parentAgreementId, comments, creationDate, datasource, description, endDate, fEmail, fName, fPhone, journal, pdfemail, sEmail, sName, sPhone, startDate, status, terms, termsAmendments, vendorClaims, notifyEmail, ceaseDate, sTitle, sMobile, sFax, fTitle, fMobile, fFax, ceaseReason, isCeasedAlerted, isExpiringAlerted, contractEndDate, contractReference, confidenceLevel, collectionMethod, autoextended, arNumber, journalPostingCompanyCode, marketingEventId);
  }

  @ManyToOne
  @JoinColumn(name = "lead_buyer_id", referencedColumnName = "id")
  public UsersEntity getUsersByLeadBuyerId() {
    return usersByLeadBuyerId;
  }

  public void setUsersByLeadBuyerId(UsersEntity usersByLeadBuyerId) {
    this.usersByLeadBuyerId = usersByLeadBuyerId;
  }

  @ManyToOne
  @JoinColumn(name = "buyer_id", referencedColumnName = "id")
  public UsersEntity getUsersByBuyerId() {
    return usersByBuyerId;
  }

  public void setUsersByBuyerId(UsersEntity usersByBuyerId) {
    this.usersByBuyerId = usersByBuyerId;
  }

  @ManyToOne
  @JoinColumn(name = "retailer_vendor_id", referencedColumnName = "id")
  public RetailerVendorEntity getRetailerVendorByRetailerVendorId() {
    return retailerVendorByRetailerVendorId;
  }

  public void setRetailerVendorByRetailerVendorId(RetailerVendorEntity retailerVendorByRetailerVendorId) {
    this.retailerVendorByRetailerVendorId = retailerVendorByRetailerVendorId;
  }

  @ManyToOne
  @JoinColumn(name = "distributor_retailer_vendor_id", referencedColumnName = "id")
  public RetailerVendorEntity getRetailerVendorByDistributorRetailerVendorId() {
    return retailerVendorByDistributorRetailerVendorId;
  }

  public void setRetailerVendorByDistributorRetailerVendorId(RetailerVendorEntity retailerVendorByDistributorRetailerVendorId) {
    this.retailerVendorByDistributorRetailerVendorId = retailerVendorByDistributorRetailerVendorId;
  }

  @ManyToOne
  @JoinColumn(name = "user_id", referencedColumnName = "id")
  public UsersEntity getUsersByUserId() {
    return usersByUserId;
  }

  public void setUsersByUserId(UsersEntity usersByUserId) {
    this.usersByUserId = usersByUserId;
  }

  @ManyToOne
  @JoinColumn(name = "country_id", referencedColumnName = "id")
  public CountryEntity getCountryByCountryId() {
    return countryByCountryId;
  }

  public void setCountryByCountryId(CountryEntity countryByCountryId) {
    this.countryByCountryId = countryByCountryId;
  }

  @ManyToOne
  @JoinColumn(name = "country_id", referencedColumnName = "id", insertable = false, updatable = false)
  public CountryEntity getCountryByCountryId_0() {
    return countryByCountryId_0;
  }

  public void setCountryByCountryId_0(CountryEntity countryByCountryId_0) {
    this.countryByCountryId_0 = countryByCountryId_0;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<AgreementAttachmentEntity> getAgreementAttachmentsById() {
    return agreementAttachmentsById;
  }

  public void setAgreementAttachmentsById(Collection<AgreementAttachmentEntity> agreementAttachmentsById) {
    this.agreementAttachmentsById = agreementAttachmentsById;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<AgreementCommentEntity> getAgreementCommentsById() {
    return agreementCommentsById;
  }

  public void setAgreementCommentsById(Collection<AgreementCommentEntity> agreementCommentsById) {
    this.agreementCommentsById = agreementCommentsById;
  }

  @OneToMany(mappedBy = "agreementByParentAgreementId")
  public Collection<AgreementCopyEntity> getAgreementCopiesById() {
    return agreementCopiesById;
  }

  public void setAgreementCopiesById(Collection<AgreementCopyEntity> agreementCopiesById) {
    this.agreementCopiesById = agreementCopiesById;
  }

  @OneToMany(mappedBy = "agreementByChildAgreementId")
  public Collection<AgreementCopyEntity> getAgreementCopiesById_0() {
    return agreementCopiesById_0;
  }

  public void setAgreementCopiesById_0(Collection<AgreementCopyEntity> agreementCopiesById_0) {
    this.agreementCopiesById_0 = agreementCopiesById_0;
  }

//  @OneToMany(mappedBy = "agreementByAgreementId")
//  public Collection<AgreementDistributorRetailerVendorEntity> getAgreementDistributorRetailerVendorsById() {
//    return agreementDistributorRetailerVendorsById;
//  }
//
//  public void setAgreementDistributorRetailerVendorsById(Collection<AgreementDistributorRetailerVendorEntity> agreementDistributorRetailerVendorsById) {
//    this.agreementDistributorRetailerVendorsById = agreementDistributorRetailerVendorsById;
//  }
//
//  @OneToMany(mappedBy = "agreementByAgreementId")
//  public Collection<AgreementDistributorVendorGroupEntity> getAgreementDistributorVendorGroupsById() {
//    return agreementDistributorVendorGroupsById;
//  }
//
//  public void setAgreementDistributorVendorGroupsById(Collection<AgreementDistributorVendorGroupEntity> agreementDistributorVendorGroupsById) {
//    this.agreementDistributorVendorGroupsById = agreementDistributorVendorGroupsById;
//  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<AgreementHistoryEntity> getAgreementHistoriesById() {
    return agreementHistoriesById;
  }

  public void setAgreementHistoriesById(Collection<AgreementHistoryEntity> agreementHistoriesById) {
    this.agreementHistoriesById = agreementHistoriesById;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<AgreementImportEntity> getAgreementImportsById() {
    return agreementImportsById;
  }

  public void setAgreementImportsById(Collection<AgreementImportEntity> agreementImportsById) {
    this.agreementImportsById = agreementImportsById;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<AgreementNoteEntity> getAgreementNotesById() {
    return agreementNotesById;
  }

  public void setAgreementNotesById(Collection<AgreementNoteEntity> agreementNotesById) {
    this.agreementNotesById = agreementNotesById;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<AttachmentEntity> getAttachmentsById() {
    return attachmentsById;
  }

  public void setAttachmentsById(Collection<AttachmentEntity> attachmentsById) {
    this.attachmentsById = attachmentsById;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<RuleEntity> getRulesById() {
    return rulesById;
  }

  public void setRulesById(Collection<RuleEntity> rulesById) {
    this.rulesById = rulesById;
  }

  @OneToMany(mappedBy = "agreementByAgreementId")
  public Collection<TierReportResultEntity> getTierReportResultsById() {
    return tierReportResultsById;
  }

  public void setTierReportResultsById(Collection<TierReportResultEntity> tierReportResultsById) {
    this.tierReportResultsById = tierReportResultsById;
  }
}



包com.profectus.rdm.entities;
导入java.sql.Timestamp;
导入java.util.Collection;
导入java.util.Objects;
导入javax.persistence.Basic;
导入javax.persistence.Column;
导入javax.persistence.Entity;
导入javax.persistence.Id;
导入javax.persistence.JoinColumn;
导入javax.persistence.manytone;
导入javax.persistence.OneToMany;
导入javax.persistence.Table;
@实体
@表(name=“agreement”,schema=“rdm\u demovendorxa\u prod”,catalog=”“)
公共类协议实体{
私人长id;
私人长版;
私有字符串agreementType;
私有布尔自动扩展;
私有布尔是自动扩展的;
私人长期父母协议ID;
私有字符串注释;
私有时间戳creationDate;
私有字符串数据源;
私有字符串描述;
私有时间戳结束日期;
私人字符串fEmail;
私有字符串fName;
专用串电话;
私家期刊;
私有布尔pdfemail;
私有字符串语义;
私有字符串sName;
私人电话;
私有时间戳起始日期;
私有字符串状态;
私有字符串术语;
私有字符串项;
私人布尔卖方;
私人电子邮件;
私有时间戳终止;
私人线缝;
私家车;
私有字符串sFax;
私有字符串;
私有字符串移动;
私有字符串fFax;
私有字符串停止原因;
私有布尔值被忽略;
私有整数已导出;
私有时间戳contractEndDate;
私有字符串引用;
私有字符串信任级别;
私有字符串收集方法;
私有布尔自扩展;
私有字符串arNumber;
私有字符串journalPostingCompanyCode;
私人长期市场化;
私有UsersEntity usersByLeadBuyerId;
私有UsersEntity usersByBuyerId;
私人RetailerVendorEntity retailerVendorByRetailerVendorId;
私人零售商实体零售商零售商零售商零售商零售商;
私有UsersEntity usersByUserId;
私人CountryEntity countryByCountryId;
私有CountryEntity countryByCountryId_0;
私人收款协议附件BYID;
私人收款协议注释b;
私人收款协议副本BYID;
私人收款协议副本BYID_0;
//私人收款协议经销商RetailervendorsById;
//私人收款协议DistributorVendorGroupsById;
私人收藏协议历史记录ById;
私人收款协议importsbyid;
私人收款协议notesbyd;
私人收藏附件b;
私人收藏规则b;
私有集合tierReportResultsById;
@身份证
@列(name=“id”,nullable=false)
公共长getId(){
返回id;
}
公共无效集合id(长id){
this.id=id;
}
@基本的
@列(name=“version”,nullable=true)
公共长getVersion(){
返回版本;
}
公共版本(长版本){
this.version=版本;
}
@基本的
@列(name=“agreement\u type”,null=true,长度=255)
公共字符串getAgreementType(){
返回协议类型;
}
公共void setAgreementType(字符串agreementType){
this.agreementType=agreementType;
}
@基本的
@列(name=“autoextend”,nullable=false)
公共布尔getAutoextend(){
返回自动扩展;
}
公共void setAutoextend(布尔值自动扩展){
this.autoextend=autoextend;
}
@基本的
@列(name=“is\u autoextend\u agreement”,nullable=true)
公共布尔getAutoextendAgreement(){
返回为自动扩展协议;
}
public void setAutoextendAgreement(布尔值autoextendAgreement){
isAutoextendAgreement=自动ExtendAgreement;
}
@基本的
@列(name=“parent\u agreement\u id”,null=true)
公共长getParentAgreementId(){
返回parentAgreementId;
}
public void setParentAgreementId(长parentAgreementId){
this.parentAgreementId=parentAgreementId;
}
@基本的
@列(name=“comments”,nullable=true,length=-1)
公共字符串getComments(){
返回评论;
}
公共void setComments(字符串注释){
this.comments=注释;
}
@基本的
@列(name=“创建日期”,null=false)
公共时间戳getCreationDate(){
还肌酐;
}
public void setCreationDate(时间戳creationDate){
this.creationDate=creationDate;
}
@基本的
@列(name=“datasource”,nullable=false,length=255)
公共字符串getDatasource(){
返回数据源;
}
公共void setDatasource(字符串数据源){
this.datasource=数据源;
}
@基本的
@列(name=“description”,nullable=true,length=255)
公共字符串getDescription(){
返回说明;
}
公共void集合描述(字符串描述){
this.description=描述;
}
@基本的
@列(name=“end\u date”,null=true)
公共时间戳getEndDate(){
返回结束日期;
}
公共无效setEndDate(时间戳endDate){
this.endDate=endDate;
}
@基本的
@列(name=“fEmail”,nullable=true,长度=255)
公共字符串getfEmail(){
返回女性邮件;
}
公共void setfEmail(字符串fEmail){
this.fEmail=fEmail;
}
@基本的
@列(name=“fName”,null=true,长度=255)
公共字符串getfName(){
返回fName;
}
公共void setfName(字符串fName){
this.fName=fName;
}
@基本的
@专栏(nam)
EntityManager em = getFirstEntityManager();
        Session session = em.unwrap(Session.class);
        // The following line of code causes an error
        session.createQuery("select count(a) from AgreementEntity a ");