当前位置: 首页>>代码示例>>Java>>正文


Java User类代码示例

本文整理汇总了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);
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:17,代码来源:UserRegistrationActionBean.java

示例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);
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:23,代码来源:UserRegistrationActionBean.java

示例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);
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:17,代码来源:UserViewActionBean.java

示例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;
}
 
开发者ID:nordpos-mobi,项目名称:online-retail,代码行数:33,代码来源:OrderPostActionBean.java

示例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);
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:11,代码来源:UserAuthorizationActionBean.java

示例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()));
    }
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:15,代码来源:UserRegistrationActionBean.java

示例7: getUser

import mobi.nordpos.dao.model.User; //导入依赖的package包/类
public User getUser() {
    return user;
}
 
开发者ID:nordpos-mobi,项目名称:online-retail,代码行数:4,代码来源:BaseActionBean.java

示例8: setUser

import mobi.nordpos.dao.model.User; //导入依赖的package包/类
public void setUser(User user) {
    this.user = user;
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:4,代码来源:UserBaseActionBean.java

示例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");
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:7,代码来源:MobileActionBeanContext.java

示例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);
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:7,代码来源:MobileActionBeanContext.java


注:本文中的mobi.nordpos.dao.model.User类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。