org.jooq.Table Java Examples

The following examples show how to use org.jooq.Table. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractAsyncVertxDAO.java    From vertx-jooq with MIT License 6 votes vote down vote up
@SuppressWarnings("unchecked")
protected AbstractAsyncVertxDAO(Table<R> table, Class<P> type, QueryExecutor<R, T, FIND_MANY, FIND_ONE, EXECUTE, INSERT_RETURNING> queryExecutor) {
    super(table, type, queryExecutor);
    Arguments.require(isMysql(queryExecutor.configuration()) || isPostgres(queryExecutor.configuration()),"Only Postgres and MySQL supported");
    if(isMysql(queryExecutor.configuration())){
        keyConverter = keyConverter();
    }else{
        keyConverter = o -> {
            JsonArray j = (JsonArray) o;
            int pkLength = getTable().getPrimaryKey().getFieldsArray().length;
            if(pkLength == 1){
                return (T)j.getValue(0);
            }
            Object[] values = new Object[j.size()];
            for(int i=0;i<j.size();i++){
                values[i] = j.getValue(i);
            }
            return compositeKeyRecord(values);
        };
    }
}
 
Example #2
Source File: Vertx.java    From vertx-jooq with MIT License 5 votes vote down vote up
@Override
public final List<Table<?>> getTables() {
    return Arrays.<Table<?>>asList(
        Something.SOMETHING,
        Somethingcomposite.SOMETHINGCOMPOSITE,
        Somethingwithoutjson.SOMETHINGWITHOUTJSON);
}
 
Example #3
Source File: Vertx.java    From vertx-jooq with MIT License 5 votes vote down vote up
@Override
public final List<Table<?>> getTables() {
    return Arrays.<Table<?>>asList(
        Something.SOMETHING,
        Somethingcomposite.SOMETHINGCOMPOSITE,
        Somethingwithoutjson.SOMETHINGWITHOUTJSON);
}
 
Example #4
Source File: SjCms.java    From StubbornJava with MIT License 5 votes vote down vote up
private final List<Table<?>> getTables0() {
    return Arrays.<Table<?>>asList(
        AppTable.APP,
        PostTable.POST,
        PostTagTable.POST_TAG,
        PostTagLinksTable.POST_TAG_LINKS,
        UserTable.USER,
        _FlywayTable._FLYWAY);
}
 
Example #5
Source File: Vertx.java    From vertx-jooq with MIT License 5 votes vote down vote up
@Override
public final List<Table<?>> getTables() {
    return Arrays.<Table<?>>asList(
        Something.SOMETHING,
        Somethingcomposite.SOMETHINGCOMPOSITE,
        Somethingwithoutjson.SOMETHINGWITHOUTJSON);
}
 
Example #6
Source File: Vertx.java    From vertx-jooq with MIT License 5 votes vote down vote up
@Override
public final List<Table<?>> getTables() {
    return Arrays.<Table<?>>asList(
        Something.SOMETHING,
        Somethingcomposite.SOMETHINGCOMPOSITE,
        Somethingwithoutjson.SOMETHINGWITHOUTJSON);
}
 
Example #7
Source File: ReflectedTable.java    From java-crud-api with MIT License 5 votes vote down vote up
private TableField<?, ?> findPrimaryKey(Table<?> table) {
	UniqueKey<?> pk = table.getPrimaryKey();
	if (pk != null) {
		TableField<?, ?>[] pks = pk.getFieldsArray();
		if (pks.length == 1) {
			return pks[0];
		}
	}
	return null;
}
 
Example #8
Source File: PropertyResolver.java    From FROST-Server with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Get the set of expressions for the given set of selected properties.
 *
 * @param table The entity table to get the expressions for.
 * @param selectedProperties The set of properties to get the expressions
 * of.
 * @return The set of expressions.
 */
public Set<Field> getFieldsForProperties(Table table, Set<Property> selectedProperties) {
    Set<Field> exprSet = new HashSet<>();
    if (selectedProperties.isEmpty()) {
        getSelectFieldsForClass(table, exprSet);
    } else {
        for (Property property : selectedProperties) {
            getSelectFieldsForProperty(property, table, exprSet);
        }
    }
    return exprSet;
}
 
Example #9
Source File: Somethingwithoutjson.java    From vertx-jooq with MIT License 4 votes vote down vote up
private Somethingwithoutjson(Name alias, Table<SomethingwithoutjsonRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
}
 
Example #10
Source File: Something.java    From vertx-jooq with MIT License 4 votes vote down vote up
public <O extends Record> Something(Table<O> child, ForeignKey<O, SomethingRecord> key) {
    super(child, key, SOMETHING);
}
 
Example #11
Source File: Landmark.java    From curiostack with MIT License 4 votes vote down vote up
private Landmark(Name alias, Table<LandmarkRecord> aliased) {
    this(alias, aliased, null);
}
 
Example #12
Source File: SeqRegionAttrib.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
private SeqRegionAttrib(String alias, Table<SeqRegionAttribRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}
 
Example #13
Source File: Somethingwithoutjson.java    From vertx-jooq with MIT License 4 votes vote down vote up
private Somethingwithoutjson(Name alias, Table<SomethingwithoutjsonRecord> aliased) {
    this(alias, aliased, null);
}
 
Example #14
Source File: Labels.java    From SimpleFlatMapper with MIT License 4 votes vote down vote up
public Labels rename(String name) {
    return new Labels(DSL.name(name), (Table)null);
}
 
Example #15
Source File: RepeatConsensus.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
private RepeatConsensus(String alias, Table<RepeatConsensusRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}
 
Example #16
Source File: PostTagTable.java    From StubbornJava with MIT License 4 votes vote down vote up
private PostTagTable(Name alias, Table<PostTagRecord> aliased) {
    this(alias, aliased, null);
}
 
Example #17
Source File: PostTagLinksTable.java    From StubbornJava with MIT License 4 votes vote down vote up
private PostTagLinksTable(Name alias, Table<PostTagLinksRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}
 
Example #18
Source File: Book.java    From SimpleFlatMapper with MIT License 4 votes vote down vote up
private Book(Name alias, Table<BookRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, DSL.comment(""));
}
 
Example #19
Source File: QueryState.java    From FROST-Server with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * @return the sqlFrom
 */
public Table<Record> getSqlFrom() {
    return sqlFrom;
}
 
Example #20
Source File: Somethingwithoutjson.java    From vertx-jooq with MIT License 4 votes vote down vote up
public <O extends Record> Somethingwithoutjson(Table<O> child, ForeignKey<O, SomethingwithoutjsonRecord> key) {
    super(child, key, SOMETHINGWITHOUTJSON);
}
 
Example #21
Source File: SeqRegion.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
private SeqRegion(String alias, Table<SeqRegionRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}
 
Example #22
Source File: PredictionExon.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
private PredictionExon(String alias, Table<PredictionExonRecord> aliased) {
    this(alias, aliased, null);
}
 
Example #23
Source File: CmNsOpt.java    From oneops with Apache License 2.0 4 votes vote down vote up
private CmNsOpt(Name alias, Table<CmNsOptRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}
 
Example #24
Source File: Landmark.java    From curiostack with MIT License 4 votes vote down vote up
private Landmark(Name alias, Table<LandmarkRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, DSL.comment(""));
}
 
Example #25
Source File: Something.java    From vertx-jooq with MIT License 4 votes vote down vote up
private Something(Name alias, Table<SomethingRecord> aliased) {
    this(alias, aliased, null);
}
 
Example #26
Source File: Somethingcomposite.java    From vertx-jooq with MIT License 4 votes vote down vote up
public <O extends Record> Somethingcomposite(Table<O> child, ForeignKey<O, SomethingcompositeRecord> key) {
    super(child, key, SOMETHINGCOMPOSITE);
}
 
Example #27
Source File: Kloopzcm.java    From oneops with Apache License 2.0 4 votes vote down vote up
@Override
public final List<Table<?>> getTables() {
    List result = new ArrayList();
    result.addAll(getTables0());
    return result;
}
 
Example #28
Source File: CmCi.java    From oneops with Apache License 2.0 4 votes vote down vote up
private CmCi(Name alias, Table<CmCiRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}
 
Example #29
Source File: ExternalSynonym.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
private ExternalSynonym(String alias, Table<ExternalSynonymRecord> aliased) {
    this(alias, aliased, null);
}
 
Example #30
Source File: Assembly.java    From hmftools with GNU General Public License v3.0 4 votes vote down vote up
private Assembly(String alias, Table<AssemblyRecord> aliased, Field<?>[] parameters) {
    super(alias, null, aliased, parameters, "");
}