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


Java Record.getValue方法代码示例

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


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

示例1: getOneopsEnvironments

import org.jooq.Record; //导入方法依赖的package包/类
private List<Environment> getOneopsEnvironments(Connection conn) {
    List<Environment> envs = new ArrayList<>();
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    log.info("Fetching all environments..");
    Result<Record> envRecords = create.select().from(CM_CI)
            .join(MD_CLASSES).on(CM_CI.CLASS_ID.eq(MD_CLASSES.CLASS_ID))
            .join(NS_NAMESPACES).on(CM_CI.NS_ID.eq(NS_NAMESPACES.NS_ID))
            .where(MD_CLASSES.CLASS_NAME.eq("manifest.Environment"))
            .fetch(); //all the env cis
    log.info("Got all environments");
    for (Record r : envRecords) {
        long envId = r.getValue(CM_CI.CI_ID);
        //now query attributes for this env
        Environment env = new Environment();
        env.setName(r.getValue(CM_CI.CI_NAME));
        env.setId(r.getValue(CM_CI.CI_ID));
        env.setPath(r.getValue(NS_NAMESPACES.NS_PATH));
        env.setNsId(r.getValue(NS_NAMESPACES.NS_ID));
        envs.add(env);
    }
    return envs;
}
 
开发者ID:oneops,项目名称:oneops,代码行数:23,代码来源:CMSCrawler.java

示例2: getActiveClouds

import org.jooq.Record; //导入方法依赖的package包/类
private List<String> getActiveClouds(Platform platform, Connection conn) {
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    List<String> clouds = new ArrayList<>();
    Result<Record> consumesRecords = create.select().from(CM_CI_RELATIONS)
            .join(MD_RELATIONS).on(MD_RELATIONS.RELATION_ID.eq(CM_CI_RELATIONS.RELATION_ID))
            .join(CM_CI_RELATION_ATTRIBUTES).on(CM_CI_RELATION_ATTRIBUTES.CI_RELATION_ID.eq(CM_CI_RELATIONS.CI_RELATION_ID))
            .where(CM_CI_RELATIONS.FROM_CI_ID.eq(platform.getId()))
            .and(CM_CI_RELATION_ATTRIBUTES.DF_ATTRIBUTE_VALUE.eq("active"))
            .fetch();
    for (Record r : consumesRecords) {
        String comments = r.getValue(CM_CI_RELATIONS.COMMENTS);
        String cloudName = comments.split(":")[1];
        cloudName = cloudName.split("\"")[1];
        clouds.add(cloudName);
    }
    return clouds;
}
 
开发者ID:oneops,项目名称:oneops,代码行数:18,代码来源:CMSCrawler.java

示例3: main

import org.jooq.Record; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    String user = System.getProperty("jdbc.user");
    String password = System.getProperty("jdbc.password");
    String url = System.getProperty("jdbc.url");
    String driver = System.getProperty("jdbc.driver");

    Class.forName(driver).newInstance();
    try (Connection connection = DriverManager.getConnection(url, user, password)) {
        DSLContext dslContext = DSL.using(connection, SQLDialect.MYSQL);
        Result<Record> result = dslContext.select().from(AUTHOR).fetch();

        for (Record r : result) {
            Integer id = r.getValue(AUTHOR.ID);
            String firstName = r.getValue(AUTHOR.FIRST_NAME);
            String lastName = r.getValue(AUTHOR.LAST_NAME);

            System.out.println("ID: " + id + " first name: " + firstName + " last name: " + lastName);
        }
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:hellokoding,项目名称:jooq-mysql,代码行数:24,代码来源:Application.java

示例4: populateEnv

import org.jooq.Record; //导入方法依赖的package包/类
private void populateEnv(Environment env, Connection conn) {
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    Result<Record> envAttributes = create.select().from(CM_CI_ATTRIBUTES)
            .join(MD_CLASS_ATTRIBUTES).on(CM_CI_ATTRIBUTES.ATTRIBUTE_ID.eq(MD_CLASS_ATTRIBUTES.ATTRIBUTE_ID))
            .where(CM_CI_ATTRIBUTES.CI_ID.eq(env.getId()))
            .fetch();
    for (Record attrib : envAttributes) {
        String attributeName = attrib.getValue(MD_CLASS_ATTRIBUTES.ATTRIBUTE_NAME);
        if (attributeName.equalsIgnoreCase("profile")) {
            env.setProfile(attrib.getValue(CM_CI_ATTRIBUTES.DF_ATTRIBUTE_VALUE));
        }
        //add other attributes as and when needed
    }
    //now query all the platforms for this env
    Result<Record> platformRels = create.select().from(CM_CI_RELATIONS)
            .join(MD_RELATIONS).on(MD_RELATIONS.RELATION_ID.eq(CM_CI_RELATIONS.RELATION_ID))
            .join(CM_CI).on(CM_CI.CI_ID.eq(CM_CI_RELATIONS.TO_CI_ID))
            .where(MD_RELATIONS.RELATION_NAME.eq("manifest.ComposedOf"))
            .and(CM_CI_RELATIONS.FROM_CI_ID.eq(env.getId()))
            .fetch();
    for (Record platformRel : platformRels) {
        long platformId = platformRel.getValue(CM_CI_RELATIONS.TO_CI_ID);
        Platform platform = new Platform();
        platform.setId(platformId);
        platform.setName(platformRel.getValue(CM_CI.CI_NAME));
        platform.setPath(env.getPath() + "/" + env.getName() + "/bom/" + platform.getName() + "/1");
        populatePlatform(conn, platform);
        platform.setActiveClouds(getActiveClouds(platform, conn));

        //now calculate total cores of the env - including all platforms
        env.setTotalCores(env.getTotalCores() + platform.getTotalCores());
        env.addPlatform(platform);
    }
}
 
开发者ID:oneops,项目名称:oneops,代码行数:35,代码来源:CMSCrawler.java

示例5: populatePlatform

import org.jooq.Record; //导入方法依赖的package包/类
private void populatePlatform(Connection conn, Platform platform) {
    DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);
    Result<Record> computes = create.select().from(CM_CI)
            .join(NS_NAMESPACES).on(NS_NAMESPACES.NS_ID.eq(CM_CI.NS_ID))
            .join(CM_CI_ATTRIBUTES).on(CM_CI_ATTRIBUTES.CI_ID.eq(CM_CI.CI_ID))
            .where(NS_NAMESPACES.NS_PATH.eq(platform.getPath())
            .and(CM_CI.CLASS_ID.in(computeClassIds))
            .and(CM_CI_ATTRIBUTES.ATTRIBUTE_ID.in(coresAttributeIds)))
            .fetch();

    platform.setTotalComputes(computes.size());
    int totalCores = 0;
    if (platform.getTotalComputes() > 0) {
        for (Record compute : computes) {
            totalCores += Integer.parseInt(compute.get(CM_CI_ATTRIBUTES.DF_ATTRIBUTE_VALUE));
        }
    }
    platform.setTotalCores(totalCores);

    //Now query platform ci attributes and set to the object
    Result<Record> platformAttributes = create.select().from(CM_CI_ATTRIBUTES)
            .join(MD_CLASS_ATTRIBUTES).on(MD_CLASS_ATTRIBUTES.ATTRIBUTE_ID.eq(CM_CI_ATTRIBUTES.ATTRIBUTE_ID))
            .where(CM_CI_ATTRIBUTES.CI_ID.eq(platform.getId()))
            .fetch();

    for ( Record attribute : platformAttributes ) {
        String attributeName = attribute.getValue(MD_CLASS_ATTRIBUTES.ATTRIBUTE_NAME);
        if (attributeName.equalsIgnoreCase("source")) {
            platform.setSource(attribute.getValue(CM_CI_ATTRIBUTES.DF_ATTRIBUTE_VALUE));
        } else if (attributeName.equalsIgnoreCase("pack")) {
            platform.setPack(attribute.getValue(CM_CI_ATTRIBUTES.DF_ATTRIBUTE_VALUE));
        }
    }
}
 
开发者ID:oneops,项目名称:oneops,代码行数:35,代码来源:CMSCrawler.java

示例6: convertMap

import org.jooq.Record; //导入方法依赖的package包/类
public static Map<String, Object> convertMap(Record record) {
	if (record == null) {
		return null;
	}
	int n = record.fields().length;
	Map<String, Object> reMap = new LinkedHashMap<String, Object>();
	for (int i = 0; i < n; i++) {
		String kn = record.field(i).getName().toString();
		Object kv = record.getValue(record.field(i));
		reMap.put(kn, matchJavaValue(kv));
	}
	return reMap;
}
 
开发者ID:SmallBadFish,项目名称:practice,代码行数:14,代码来源:DSLUtility.java

示例7: converMap

import org.jooq.Record; //导入方法依赖的package包/类
private Map<String, Object> converMap(Record record) {
	if (record == null)
		return null;
	int n = record.fields().length;
	Map<String, Object> reMap = new LinkedHashMap<String, Object>();
	for (int i = 0; i < n; i++) {
		String kn = record.field(i).getName().toString();
		// String kn = SystemUtility.firstLower(record.field(i).getName());
		Object kv = record.getValue(record.field(i));
		reMap.put(kn, kv);
	}
	return reMap;
}
 
开发者ID:SmallBadFish,项目名称:practice,代码行数:14,代码来源:JooqMysqlProvider.java

示例8: endpoint

import org.jooq.Record; //导入方法依赖的package包/类
private Endpoint endpoint(Record a) {
  String serviceName = a.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME);
  if (serviceName == null) return null;
  return Endpoint.builder()
      .serviceName(serviceName)
      .port(a.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_PORT))
      .ipv4(a.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_IPV4))
      .ipv6(hasIpv6.get() ? a.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_IPV6) : null).build();
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:10,代码来源:MySQLSpanStore.java

示例9: writePatientData

import org.jooq.Record; //导入方法依赖的package包/类
private int writePatientData(@NotNull final PatientData patient) {
    final Record patientRecord = context.select(PATIENT.ID).from(PATIENT).where(PATIENT.CPCTID.eq(patient.cpctId())).fetchOne();
    if (patientRecord != null) {
        return patientRecord.getValue(PATIENT.ID);
    } else {
        final int patientId = context.insertInto(PATIENT,
                PATIENT.CPCTID,
                PATIENT.REGISTRATIONDATE,
                PATIENT.GENDER,
                PATIENT.HOSPITAL,
                PATIENT.BIRTHYEAR,
                PATIENT.CANCERTYPE,
                PATIENT.CANCERSUBTYPE,
                PATIENT.DEATHDATE)
                .values(patient.cpctId(),
                        Utils.toSQLDate(patient.registrationDate()),
                        patient.gender(),
                        patient.hospital(),
                        patient.birthYear(),
                        patient.primaryTumorLocation().category(),
                        patient.primaryTumorLocation().subcategory(),
                        Utils.toSQLDate(patient.deathDate()))
                .returning(PATIENT.ID)
                .fetchOne()
                .getValue(PATIENT.ID);
        writeFormStatus(patientId, PATIENT.getName(), "demography", patient.demographyStatus().stateString(),
                Boolean.toString(patient.demographyLocked()));
        writeFormStatus(patientId, PATIENT.getName(), "primaryTumor", patient.primaryTumorStatus().stateString(),
                Boolean.toString(patient.primaryTumorLocked()));
        writeFormStatus(patientId, PATIENT.getName(), "eligibility", patient.eligibilityStatus().stateString(),
                Boolean.toString(patient.eligibilityLocked()));
        writeFormStatus(patientId, PATIENT.getName(), "selectionCriteria", patient.selectionCriteriaStatus().stateString(),
                Boolean.toString(patient.selectionCriteriaLocked()));
        writeFormStatus(patientId, PATIENT.getName(), "death", patient.deathStatus().stateString(),
                Boolean.toString(patient.deathLocked()));
        return patientId;
    }
}
 
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:39,代码来源:ClinicalDAO.java

示例10: jooqFetch

import org.jooq.Record; //导入方法依赖的package包/类
private void jooqFetch() {
	Result<Record> results = this.dsl.select().from(AUTHOR).fetch();
	for (Record result : results) {
		Integer id = result.getValue(AUTHOR.ID);
		String firstName = result.getValue(AUTHOR.FIRST_NAME);
		String lastName = result.getValue(AUTHOR.LAST_NAME);
		System.out.println("jOOQ Fetch " + id + " " + firstName + " " + lastName);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:JooqExamples.java

示例11: main

import org.jooq.Record; //导入方法依赖的package包/类
public static void main(String[] args) {
//        HikariConfig config = new HikariConfig();
//        config.setJdbcUrl("jdbc:mysql://localhost:3306/library");
//        config.setUsername("root");
//        config.setPassword("sddsds");
//        config.addDataSourceProperty("cachePrepStmts", "true");
//        config.addDataSourceProperty("prepStmtCacheSize", "250");
//        config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
        DataSource ds = DbConnectionPool.getConnection();
//        HikariDataSource ds = new HikariDataSource(config);
//        String userName = "root";
//        String password = "minjar";
//        String url = "jdbc:mysql://localhost:3306/library";

        // Connection is the only JDBC resource that we need
        // PreparedStatement and ResultSet are handled by jOOQ, internally
        try (DSLContext create = DSL.using(ds, SQLDialect.MYSQL)) {
            Result<Record> result = create.select().from(AUTHOR).fetch();
            for (Record r : result) {
                Integer id = r.getValue(AUTHOR.ID);
                String firstName = r.getValue(AUTHOR.FIRST_NAME);
                String lastName = r.getValue(AUTHOR.LAST_NAME);

                System.out.println("ID: " + id + " first name: " + firstName + " last name: " + lastName);
            }
//            create.select().from(AUTHOR).where(AUTHOR.ID.equal(1));

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
开发者ID:skyrocknroll,项目名称:jooq-test,代码行数:32,代码来源:JooqTest.java

示例12: getUser

import org.jooq.Record; //导入方法依赖的package包/类
public Users getUser(String spotifyId) {
    Record userRecord = myQuery.select().from(USERS).where(USERS.SPOTIFY_ID.equal(spotifyId)).fetchOne();
    Users user = new Users(
            userRecord.getValue(USERS.SPOTIFY_ID),
            userRecord.getValue(USERS.EMAIL),
            userRecord.getValue(USERS.AUTHORIZATION_CODE),
            userRecord.getValue(USERS.REFRESH_TOKEN),
            userRecord.getValue(USERS.ACCESS_TOKEN),
            userRecord.getValue(USERS.EXPIRATION));
    return user;
}
 
开发者ID:jiaweizhang,项目名称:spotify-pull-requests,代码行数:12,代码来源:AuthAccessor.java

示例13: returnRequests

import org.jooq.Record; //导入方法依赖的package包/类
public List<Request> returnRequests(String playlistId) {
    List<Request> requestList = new ArrayList<Request>();
    Result<Record> returnedRequests = myQuery.select().from(REQUESTS).where(REQUESTS.PLAYLIST_ID.equal(playlistId)).fetch();
    for (Record record : returnedRequests) {
        int id = record.getValue(REQUESTS.REQUEST_ID);
        String listId = record.getValue(REQUESTS.PLAYLIST_ID);
        String spotifyId = record.getValue(REQUESTS.SPOTIFY_ID);
        String songId = record.getValue(REQUESTS.SONG_ID);
        Request request = new Request(id, listId, spotifyId, songId);
        requestList.add(request);
    }
    return requestList;
}
 
开发者ID:jiaweizhang,项目名称:spotify-pull-requests,代码行数:14,代码来源:RequestAccessor.java


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