根据可用的{-3}}弹簧数据的文档,可以使用方法的命名约定创建自定义查询。
我可以使用findByColumn1
在NULL
中找到某些值的记录,并使用column2
在findByColumn2IsNull
中找到包含MyResult result = findByColumn1AndColumn2IsNull("expectedValueOfColumn1");
的对象,但是当我尝试做某事时像
column2
它返回包含public class DatePickerFragment : DialogFragment,
DatePickerDialog.IOnDateSetListener,DatePicker.IOnDateChangedListener
{
// TAG can be any string of your choice.
public static readonly string TAG = "X:" + typeof(DatePickerFragment).Name.ToUpper();
// Initialize this value to prevent NullReferenceExceptions.
Action<DateTime> _dateSelectedHandler = delegate { };
DateTime currently = DateTime.Now;
public static DatePickerFragment NewInstance(Action<DateTime> onDateSelected)
{
DatePickerFragment frag = new DatePickerFragment();
frag._dateSelectedHandler = onDateSelected;
return frag;
}
public override Dialog OnCreateDialog(Bundle savedInstanceState)
{
DatePickerDialog dialog = new DatePickerDialog(Activity,
this,
currently.Year,
currently.Month,
currently.Day);
return dialog;
}
public void OnDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth)
{
// Note: monthOfYear is a value between 0 and 11, not 1 and 12!
DateTime selectedDate = new DateTime(year, monthOfYear + 1, dayOfMonth);
_dateSelectedHandler(selectedDate);
}
public void OnDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth)
{
if (year < currently.Year)
view.UpdateDate(currently.Year, currently.Month, currently.Day);
if(monthOfYear < currently.Month && monthOfYear == currently.Year)
view.UpdateDate(currently.Year, currently.Month, currently.Day);
if(dayOfMonth< currently.Day && year == currently.Year &&monthOfYear == currently.Month)
view.UpdateDate(currently.Year, currently.Month, currently.Day);
}
属性的结果,该属性设置为非空值。
有人可以告诉我,如果我使用的查询方法有误,或者这里有其他问题吗?