blob: 0ea5a9e0975e80c07e1dd0797cfd07f30fbca024 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.acme;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
*
* @author nam
*/
@Entity
@Table(name = "MICRO_MARKET")
@NamedQueries({@NamedQuery(name = "MicroMarket.findByZipCode", query = "SELECT m FROM MicroMarket m WHERE m.zipCode = :zipCode"), @NamedQuery(name = "MicroMarket.findByRadius", query = "SELECT m FROM MicroMarket m WHERE m.radius = :radius"), @NamedQuery(name = "MicroMarket.findByAreaLength", query = "SELECT m FROM MicroMarket m WHERE m.areaLength = :areaLength"), @NamedQuery(name = "MicroMarket.findByAreaWidth", query = "SELECT m FROM MicroMarket m WHERE m.areaWidth = :areaWidth")})
public class MicroMarket implements Serializable {
@Id
@Column(name = "ZIP_CODE", nullable = false)
private String zipCode;
@Column(name = "RADIUS")
private Double radius;
@Column(name = "AREA_LENGTH")
private Double areaLength;
@Column(name = "AREA_WIDTH")
private Double areaWidth;
public MicroMarket() {
}
public MicroMarket(String zipCode) {
this.zipCode = zipCode;
}
public String getZipCode() {
return zipCode;
}
public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}
public Double getRadius() {
return radius;
}
public void setRadius(Double radius) {
this.radius = radius;
}
public Double getAreaLength() {
return areaLength;
}
public void setAreaLength(Double areaLength) {
this.areaLength = areaLength;
}
public Double getAreaWidth() {
return areaWidth;
}
public void setAreaWidth(Double areaWidth) {
this.areaWidth = areaWidth;
}
@Override
public int hashCode() {
int hash = 0;
hash += (zipCode != null ? zipCode.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 MicroMarket)) {
return false;
}
MicroMarket other = (MicroMarket) object;
if (this.zipCode != other.zipCode && (this.zipCode == null || !this.zipCode.equals(other.zipCode))) {
return false;
}
return true;
}
@Override
public String toString() {
return "test.MicroMarket[zipCode=" + zipCode + "]";
}
}