本文整理汇总了Java中com.stacksync.commons.models.Workspace.setId方法的典型用法代码示例。如果您正苦于以下问题:Java Workspace.setId方法的具体用法?Java Workspace.setId怎么用?Java Workspace.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.stacksync.commons.models.Workspace
的用法示例。
在下文中一共展示了Workspace.setId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUserWorkspaceFromResultSet
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
public static UserWorkspace getUserWorkspaceFromResultSet(ResultSet result)
throws SQLException {
User user = new User();
user.setId(UUID.fromString(result.getString("id")));
user.setName(result.getString("name"));
user.setEmail(result.getString("email"));
Workspace workspace = new Workspace();
workspace.setId(UUID.fromString(result.getString("workspace_id")));
UserWorkspace userWorkspace = new UserWorkspace(user, workspace);
userWorkspace.setOwner(result.getBoolean("is_owner"));
userWorkspace.setJoinedAt(result.getDate("joined_at"));
return userWorkspace;
}
示例2: getItemFromResultSet
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
public static Item getItemFromResultSet(ResultSet result) throws SQLException {
Item item = new Item();
item.setId(result.getLong("id"));
item.setLatestVersion(result.getLong("latest_version"));
item.setFilename(result.getString("filename"));
item.setMimetype(result.getString("mimetype"));
item.setIsFolder(result.getBoolean("is_folder"));
item.setClientParentFileVersion((getLongFromResultSet(result, "client_parent_file_version")));
Workspace w = new Workspace();
w.setId(UUID.fromString(result.getString("workspace_id")));
item.setWorkspace(w);
Item parent = new Item();
parent.setId(result.getLong("parent_id"));
item.setParent(parent);
return item;
}
示例3: add
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Override
public void add(Workspace workspace) throws DAOException {
if (!workspace.isValid()) {
throw new IllegalArgumentException("Workspace attributes not set");
}
Object[] values = { workspace.getLatestRevision(), workspace.getOwner().getId(), workspace.isShared(), workspace.isEncrypted(),
workspace.getSwiftContainer(), workspace.getSwiftUrl() };
String query = "INSERT INTO workspace (latest_revision, owner_id, is_shared, is_encrypted, swift_container, swift_url) VALUES (?, ?, ?, ?, ?, ?)";
UUID id = (UUID)executeUpdate(query, values);
if (id != null) {
workspace.setId(id);
}
}
示例4: mapWorkspace
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
private Workspace mapWorkspace(ResultSet result) throws SQLException {
Workspace workspace = new Workspace();
workspace.setId(UUID.fromString(result.getString("id")));
workspace.setLatestRevision(result.getInt("latest_revision"));
workspace.setShared(result.getBoolean("is_shared"));
workspace.setEncrypted(result.getBoolean("is_encrypted"));
workspace.setName(result.getString("workspace_name"));
workspace.setSwiftContainer(result.getString("swift_container"));
workspace.setSwiftUrl(result.getString("swift_url"));
Long parentItemId = result.getLong("parent_item_id");
if (parentItemId == 0L){
parentItemId = null;
}
workspace.setParentItem(new Item(parentItemId));
User owner = new User();
owner.setId(UUID.fromString(result.getString("owner_id")));
workspace.setOwner(owner);
return workspace;
}