MVN中的链下拉抛出错误找不到符号

时间:2019-07-02 13:16:25

标签: java maven jhipster

我尝试为村庄创建一个链下拉列表,目前成功地创建了从省到街道的

所以我创建了一个Village.java文件进行过滤:

打包com.sun.pro.aub.domain;

import java.util.Objects;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringExclude;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * Village 4th level.
 * Sub District
 * 
 * @author dev on  1:53:29 PM
 * @since 1.0.0
 * @version 1.0.0
 *
 */
@Entity
@Table(name = "villa")
public class Village {

  @ToStringExclude
  @Id
  private Long id;

  String name;

  @ToStringExclude
  @JsonIgnore
  @ManyToOne
  Village village;

  /**
   * Default ctr
   */
  public Village() {

  }

  /**
   * @param id the id
   */
  public Village(Long id) {
    super();
    this.id = id;
  }

  /**
   * @return the subDistrict
   */
  public SubDistrict getSubDistrict() {
    return subDistrict;
  }

  /**
   * @param id
   *        village id
   * @param subDistrictCity
   *        village subDistrict subDistrict
   * @param name
   *        village name
   */
  public Village(Long id, SubDistrict subDistrict, String name) {
    this(id, name);
    this.subDistrict = subDistrict;
  }

  public Village(Long id, String name) {
    this.id = id;
    this.name = name;
  }

  /**
   * @return the id
   */
  public Long getId() {
    return id;
  }

  /**
   * @return the name
   */
  public String getName() {
    return name;
  }

  /**
   * @param districtCity the districtCity to set
   * @return SubDistrict for convenience chaining
   */
  public Village setSubDistrict(SubDistrict subDistrict) {
    this.subDistrict = subDistrict;
    return this;
  }

  /**
   * @param id the id to set
   * @return SubDistrict for convenience chaining
   */
  public Village setId(Long id) {
    this.id = id;
    return this;
  }

  /**
   * @param name the name to set
   * @return SubDistrict for convenience chaining
   */
  public Village setName(String name) {
    this.name = name;
    return this;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Village o1 = (Village) o;
    if (o1.id == null || id == null) {
      return false;
    }
    return Objects.equals(id, o1.id);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(id);
  }

  @Override
  public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.NO_CLASS_NAME_STYLE);
  }

}

但是在运行mvn test时,它会在Village.java文件上引发错误cannot find symbol subDistrict line 59, 72 and 99

该村庄文件与我之前创建的SubDistrict文件完全相同。

有什么建议吗? 非常感谢

0 个答案:

没有答案