All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.odysz.semantic.meta.SynchangeBuffMeta Maven / Gradle / Ivy

package io.odysz.semantic.meta;

import io.odysz.common.Utils;
import io.odysz.semantics.meta.Semantation;
import io.odysz.transact.sql.parts.condition.ExprPart;
import io.odysz.transact.sql.parts.condition.Funcall;

/**
 * syn_exchange_buf DDL
 *
 * @author [email protected]
 *
 */
public class SynchangeBuffMeta extends SemanticTableMeta {
	/** Separator in uids, ",", for separating fields of pk */
	@Semantation (noDBExists = true)
	public final String UIDsep;

	public final String peer;
	public final String changeId;

	public final String pagex;

	final SynChangeMeta chm; 

	public SynchangeBuffMeta(SynChangeMeta chm, String ... conn) {
		super("syn_exchange_buf", conn);
		UIDsep = ",";
		ddlSqlite = Utils.loadTxt(SynchangeBuffMeta.class, "syn_exchange_buf.sqlite.ddl");
		this.chm = chm;

		changeId = "changeId";
		peer     = "peer";
		pagex    = "pagex";
	}

	/** compose function for uids */
	public String uids(String synode, String entityId) {
		return synode + UIDsep + entityId;
	}

	public String[] insertCols() {
		return new String[] {peer, changeId, pagex};
	}

	public Object[] selectCols(String peer, int seq) {
		return new Object[] {Funcall.constr(peer), chm.pk, new ExprPart(seq)};
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy