當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。