I have an entity that has a field of type PlaceType. I don't want to have a equivalent table for it and i want that when Hibernate maps the columns entry to this field i could be able to get the farsi name to show it in form. How is it possible to do this.
@Entity
@Table
public class PostalCodeEntity implements Serializable{
private PlaceType type;
}
-------------------------------------------------------------------
public class PlaceType implements Serializable{
private static final long serialVersionUID = 1L;
private int type;
private String name;
private PlaceType(int type, String name) {
this.type = type;
this.name = name;
}
public int getType() {
return type;
}
public String getName() {
return name;
}
public static final PlaceType OFFICIAL = new PlaceType(1, "اداری");
public static final PlaceType RESIDENTIAL = new PlaceType(2, "مسکونی");
public static final PlaceType COMMERCIAL = new PlaceType(3, "تجاری");
}