public class TestFragment extends Fragment {
private AppProgressDialog progressDialog;
public static TestFragment newInstance() {
TestFragment fragment = new TestFragment();
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
progressDialog = new AppProgressDialog(getActivity());
}
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_login, container, false);
Button btnTest = rootView.findViewById(R.id.btnTest);
btnTest.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
new TestAsyncTask().execute();
}
});
return view;
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
}
@Override
public void onResume() {
super.onResume();
}
class TestAsyncTask extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
progressDialog.setProgressDialogMessage("Logging you to eventizon");
progressDialog.showProgressDialog();
}
@Override
protected String doInBackground(String... params) {
//some code
}
@Override
protected void onPostExecute(String result) {
progressDialog.dismissProgressDialog();
}
}
是否可以将名称属性设置为仅用于B类的瞬态
答案 0 :(得分:1)
不,它不起作用。始终考虑@MappedSuperclass
字段/属性,即使您使用property-access并尝试使用不同的注释覆盖属性,Hibernate仍将使用基类中的属性。