• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question related to reflection and setting attbibutes  RSS feed

Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problem is as follows

my method in subclass
public ExpenseModel saveEditDeleteExpesne(ExpenseModel expenseModel) throws TechnicalException {
String mn="saveEditDeleteExpesne(expenseModel)";

and one defined in superclass

protected final Long saveEditDeleteModel(AbstractModel model,String primaryKeySetterMethod){
final String mn="saveEditDeleteModel(model)";
System.out.println("model is"+model.getClass().getName()+ "model status is "+model);
Long modelId=null;
if(model!=null && !model.getStatus().equals(IModel.NONE)){
Integer modelStatus=model.getStatus();
}else if(modelStatus.equals(IModel.EDIT) || modelStatus.equals(IModel.DELETE)){

}catch(DataAccessException dae){


return modelId;


now i want to set primarykey (here expenseId) value by using refletion how should i do it

and instead of returning modelId to subclass method how should i return Value object
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!