package org.pp.modules.sys.model;

import org.pp.modules.sys.base.BaseToken;
import org.pp.modules.sys.service.ApplicationService;
import org.pp.modules.sys.service.UserService;

import com.jfinal.aop.Aop;

/**
 * Generated by JFinal.
 */
@SuppressWarnings("serial")
public class Token extends BaseToken<Token> {
	private User user;
	private Application app;

	public Application getApp() {
		if(app == null && getClientId() != null) {
			app = Aop.get(ApplicationService.class).findCache(getClientId());
		}
		return app;
	}

	public void setApp(Application app) {
		this.app = app;
	}

	public User getUser() {
		if(user == null && getUserId() != null) {
			user = Aop.get(UserService.class).findCache(getUserId());
		}
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
