Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Adella Garcia   on Apr 17 In Java Category.

  
Question Answered By: Hubba Akhtar   on Apr 17

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, "تجاری");

}

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Hibernate Or get search suggestion and latest updates.


Tagged: