|
| 1 | +/* |
| 2 | + * Copyright 2012-2025 the original author or authors. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package org.springframework.boot.autoconfigure.batch.domain; |
| 18 | + |
| 19 | +import java.io.Serializable; |
| 20 | + |
| 21 | +import jakarta.persistence.Column; |
| 22 | +import jakarta.persistence.Entity; |
| 23 | +import jakarta.persistence.GeneratedValue; |
| 24 | +import jakarta.persistence.Id; |
| 25 | + |
| 26 | +@Entity |
| 27 | +public class City implements Serializable { |
| 28 | + |
| 29 | + private static final long serialVersionUID = 1L; |
| 30 | + |
| 31 | + @Id |
| 32 | + @GeneratedValue |
| 33 | + private Long id; |
| 34 | + |
| 35 | + @Column(nullable = false) |
| 36 | + private String name; |
| 37 | + |
| 38 | + @Column(nullable = false) |
| 39 | + private String state; |
| 40 | + |
| 41 | + @Column(nullable = false) |
| 42 | + private String country; |
| 43 | + |
| 44 | + @Column(nullable = false) |
| 45 | + private String map; |
| 46 | + |
| 47 | + protected City() { |
| 48 | + } |
| 49 | + |
| 50 | + public City(String name, String state, String country, String map) { |
| 51 | + this.name = name; |
| 52 | + this.state = state; |
| 53 | + this.country = country; |
| 54 | + this.map = map; |
| 55 | + } |
| 56 | + |
| 57 | + public String getName() { |
| 58 | + return this.name; |
| 59 | + } |
| 60 | + |
| 61 | + public String getState() { |
| 62 | + return this.state; |
| 63 | + } |
| 64 | + |
| 65 | + public String getCountry() { |
| 66 | + return this.country; |
| 67 | + } |
| 68 | + |
| 69 | + public String getMap() { |
| 70 | + return this.map; |
| 71 | + } |
| 72 | + |
| 73 | + @Override |
| 74 | + public String toString() { |
| 75 | + return getName() + "," + getState() + "," + getCountry(); |
| 76 | + } |
| 77 | + |
| 78 | +} |
0 commit comments