私は Java playframework 1.2.4 を使用してプロジェクトに取り組んでおり、 @Entity クラスを持っています。のようです
@Entity
public class EmployeeType extends Model {
public static enum TYPE { HOURLY, DAILY, MONTHLY };
public static enum NATIONALITY { LOCAL, FOREIGN };
@Required
@Enumerated(EnumType.STRING)
public TYPE type;
@Required
@Enumerated(EnumType.STRING)
public NATIONALITY nationality;
}
私のコントローラークラスでは、2 つの列挙型属性を使用して EmployeeTypes のリストを取得したいと考えています。クエリは次のようになります
Query query = JPA.em().createQuery("SELECT e FROM EmployeeType e where " +
"e.nationality = :nationality " +
"and e.type = :type");
query.setParameter("nationality", NATIONALITY.LOCAL);
query.setParameter("type", TYPE.HOURLY);
List<models.EmployeeType> employeeType = query.getResultList()
次のエラーが表示されます: IllegalArgumentException が発生しました: パラメータ値 [LOCAL] が型 [models.EmployeeType$NATIONALITY] と一致しませんでした
私は何をすべきか?