本文整理汇总了Java中mobi.nordpos.dao.model.User类的典型用法代码示例。如果您正苦于以下问题:Java User类的具体用法?Java User怎么用?Java User使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
User类属于mobi.nordpos.dao.model包,在下文中一共展示了User类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: accept
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
public Resolution accept() throws UnsupportedEncodingException, NoSuchAlgorithmException {
try {
userPersist.init(getDataBaseConnection());
User user = getUser();
user.setId(UUID.randomUUID().toString());
getContext().getMessages().add(
new SimpleMessage(getLocalizationKey("message.User.registered"),
userPersist.add(user).getName())
);
} catch (SQLException ex) {
getContext().getValidationErrors().addGlobalError(
new SimpleError(ex.getMessage()));
return getContext().getSourcePageResolution();
}
return new ForwardResolution(UserAuthorizationActionBean.class);
}
示例2: setUser
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
@ValidateNestedProperties({
@Validate(on = {"accept"},
field = "name",
required = true,
minlength = 5,
maxlength = 20),
@Validate(on = {"accept"},
field = "password",
required = true,
minlength = 5,
maxlength = 20),
@Validate(on = {"accept"},
field = "visible",
required = true,
converter = BooleanTypeConverter.class),
@Validate(on = {"accept"},
field = "role.id",
required = true)})
@Override
public void setUser(User user) {
super.setUser(user);
}
示例3: update
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
public Resolution update() {
User user = getContext().getUser();
try {
userPersist.init(getDataBaseConnection());
if (userPersist.change(user)) {
getContext().getMessages().add(
new SimpleMessage(getLocalizationKey("message.User.updated"),
user.getName()));
}
} catch (SQLException ex) {
getContext().getValidationErrors().addGlobalError(
new SimpleError(ex.getMessage()));
return getContext().getSourcePageResolution();
}
return new ForwardResolution(WelcomeActionBean.class);
}
示例4: getPostedTicket
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
private Ticket getPostedTicket(SharedTicket order, Receipt receipt) throws SQLException {
TicketPersist ticketPersist = new TicketPersist();
TicketLinePersist ticketLinePersist = new TicketLinePersist();
StockDiaryPersist stockDiaryPersist = new StockDiaryPersist();
ticketPersist.init(getDataBaseConnection());
ticketLinePersist.init(getDataBaseConnection());
stockDiaryPersist.init(getDataBaseConnection());
Ticket ticket = new Ticket();
ticket.setId(receipt.getId().toString());
ticket.setType(TicketType.SELL.getCode());
ticket.setCustomer(getContext().getCustomer());
User user = getUser();
ticket.setUser(user);
TicketNumber number = getCurrentTicketNumber();
if (number != null) {
ticket.setNumber(number.getId());
}
ticket = ticketPersist.add(ticket);
ticketLinePersist.addTicketLineList(order, ticket);
ticket = ticketPersist.read(ticket.getId());
Location location = getLocation();
List<TicketLine> ticketLineList = ticketPersist.readTicketLineList(ticket);
stockDiaryPersist.addStockDiaryList(MovementReasonType.OUT_SALE.getValue(), location, receipt, ticketLineList);
updateStockCurrentSale(location, ticketLineList);
return ticket;
}
示例5: setUser
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
@ValidateNestedProperties({
@Validate(on = {"login"},
field = "name",
required = true,
minlength = 5,
maxlength = 20)})
@Override
public void setUser(User user) {
super.setUser(user);
}
示例6: validateUserNameIsAvalaible
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
@ValidationMethod(on = {"accept"})
public void validateUserNameIsAvalaible(ValidationErrors errors) {
try {
userPersist.init(getDataBaseConnection());
User user = userPersist.find(User.NAME, getUser().getName());
if (user != null) {
errors.add("user.name", new SimpleError(
getLocalizationKey("error.User.AlreadyExists"), user.getName()));
}
} catch (SQLException ex) {
getContext().getValidationErrors().addGlobalError(
new SimpleError(ex.getMessage()));
}
}
示例7: getUser
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
public User getUser() {
return user;
}
示例8: setUser
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
public void setUser(User user) {
this.user = user;
}
示例9: getUser
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
/**
* Gets the currently logged in user, or null if no-one is logged in.
*/
public User getUser() {
return (User) getRequest().getSession().getAttribute("user");
}
示例10: setUser
import mobi.nordpos.dao.model.User; //导入依赖的package包/类
/**
* Sets the currently logged in user.
*/
public void setUser(User currentUser) {
getRequest().getSession().setAttribute("user", currentUser);
}