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


Java Model.getBoolean方法代码示例

本文整理汇总了Java中org.javalite.activejdbc.Model.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Model.getBoolean方法的具体用法?Java Model.getBoolean怎么用?Java Model.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javalite.activejdbc.Model的用法示例。


在下文中一共展示了Model.getBoolean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.javalite.activejdbc.Model; //导入方法依赖的package包/类
public static Comment create(Model cv, Integer vote) {

        User user = User.create(cv.getLong("user_id"), cv.getString("user_name"));
        User modifiedByUser = User.create(cv.getLong("modified_by_user_id"), cv.getString("modified_by_user_name"));


        return new Comment(cv.getLong("id"),
                user,
                modifiedByUser,
                cv.getLong("discussion_id"),
                cv.getLong("discussion_owner_id"),
                cv.getString("text_"),
                cv.getLong("path_length"),
                cv.getLong("parent_id"),
                cv.getLong("parent_user_id"),
                cv.getString("breadcrumbs"),
                cv.getLong("num_of_parents"),
                cv.getLong("num_of_children"),
                cv.getInteger("avg_rank"),
                vote,
                cv.getInteger("number_of_votes"),
                cv.getBoolean("deleted"),
                cv.getBoolean("read"),
                cv.getTimestamp("created"),
                cv.getTimestamp("modified"));
    }
 
开发者ID:dessalines,项目名称:flowchat,代码行数:27,代码来源:Comment.java

示例2: create

import org.javalite.activejdbc.Model; //导入方法依赖的package包/类
public static Community create(Model c,
                               List<Tables.CommunityTagView> communityTags,
                               List<Tables.CommunityUserView> communityUsers,
                               Integer vote) {
    // convert the tags
    List<Tag> tags = null;
    if (communityTags != null) {
        tags = new ArrayList<>();
        for (Tables.CommunityTagView dtv : communityTags) {
            tags.add(Tag.create(dtv.getLong("tag_id"), dtv.getString("name")));
        }
    }

    // convert the user community roles
    User creator = null;
    List<User> moderators = new ArrayList<>();
    List<User> privateUsers = new ArrayList<>();
    List<User> blockedUsers = new ArrayList<>();

    if (communityUsers != null) {
        for (Tables.CommunityUserView udv : communityUsers) {

            CommunityRole role = CommunityRole.values()[udv.getLong("community_role_id").intValue() - 1];

            User userObj = User.create(udv.getLong("user_id"), udv.getString("name"));

            switch (role) {
                case CREATOR:
                    creator = userObj;
                    break;
                case MODERATOR:
                    moderators.add(userObj);
                    break;
                case BLOCKED:
                    blockedUsers.add(userObj);
                    break;
                case USER:
                    privateUsers.add(userObj);
                    break;
            }
        }
    }

    // Create the modified by user
    User modifiedByUser = User.create(c.getLong("modified_by_user_id"), c.getString("modified_by_user_name"));

    return new Community(c.getLongId(),
            c.getString("name"),
            c.getString("text_"),
            c.getBoolean("private"),
            c.getInteger("avg_rank"),
            vote,
            c.getInteger("number_of_votes"),
            tags,
            creator,
            modifiedByUser,
            moderators,
            privateUsers,
            blockedUsers,
            c.getBoolean("deleted"),
            c.getTimestamp("created"),
            c.getTimestamp("modified"));
}
 
开发者ID:dessalines,项目名称:flowchat,代码行数:64,代码来源:Community.java

示例3: create

import org.javalite.activejdbc.Model; //导入方法依赖的package包/类
public static Discussion create(Model d,
                                Tables.CommunityNoTextView cntv,
                                List<Tables.DiscussionTagView> discussionTags,
                                List<Tables.DiscussionUserView> discussionUsers,
                                List<Tables.CommunityUserView> communityUsers,
                                Integer vote) {
    // convert the tags
    List<Tag> tags = null;
    if (discussionTags != null) {
        tags = new ArrayList<>();
        for (Tables.DiscussionTagView dtv : discussionTags) {
            tags.add(Tag.create(dtv.getLong("tag_id"), dtv.getString("name")));
        }
    }

    // convert the user discussion roles
    User creator = null;
    List<User> privateUsers = new ArrayList<>();
    List<User> blockedUsers = new ArrayList<>();

    if (discussionUsers != null) {
        for (Tables.DiscussionUserView udv : discussionUsers) {

            DiscussionRole role = DiscussionRole.values()[udv.getLong("discussion_role_id").intValue() - 1];

            User userObj = User.create(udv.getLong("user_id"), udv.getString("name"));

            switch (role) {
                case BLOCKED:
                    blockedUsers.add(userObj);
                    break;
                case USER:
                    privateUsers.add(userObj);
                    break;
                case CREATOR:
                    creator = userObj;
                    break;
            }
        }
    }

    // Create the community
    Community community = (cntv != null) ? Community.create(cntv, null, communityUsers, null) : null;

    // Create the modified by user
    User modifiedByUser = User.create(d.getLong("modified_by_user_id"), d.getString("modified_by_user_name"));

    return new Discussion(d.getLongId(),
            d.getString("title"),
            d.getString("link"),
            d.getString("text_"),
            d.getBoolean("private"),
            d.getInteger("avg_rank"),
            vote,
            d.getInteger("number_of_votes"),
            d.getInteger("number_of_comments"),
            tags,
            creator,
            modifiedByUser,
            privateUsers,
            blockedUsers,
            d.getBoolean("deleted"),
            community,
            d.getTimestamp("created"),
            d.getTimestamp("modified"));
}
 
开发者ID:dessalines,项目名称:flowchat,代码行数:67,代码来源:Discussion.java


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