@Test(expected = IllegalArgumentException.class) public void the_entity_value_of_an_unknown_string_results_in_an_exception() { new ReservationStatusConverter().convertToEntityAttribute("Foo"); }
@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);  }