请教Banq

06-02-23 X.Underset
public class ForumProxy implements Forum {

private ForumPermissions permissions;

private Forum forum;

this.authorization = authorization;

public ForumProxy(Forum forum, Authorization authorization,

ForumPermissions permissions)

{

this.forum = forum;

this.authorization = authorization;

this.permissions = permissions;

}

.....

public void setName(String name) throws UnauthorizedException,

ForumAlreadyExistsException

{

  //只有是系统或论坛管理者才可以修改名称

  if (permissions.isSystemOrForumAdmin()) {

    forum.setName(name);

  }

  else {

    throw new UnauthorizedException();

  }

}

...

}

代码中的"forum.setName(name)"不明白有什么意思请教...

banq
2006-03-01 12:02
forum.setName相当于直接sql语句update name这个字段,和hibernate中的setXXX意思是一致的。

猜你喜欢