Java EJB删除实体不工作
我正在使用netbeans并从数据库生成实体类。我所有的插入和更新实体的合并调用都工作得很好,但是当我尝试删除实体时,它不会将其从数据库中删除,也不会引发异常。有人能帮我解决吗。我的代码如下: AbstractFacade.javaJava EJB删除实体不工作,java,jakarta-ee,jpa,ejb-3.0,Java,Jakarta Ee,Jpa,Ejb 3.0,我正在使用netbeans并从数据库生成实体类。我所有的插入和更新实体的合并调用都工作得很好,但是当我尝试删除实体时,它不会将其从数据库中删除,也不会引发异常。有人能帮我解决吗。我的代码如下: AbstractFacade.java public abstract class AbstractFacade<T> { private Class<T> entityClass; public AbstractFacade(Class<T>
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
public AbstractFacade(Class<T> entityClass) {
this.entityClass = entityClass;
}
protected abstract EntityManager getEntityManager();
public void create(T entity) {
getEntityManager().persist(entity);
}
public void edit(T entity) {
getEntityManager().merge(entity);
}
public void remove(T entity) {
getEntityManager().remove(getEntityManager().merge(entity));
}
public T find(Object id) {
return getEntityManager().find(entityClass, id);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<T> findAll() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
return getEntityManager().createQuery(cq).getResultList();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<T> findRange(int[] range) {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
javax.persistence.Query q = getEntityManager().createQuery(cq);
q.setMaxResults(range[1] - range[0]);
q.setFirstResult(range[0]);
return q.getResultList();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public int count() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
javax.persistence.criteria.Root<T> rt = cq.from(entityClass);
cq.select(getEntityManager().getCriteriaBuilder().count(rt));
javax.persistence.Query q = getEntityManager().createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
}
}
@Entity
@Table(name = "Account")
public class AccountEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "account_id")
private Long accountId;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_user", nullable = false, length = 100)
private String accountUser;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_pass", nullable = false, length = 100)
private String accountPass;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_fullname", nullable = false, length = 100)
private String accountFullName;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_email", nullable = false, length = 100)
private String accountEmail;
@Basic(optional = false)
@Size(min = 1, max = 100)
@Column(name = "account_phone", nullable = true, length = 100)
private String accountPhone;
@Basic(optional = false)
@Size(min = 1, max = 100)
@Column(name = "account_address", nullable = true, length = 100)
private String accountAddress;
@JoinColumn(name = "role_id", referencedColumnName = "role_id")
@ManyToOne(optional = false)
private RoleEntity roleId;
@JoinColumn(name = "dealer_id", referencedColumnName = "dealer_id")
@ManyToOne(optional = false)
private DealerEntity dealerId;
@Basic(optional = false)
@NotNull
@Column(name = "isAvailable", nullable = false)
private boolean available;
public AccountEntity() {
}
public AccountEntity(Long accountId) {
this.accountId = accountId;
}
public AccountEntity(Long accountId, String accountUser, String accountPass) {
this.accountId = accountId;
this.accountUser = accountUser;
this.accountPass = accountPass;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public String getAccountUser() {
return accountUser;
}
public void setAccountUser(String accountUser) {
this.accountUser = accountUser;
}
public String getAccountPass() {
return accountPass;
}
public void setAccountPass(String accountPass) {
this.accountPass = accountPass;
}
public String getAccountFullName() {
return accountFullName;
}
public void setAccountFullName(String accountFullName) {
this.accountFullName = accountFullName;
}
public String getAccountEmail() {
return accountEmail;
}
public void setAccountEmail(String accountEmail) {
this.accountEmail = accountEmail;
}
public String getAccountPhone() {
return accountPhone;
}
public void setAccountPhone(String accountPhone) {
this.accountPhone = accountPhone;
}
public String getAccountAddress() {
return accountAddress;
}
public void setAccountAddress(String accountAddress) {
this.accountAddress = accountAddress;
}
public RoleEntity getRoleId() {
return roleId;
}
public void setRoleId(RoleEntity roleId) {
this.roleId = roleId;
}
public DealerEntity getDealerId() {
return dealerId;
}
public void setDealerId(DealerEntity dealerId) {
this.dealerId = dealerId;
}
public boolean isAvailable() {
return available;
}
public void setAvailable(boolean available) {
this.available = available;
}
@Override
public int hashCode() {
int hash = 0;
hash += (accountId != null ? accountId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof AccountEntity)) {
return false;
}
AccountEntity other = (AccountEntity) object;
if ((this.accountId == null && other.accountId != null) || (this.accountId != null && !this.accountId.equals(other.accountId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.AccountEntity[ accountId=" + accountId + " ]";
}
}
@Entity
@Table(name = "Dealer")
public class DealerEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "dealer_id")
private Long dealerId;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "dealer_name", nullable = false, length = 100)
private String dealerName;
@Size(max = 100)
@Column(name = "dealer_phone", length = 100)
private String dealerPhone;
@Size(max = 100)
@Column(name = "dealer_fax", length = 100)
private String dealerFax;
@Size(max = 100)
@Column(name = "dealer_address", length = 100)
private String dealerAddress;
@Size(max = 100)
@Column(name = "dealer_coordinate", length = 100)
private String dealerCoordinate;
@Size(max = 100)
@Column(name = "state_name", length = 100)
private String stateName;
@Basic(optional = false)
@NotNull
@Column(name = "isRoot", nullable = false)
private boolean isRoot;
@Basic(optional = false)
@NotNull
@Column(name = "isAvailable", nullable = false)
private boolean isAvailable;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<CustomerEntity> customerEntityList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<ServiceEntity> serviceEntityList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<AccountEntity> accountEntityList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<PurchaseOrderEntity> purchaseOrderEntityList;
@JoinColumn(name = "country_id", referencedColumnName = "country_id", nullable = false)
@ManyToOne(optional = false)
private CountryEntity countryId;
public DealerEntity() {
}
public DealerEntity(Long dealerId) {
this.dealerId = dealerId;
}
public DealerEntity(Long dealerId, String dealerName, boolean isRoot, boolean isAvailable) {
this.dealerId = dealerId;
this.dealerName = dealerName;
this.isRoot = isRoot;
this.isAvailable = isAvailable;
}
public Long getDealerId() {
return dealerId;
}
public void setDealerId(Long dealerId) {
this.dealerId = dealerId;
}
public String getDealerName() {
return dealerName;
}
public void setDealerName(String dealerName) {
this.dealerName = dealerName;
}
public String getDealerPhone() {
return dealerPhone;
}
public void setDealerPhone(String dealerPhone) {
this.dealerPhone = dealerPhone;
}
public String getDealerFax() {
return dealerFax;
}
public void setDealerFax(String dealerFax) {
this.dealerFax = dealerFax;
}
public String getDealerAddress() {
return dealerAddress;
}
public void setDealerAddress(String dealerAddress) {
this.dealerAddress = dealerAddress;
}
public String getDealerCoordinate() {
return dealerCoordinate;
}
public void setDealerCoordinate(String dealerCoordinate) {
this.dealerCoordinate = dealerCoordinate;
}
public String getStateName() {
return stateName;
}
public void setStateName(String stateName) {
this.stateName = stateName;
}
public boolean getIsRoot() {
return isRoot;
}
public void setIsRoot(boolean isRoot) {
this.isRoot = isRoot;
}
public boolean getIsAvailable() {
return isAvailable;
}
public void setIsAvailable(boolean isAvailable) {
this.isAvailable = isAvailable;
}
@XmlTransient
public List<CustomerEntity> getCustomerEntityList() {
return customerEntityList;
}
public void setCustomerEntityList(List<CustomerEntity> customerEntityList) {
this.customerEntityList = customerEntityList;
}
@XmlTransient
public List<ServiceEntity> getServiceEntityList() {
return serviceEntityList;
}
public void setServiceEntityList(List<ServiceEntity> serviceEntityList) {
this.serviceEntityList = serviceEntityList;
}
@XmlTransient
public List<AccountEntity> getAccountEntityList() {
return accountEntityList;
}
public void setAccountEntityList(List<AccountEntity> accountEntityList) {
this.accountEntityList = accountEntityList;
}
@XmlTransient
public List<PurchaseOrderEntity> getPurchaseOrderEntityList() {
return purchaseOrderEntityList;
}
public void setPurchaseOrderEntityList(List<PurchaseOrderEntity> purchaseOrderEntityList) {
this.purchaseOrderEntityList = purchaseOrderEntityList;
}
public CountryEntity getCountryId() {
return countryId;
}
public void setCountryId(CountryEntity countryId) {
this.countryId = countryId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (dealerId != null ? dealerId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DealerEntity)) {
return false;
}
DealerEntity other = (DealerEntity) object;
if ((this.dealerId == null && other.dealerId != null) || (this.dealerId != null && !this.dealerId.equals(other.dealerId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.DealerEntity[ dealerId=" + dealerId + " ]";
}
}
DealerEntity.java
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
public AbstractFacade(Class<T> entityClass) {
this.entityClass = entityClass;
}
protected abstract EntityManager getEntityManager();
public void create(T entity) {
getEntityManager().persist(entity);
}
public void edit(T entity) {
getEntityManager().merge(entity);
}
public void remove(T entity) {
getEntityManager().remove(getEntityManager().merge(entity));
}
public T find(Object id) {
return getEntityManager().find(entityClass, id);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<T> findAll() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
return getEntityManager().createQuery(cq).getResultList();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<T> findRange(int[] range) {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
javax.persistence.Query q = getEntityManager().createQuery(cq);
q.setMaxResults(range[1] - range[0]);
q.setFirstResult(range[0]);
return q.getResultList();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public int count() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
javax.persistence.criteria.Root<T> rt = cq.from(entityClass);
cq.select(getEntityManager().getCriteriaBuilder().count(rt));
javax.persistence.Query q = getEntityManager().createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
}
}
@Entity
@Table(name = "Account")
public class AccountEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "account_id")
private Long accountId;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_user", nullable = false, length = 100)
private String accountUser;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_pass", nullable = false, length = 100)
private String accountPass;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_fullname", nullable = false, length = 100)
private String accountFullName;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "account_email", nullable = false, length = 100)
private String accountEmail;
@Basic(optional = false)
@Size(min = 1, max = 100)
@Column(name = "account_phone", nullable = true, length = 100)
private String accountPhone;
@Basic(optional = false)
@Size(min = 1, max = 100)
@Column(name = "account_address", nullable = true, length = 100)
private String accountAddress;
@JoinColumn(name = "role_id", referencedColumnName = "role_id")
@ManyToOne(optional = false)
private RoleEntity roleId;
@JoinColumn(name = "dealer_id", referencedColumnName = "dealer_id")
@ManyToOne(optional = false)
private DealerEntity dealerId;
@Basic(optional = false)
@NotNull
@Column(name = "isAvailable", nullable = false)
private boolean available;
public AccountEntity() {
}
public AccountEntity(Long accountId) {
this.accountId = accountId;
}
public AccountEntity(Long accountId, String accountUser, String accountPass) {
this.accountId = accountId;
this.accountUser = accountUser;
this.accountPass = accountPass;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public String getAccountUser() {
return accountUser;
}
public void setAccountUser(String accountUser) {
this.accountUser = accountUser;
}
public String getAccountPass() {
return accountPass;
}
public void setAccountPass(String accountPass) {
this.accountPass = accountPass;
}
public String getAccountFullName() {
return accountFullName;
}
public void setAccountFullName(String accountFullName) {
this.accountFullName = accountFullName;
}
public String getAccountEmail() {
return accountEmail;
}
public void setAccountEmail(String accountEmail) {
this.accountEmail = accountEmail;
}
public String getAccountPhone() {
return accountPhone;
}
public void setAccountPhone(String accountPhone) {
this.accountPhone = accountPhone;
}
public String getAccountAddress() {
return accountAddress;
}
public void setAccountAddress(String accountAddress) {
this.accountAddress = accountAddress;
}
public RoleEntity getRoleId() {
return roleId;
}
public void setRoleId(RoleEntity roleId) {
this.roleId = roleId;
}
public DealerEntity getDealerId() {
return dealerId;
}
public void setDealerId(DealerEntity dealerId) {
this.dealerId = dealerId;
}
public boolean isAvailable() {
return available;
}
public void setAvailable(boolean available) {
this.available = available;
}
@Override
public int hashCode() {
int hash = 0;
hash += (accountId != null ? accountId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
if (!(object instanceof AccountEntity)) {
return false;
}
AccountEntity other = (AccountEntity) object;
if ((this.accountId == null && other.accountId != null) || (this.accountId != null && !this.accountId.equals(other.accountId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.AccountEntity[ accountId=" + accountId + " ]";
}
}
@Entity
@Table(name = "Dealer")
public class DealerEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "dealer_id")
private Long dealerId;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "dealer_name", nullable = false, length = 100)
private String dealerName;
@Size(max = 100)
@Column(name = "dealer_phone", length = 100)
private String dealerPhone;
@Size(max = 100)
@Column(name = "dealer_fax", length = 100)
private String dealerFax;
@Size(max = 100)
@Column(name = "dealer_address", length = 100)
private String dealerAddress;
@Size(max = 100)
@Column(name = "dealer_coordinate", length = 100)
private String dealerCoordinate;
@Size(max = 100)
@Column(name = "state_name", length = 100)
private String stateName;
@Basic(optional = false)
@NotNull
@Column(name = "isRoot", nullable = false)
private boolean isRoot;
@Basic(optional = false)
@NotNull
@Column(name = "isAvailable", nullable = false)
private boolean isAvailable;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<CustomerEntity> customerEntityList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<ServiceEntity> serviceEntityList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<AccountEntity> accountEntityList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "dealerId")
private List<PurchaseOrderEntity> purchaseOrderEntityList;
@JoinColumn(name = "country_id", referencedColumnName = "country_id", nullable = false)
@ManyToOne(optional = false)
private CountryEntity countryId;
public DealerEntity() {
}
public DealerEntity(Long dealerId) {
this.dealerId = dealerId;
}
public DealerEntity(Long dealerId, String dealerName, boolean isRoot, boolean isAvailable) {
this.dealerId = dealerId;
this.dealerName = dealerName;
this.isRoot = isRoot;
this.isAvailable = isAvailable;
}
public Long getDealerId() {
return dealerId;
}
public void setDealerId(Long dealerId) {
this.dealerId = dealerId;
}
public String getDealerName() {
return dealerName;
}
public void setDealerName(String dealerName) {
this.dealerName = dealerName;
}
public String getDealerPhone() {
return dealerPhone;
}
public void setDealerPhone(String dealerPhone) {
this.dealerPhone = dealerPhone;
}
public String getDealerFax() {
return dealerFax;
}
public void setDealerFax(String dealerFax) {
this.dealerFax = dealerFax;
}
public String getDealerAddress() {
return dealerAddress;
}
public void setDealerAddress(String dealerAddress) {
this.dealerAddress = dealerAddress;
}
public String getDealerCoordinate() {
return dealerCoordinate;
}
public void setDealerCoordinate(String dealerCoordinate) {
this.dealerCoordinate = dealerCoordinate;
}
public String getStateName() {
return stateName;
}
public void setStateName(String stateName) {
this.stateName = stateName;
}
public boolean getIsRoot() {
return isRoot;
}
public void setIsRoot(boolean isRoot) {
this.isRoot = isRoot;
}
public boolean getIsAvailable() {
return isAvailable;
}
public void setIsAvailable(boolean isAvailable) {
this.isAvailable = isAvailable;
}
@XmlTransient
public List<CustomerEntity> getCustomerEntityList() {
return customerEntityList;
}
public void setCustomerEntityList(List<CustomerEntity> customerEntityList) {
this.customerEntityList = customerEntityList;
}
@XmlTransient
public List<ServiceEntity> getServiceEntityList() {
return serviceEntityList;
}
public void setServiceEntityList(List<ServiceEntity> serviceEntityList) {
this.serviceEntityList = serviceEntityList;
}
@XmlTransient
public List<AccountEntity> getAccountEntityList() {
return accountEntityList;
}
public void setAccountEntityList(List<AccountEntity> accountEntityList) {
this.accountEntityList = accountEntityList;
}
@XmlTransient
public List<PurchaseOrderEntity> getPurchaseOrderEntityList() {
return purchaseOrderEntityList;
}
public void setPurchaseOrderEntityList(List<PurchaseOrderEntity> purchaseOrderEntityList) {
this.purchaseOrderEntityList = purchaseOrderEntityList;
}
public CountryEntity getCountryId() {
return countryId;
}
public void setCountryId(CountryEntity countryId) {
this.countryId = countryId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (dealerId != null ? dealerId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DealerEntity)) {
return false;
}
DealerEntity other = (DealerEntity) object;
if ((this.dealerId == null && other.dealerId != null) || (this.dealerId != null && !this.dealerId.equals(other.dealerId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.DealerEntity[ dealerId=" + dealerId + " ]";
}
}
@实体
@表(name=“经销商”)
公共类DealerEntity实现可序列化{
私有静态最终长serialVersionUID=1L;
@身份证
@GeneratedValue(策略=GenerationType.IDENTITY)
@基本(可选=假)
@列(name=“经销商id”)
私人长假;
@基本(可选=假)
@NotNull
@尺寸(最小值=1,最大值=100)
@列(name=“dealer\u name”,null=false,长度=100)
私有字符串DealName;
@尺寸(最大值=100)
@列(name=“经销商电话”,长度=100)
专用串电话;
@尺寸(最大值=100)
@列(name=“经销商传真”,长度=100)
私有字符串dealerFax;
@尺寸(最大值=100)
@列(name=“经销商地址”,长度=100)
私有字符串dealerAddress;
@尺寸(最大值=100)
@列(name=“经销商坐标”,长度=100)
私有字符串处理协调;
@尺寸(最大值=100)
@列(name=“state_name”,长度=100)
私有字符串stateName;
@基本(可选=假)
@NotNull
@列(name=“isRoot”,nullable=false)
私有布尔isRoot;
@基本(可选=假)
@NotNull
@列(name=“isAvailable”,nullable=false)
私有布尔值不可用;
@OneToMany(cascade=CascadeType.ALL,mappedBy=“dealerId”)
私有列表customerEntityList;
@OneToMany(cascade=CascadeType.ALL,mappedBy=“dealerId”)
私有列表服务实体列表;
@OneToMany(cascade=CascadeType.ALL,mappedBy=“dealerId”)
私有列表accountEntityList;
@OneToMany(cascade=CascadeType.ALL,mappedBy=“dealerId”)
私有列表purchaseOrderEntityList;
@JoinColumn(name=“country\u id”,referencedColumnName=“country\u id”,nullable=false)
@多通(可选=假)
私人CountryEntity countryId;
公开交易(){
}
公共DealerEntity(长dealerId){
this.dealerId=dealerId;
}
公共DealerEntity(长dealerId、字符串dealerName、布尔值isRoot、布尔值isAvailable){
this.dealerId=dealerId;
this.dealerName=dealerName;
this.isRoot=isRoot;
this.isAvailable=isAvailable;
}
公共长getDealerId(){
返回dealerId;
}
public void setDealerId(长dealerId){
this.dealerId=dealerId;
}
公共字符串getDealName(){
返回DealName;
}
public void setDealerName(字符串dealerName){
this.dealerName=dealerName;
}
公共字符串getDealerPhone(){
返回电话;
}
公共void setDealerPhone(字符串dealerPhone){
this.dealerPhone=dealerPhone;
}
公共字符串getDealerFax(){
返回DealFax;
}
公共void setDealerFax(字符串dealerFax){
this.dealerFax=dealerFax;
}
公共字符串getDealerAddress(){
返回dealerAddress;
}
public void setDealerAddress(字符串dealerAddress){
this.dealerAddress=dealerAddress;
}
公共字符串getDealerCoordinate(){
退货协调;
}
public void setDealerCoordinate(字符串dealerCoordinate){
this.dealerCoordinate=dealerCoordinate;
}
公共字符串getStateName(){
返回stateName;
}
public void setStateName(字符串stateName){
this.stateName=stateName;
}
公共布尔getIsRoot(){
返回isRoot;
}
公共void setIsRoot(布尔值isRoot){
this.isRoot=isRoot;
}
公共布尔getIsAvailable(){
可获得的回报;
}
public void setIsAvailable(布尔值isAvailable){
this.isAvailable=isAvailable;
}
@XmlTransient
公共列表getCustomerEntityList(){
返回customerEntityList;
}
public void setCustomerEntityList(列出customerEntityList){
this.customerEntityList=customerEntityList;
}
@XmlTransient
公共列表getServiceEntityList(){
返回serviceEntityList;
}
public void setServiceEntityList(列表serviceEntityList){
this.serviceEntityList=serviceEntityList;
}
@XmlTransient
公共列表getAccountEntityList(){
返回accountEntityList;
}
public void setAccountEntityList(列表accountEntityList){
this.accountEntityList=accountEntityList;
}
@XmlTransient
公共列表getPurchaseOrderEntityList(){
返回purchaseOrderEntityList;
}
public void setPurchaseOrderEntityList(列表purchaseOrderEntityList){
this.purchaseOrderEntityList=purchaseOrderEntityList;
}
公共CountryEntity getCountryId(){
返回countryId;
}
公共无效setCountryId(CountryEntity countryId){
this.countryId=countryId;
}
@凌驾
公共int hashCode(){
int hash=0;
hash+=(dealerId!=null?dealerId.hashCode():0);
返回散列;
}
@凌驾
公共布尔等于(对象){
//TODO:警告-如果未设置id字段,此方法将不起作用
if(!(对象实例的DealerEntity)){
返回false;
}
DealerEntity other=(DealerEntity)对象;
如果((this.dealerId==null&&other.dealerId!=null)| |(this.dealerId!=null&&!this.dealerId.equals(other.dealerId))){
返回false;
}
返回true;
}
@凌驾
公共字符串toString(){
返回“entities.DealerEntity[dealerId=“+dealerId+”]”;
}
}
您的持久性上下文似乎与基础数据不同步