public class Formula2SQL extends Object
Constructor and Description |
---|
Formula2SQL(Set<Variable> projection,
RDBMSDatabase database)
Convert a formula to a query that will fetch all possible combinations of constants used in that
formual (aka grounding).
|
Formula2SQL(Set<Variable> projection,
RDBMSDatabase database,
boolean isDistinct)
See above description.
|
Formula2SQL(Set<Variable> projection,
RDBMSDatabase database,
boolean isDistinct,
Atom lazyTarget)
See above description.
|
Modifier and Type | Method and Description |
---|---|
List<Atom> |
getFunctionalAtoms() |
Map<Variable,Integer> |
getProjectionMap() |
com.healthmarketscience.sqlbuilder.SelectQuery |
getQuery(Formula formula) |
String |
getSQL(Formula formula) |
Map<Atom,String> |
getTableAliases() |
public Formula2SQL(Set<Variable> projection, RDBMSDatabase database)
projection
- the collection of variables (columns) to return (the variable's name will be used
as the column alias). If not set, all columns (*) will be retutned.database
- the database to query over. The read and write partitions will be picked up from here.public Formula2SQL(Set<Variable> projection, RDBMSDatabase database, boolean isDistinct)
isDistinct
- true if you want to enforce unique results (DISTINCT), false otherwise.
Warning: this can be a costly operation.public Formula2SQL(Set<Variable> projection, RDBMSDatabase database, boolean isDistinct, Atom lazyTarget)
lazyTarget
- if this is non-null, then this formula will be treated as a partial grounding query.
This means that we will treat Partition.LAZY_PARTITION_ID as a valid partition, and this atom
will be exclusivley drawn from Partition.LAZY_PARTITION_ID.
We will do a DIRECT REFERENCE comparison against atoms in the formual to check for this specific one.public com.healthmarketscience.sqlbuilder.SelectQuery getQuery(Formula formula)
Copyright © 2018 University of California, Santa Cruz. All rights reserved.