Take the 2-minute tour ×

As the title states, what is its counterpart? any snubbing would not be appreciated. :D


@Type( type="yes_no")



share|improve this question

2 Answers 2

You can use a Converter for this, such as an ObjectTypeConverter.

See, http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters

share|improve this answer
up vote 0 down vote accepted
  private Character enabled;

  public Boolean getEnabled() {
    if (enabled == null) return null;
    return enabled == 'Y' ? Boolean.TRUE : Boolean.FALSE;

  public void setEnabled(Boolean enabled) {
    if (enabled == null) {
      this.enabled = null;
    } else {
      this.enabled = enabled == true ? 'Y' : 'N';

I basically use another method, by manually setting your property(which here is "enabled"), you can easily get the same result(or feel, actually). :D that's all.

share|improve this answer

Your Answer


