![JAR search and dependency download from the Maven repository](/logo.png)
com.samskivert.depot.clause.InsertClause Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of depot Show documentation
Show all versions of depot Show documentation
A library for relational-database-based persistence in Java.
The newest version!
//
// Depot library - a Java relational persistence library
// https://github.com/threerings/depot/blob/master/LICENSE
package com.samskivert.depot.clause;
import java.util.Collection;
import java.util.Set;
import com.samskivert.depot.PersistentRecord;
import com.samskivert.depot.impl.FragmentVisitor;
/**
* Builds actual SQL given a main persistent type and some {@link QueryClause} objects.
*/
public class InsertClause implements QueryClause
{
public InsertClause (Class extends PersistentRecord> pClass, Object pojo,
Set identityFields)
{
_pClass = pClass;
_pojo = pojo;
_idFields = identityFields;
}
public Class extends PersistentRecord> getPersistentClass ()
{
return _pClass;
}
public Object getPojo ()
{
return _pojo;
}
public Set getIdentityFields ()
{
return _idFields;
}
// from SQLExpression
public void addClasses (Collection> classSet)
{
classSet.add(_pClass);
// If we add SQLExpression[] values INSERT, remember to recurse into them here.
}
// from SQLExpression
public Object accept (FragmentVisitor> builder)
{
return builder.visit(this);
}
protected Class extends PersistentRecord> _pClass;
/** The object from which to fetch values, or null. */
protected Object _pojo;
protected Set _idFields;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy