@Test public void the_entity_value_of_a_known_string_is_the_enumeration() { ReservationStatus value = new ReservationStatusConverter().convertToEntityAttribute(CANCELED.name()); assertThat(value).isSameAs(CANCELED); }
@Override public ReservationStatus convertToEntityAttribute(String y) { if (null == y) { return null; } for (ReservationStatus elem : ReservationStatus.values()) { if (elem.name().equalsIgnoreCase(y)) { return elem; } } throw new IllegalArgumentException("Cannot map " + y); }
ReservationStatusConverter implements AttributeConverter<ReservationStatus, String> { @Override public ReservationStatus convertToEntityAttribute(String y) { if (null == y) { return null; } for (ReservationStatus elem : ReservationStatus.values()) { if (elem.name().equalsIgnoreCase(y)) { return elem; } } throw new IllegalArgumentException("Cannot map " + y); } }
ReservationStatusConverter implements AttributeConverter<ReservationStatus, String> { @Override public ReservationStatus convertToEntityAttribute(String y) { if (null == y) { return null; } for (ReservationStatus elem : ReservationStatus.values()) { if (elem.name().equalsIgnoreCase(y)) { return elem; } } throw new IllegalArgumentException("Cannot map " + y); }  }
ReservationStatusConverter implements AttributeConverter<ReservationStatus, String> { @Override public ReservationStatus convertToEntityAttribute(String y) { if (null == y) { return null; } for (ReservationStatus elem : ReservationStatus.values()) { if (elem.name().equalsIgnoreCase(y)) { return elem; } } throw new IllegalArgumentException("Cannot map " + y); }  @Override String convertToDatabaseColumn(ReservationStatus x); @Override ReservationStatus convertToEntityAttribute(String y); }
ReservationStatusConverter implements AttributeConverter<ReservationStatus, String> { @Override public ReservationStatus convertToEntityAttribute(String y) { if (null == y) { return null; } for (ReservationStatus elem : ReservationStatus.values()) { if (elem.name().equalsIgnoreCase(y)) { return elem; } } throw new IllegalArgumentException("Cannot map " + y); }  @Override String convertToDatabaseColumn(ReservationStatus x); @Override ReservationStatus convertToEntityAttribute(String y);  }