mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-15 05:04:45 +00:00
54 lines
2.1 KiB
Java
54 lines
2.1 KiB
Java
![]() |
/**
|
||
|
* Copyright 2015 LinkedIn Corp. All rights reserved.
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
*/
|
||
|
package dao;
|
||
|
|
||
|
import models.DatasetOwner;
|
||
|
import org.springframework.jdbc.core.RowMapper;
|
||
|
import java.sql.ResultSet;
|
||
|
import java.sql.SQLException;
|
||
|
|
||
|
public class DatasetOwnerRowMapper implements RowMapper<DatasetOwner>
|
||
|
{
|
||
|
public static String DATASET_OWNER_ID_COLUMN = "owner_id";
|
||
|
public static String DATASET_OWNER_DISPLAY_NAME_COLUMN = "display_name";
|
||
|
public static String DATASET_OWNER_TYPE_COLUMN = "owner_type";
|
||
|
public static String DATASET_OWNER_SUB_TYPE_COLUMN = "owner_sub_type";
|
||
|
public static String DATASET_OWNER_SORT_ID_COLUMN = "sort_id";
|
||
|
public static String DATASET_OWNER_IS_GROUP_COLUMN = "is_group";
|
||
|
public static String DATASET_OWNER_NAMESPACE_COLUMN = "namespace";
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public DatasetOwner mapRow(ResultSet rs, int rowNum) throws SQLException
|
||
|
{
|
||
|
String userName = rs.getString(DATASET_OWNER_ID_COLUMN);
|
||
|
String namespace = rs.getString(DATASET_OWNER_NAMESPACE_COLUMN);
|
||
|
String name = rs.getString(DATASET_OWNER_DISPLAY_NAME_COLUMN);
|
||
|
Boolean isGroup = rs.getBoolean(DATASET_OWNER_IS_GROUP_COLUMN);
|
||
|
String type = rs.getString(DATASET_OWNER_TYPE_COLUMN);
|
||
|
String subType = rs.getString(DATASET_OWNER_SUB_TYPE_COLUMN);
|
||
|
Integer sortId = rs.getInt(DATASET_OWNER_SORT_ID_COLUMN);
|
||
|
DatasetOwner owner = new DatasetOwner();
|
||
|
owner.userName = userName;
|
||
|
owner.name = name;
|
||
|
owner.namespace = namespace;
|
||
|
owner.sortId = sortId;
|
||
|
owner.type = type;
|
||
|
owner.subType = subType;
|
||
|
owner.isGroup = isGroup;
|
||
|
|
||
|
return owner;
|
||
|
}
|
||
|
}
|