
com.wadpam.oauth2.dao.GeneratedDFactoryDaoImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oauth2-client Show documentation
Show all versions of oauth2-client Show documentation
Implements OAuth2 authentication on top of Open-Server security
The newest version!
package com.wadpam.oauth2.dao;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import net.sf.mardao.core.CursorPage;
import net.sf.mardao.core.Filter;
import net.sf.mardao.core.dao.DaoImpl;
import net.sf.mardao.core.dao.TypeDaoImpl;
import net.sf.mardao.core.geo.DLocation;
import com.wadpam.oauth2.domain.DFactory;
/**
* The DFactory domain-object specific finders and methods go in this POJO.
*
* Generated on 2013-07-25T10:05:08.359+0700.
* @author mardao DAO generator (net.sf.mardao.plugin.ProcessDomainMojo)
*/
public class GeneratedDFactoryDaoImpl extends TypeDaoImpl
implements GeneratedDFactoryDao {
/** to list the property names for ManyToOne relations */
@Override
protected List getBasicColumnNames() {
return BASIC_NAMES;
}
/** to list the property names for ManyToOne relations */
@Override
protected List getManyToOneColumnNames() {
return MANY_TO_ONE_NAMES;
}
private final Map MANY_TO_ONE_DAOS = new TreeMap();
/** Default constructor */
public GeneratedDFactoryDaoImpl() {
super(DFactory.class, java.lang.String.class);
}
// ------ BEGIN DaoImpl overrides -----------------------------
public String getPrimaryKeyColumnName() {
return COLUMN_NAME_ID;
}
public List getColumnNames() {
return COLUMN_NAMES;
}
@Override
protected DaoImpl getManyToOneDao(String columnName) {
return MANY_TO_ONE_DAOS.get(columnName);
}
@Override
protected Object getDomainProperty(DFactory domain, String name) {
Object value;
// simple key?
if (COLUMN_NAME_ID.equals(name)) {
value = domain.getId();
}
// fields
else if (COLUMN_NAME_BASEURL.equals(name)) {
value = domain.getBaseUrl();
}
else if (COLUMN_NAME_CLIENTID.equals(name)) {
value = domain.getClientId();
}
else if (COLUMN_NAME_CLIENTSECRET.equals(name)) {
value = domain.getClientSecret();
}
else if (COLUMN_NAME_CREATEDBY.equals(name)) {
value = domain.getCreatedBy();
}
else if (COLUMN_NAME_CREATEDDATE.equals(name)) {
value = domain.getCreatedDate();
}
else if (COLUMN_NAME_UPDATEDBY.equals(name)) {
value = domain.getUpdatedBy();
}
else if (COLUMN_NAME_UPDATEDDATE.equals(name)) {
value = domain.getUpdatedDate();
}
// one-to-ones
// many-to-ones
// many-to-manys
else {
value = super.getDomainProperty(domain, name);
}
return value;
}
/**
* Returns the class of the domain property for specified column
* @param name
* @return the class of the domain property
*/
public Class getColumnClass(String name) {
Class clazz;
// simple key?
if (COLUMN_NAME_ID.equals(name)) {
clazz = java.lang.String.class;
}
// fields
else if (COLUMN_NAME_BASEURL.equals(name)) {
clazz = java.lang.String.class;
}
else if (COLUMN_NAME_CLIENTID.equals(name)) {
clazz = java.lang.String.class;
}
else if (COLUMN_NAME_CLIENTSECRET.equals(name)) {
clazz = java.lang.String.class;
}
else if (COLUMN_NAME_CREATEDBY.equals(name)) {
clazz = java.lang.String.class;
}
else if (COLUMN_NAME_CREATEDDATE.equals(name)) {
clazz = java.util.Date.class;
}
else if (COLUMN_NAME_UPDATEDBY.equals(name)) {
clazz = java.lang.String.class;
}
else if (COLUMN_NAME_UPDATEDDATE.equals(name)) {
clazz = java.util.Date.class;
}
// one-to-ones
// many-to-ones
// many-to-manys
else {
throw new IllegalArgumentException("No such column " + name);
}
return clazz;
}
@Override
protected void setDomainProperty(final DFactory domain, final String name, final Object value) {
// simple key?
if (COLUMN_NAME_ID.equals(name)) {
domain.setId((java.lang.String) value);
}
// fields
else if (COLUMN_NAME_BASEURL.equals(name)) {
domain.setBaseUrl((java.lang.String) value);
}
else if (COLUMN_NAME_CLIENTID.equals(name)) {
domain.setClientId((java.lang.String) value);
}
else if (COLUMN_NAME_CLIENTSECRET.equals(name)) {
domain.setClientSecret((java.lang.String) value);
}
else if (COLUMN_NAME_CREATEDBY.equals(name)) {
domain.setCreatedBy((java.lang.String) value);
}
else if (COLUMN_NAME_CREATEDDATE.equals(name)) {
domain.setCreatedDate((java.util.Date) value);
}
else if (COLUMN_NAME_UPDATEDBY.equals(name)) {
domain.setUpdatedBy((java.lang.String) value);
}
else if (COLUMN_NAME_UPDATEDDATE.equals(name)) {
domain.setUpdatedDate((java.util.Date) value);
}
// one-to-ones
// many-to-ones
// many-to-manys
else {
super.setDomainProperty(domain, name, value);
}
}
@Override
protected void setDomainStringProperty(final DFactory domain, final String name, final Map properties) {
final String value = properties.get(name);
Class clazz = getColumnClass(name);
// many-to-ones
setDomainProperty(domain, name, parseProperty(value, clazz));
}
/**
* Overrides to substitute Entity properties with foreign keys
*/
@Override
protected void setCoreProperty(Object core, String name, Object value) {
if (null == core || null == name) {
return;
}
else if (null == value) {
// do nothing in particular, will call super at end
}
super.setCoreProperty(core, name, value);
}
// ------ END DaoImpl overrides -----------------------------
// DFactory has no parent
/**
* @return the simple key for specified DFactory domain object
*/
public String getSimpleKey(DFactory domain) {
if (null == domain) {
return null;
}
return domain.getId();
}
/**
* @return the simple key for specified DFactory domain object
*/
public void setSimpleKey(DFactory domain, String id) {
domain.setId(id);
}
public String getCreatedByColumnName() {
return COLUMN_NAME_CREATEDBY;
}
public String getCreatedBy(DFactory domain) {
if (null == domain) {
return null;
}
return domain.getCreatedBy();
}
public void _setCreatedBy(DFactory domain, String creator) {
domain.setCreatedBy(creator);
}
public String getUpdatedByColumnName() {
return COLUMN_NAME_UPDATEDBY;
}
public String getUpdatedBy(DFactory domain) {
if (null == domain) {
return null;
}
return domain.getUpdatedBy();
}
public void _setUpdatedBy(DFactory domain, String updator) {
domain.setUpdatedBy(updator);
}
public String getCreatedDateColumnName() {
return COLUMN_NAME_CREATEDDATE;
}
public Date getCreatedDate(DFactory domain) {
if (null == domain) {
return null;
}
return domain.getCreatedDate();
}
public void _setCreatedDate(DFactory domain, Date date) {
domain.setCreatedDate(date);
}
public String getUpdatedDateColumnName() {
return COLUMN_NAME_UPDATEDDATE;
}
public Date getUpdatedDate(DFactory domain) {
if (null == domain) {
return null;
}
return domain.getUpdatedDate();
}
public void _setUpdatedDate(DFactory domain, Date date) {
domain.setUpdatedDate(date);
}
// ----------------------- field finders -------------------------------
/**
* {@inheritDoc}
*/
public final Iterable queryByBaseUrl(java.lang.String baseUrl) {
final Filter filter = createEqualsFilter(COLUMN_NAME_BASEURL, baseUrl);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field baseUrl
* @param baseUrl the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByBaseUrl(java.lang.String baseUrl) {
final Filter filter = createEqualsFilter(COLUMN_NAME_BASEURL, baseUrl);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field baseUrl
* @param baseUrl the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified baseUrl
*/
public final CursorPage queryPageByBaseUrl(java.lang.String baseUrl,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_BASEURL, baseUrl);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
/**
* {@inheritDoc}
*/
public final Iterable queryByClientId(java.lang.String clientId) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CLIENTID, clientId);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field clientId
* @param clientId the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByClientId(java.lang.String clientId) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CLIENTID, clientId);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field clientId
* @param clientId the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified clientId
*/
public final CursorPage queryPageByClientId(java.lang.String clientId,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CLIENTID, clientId);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
/**
* {@inheritDoc}
*/
public final Iterable queryByClientSecret(java.lang.String clientSecret) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CLIENTSECRET, clientSecret);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field clientSecret
* @param clientSecret the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByClientSecret(java.lang.String clientSecret) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CLIENTSECRET, clientSecret);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field clientSecret
* @param clientSecret the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified clientSecret
*/
public final CursorPage queryPageByClientSecret(java.lang.String clientSecret,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CLIENTSECRET, clientSecret);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
/**
* {@inheritDoc}
*/
public final Iterable queryByCreatedBy(java.lang.String createdBy) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CREATEDBY, createdBy);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field createdBy
* @param createdBy the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByCreatedBy(java.lang.String createdBy) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CREATEDBY, createdBy);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field createdBy
* @param createdBy the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified createdBy
*/
public final CursorPage queryPageByCreatedBy(java.lang.String createdBy,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CREATEDBY, createdBy);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
/**
* {@inheritDoc}
*/
public final Iterable queryByCreatedDate(java.util.Date createdDate) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CREATEDDATE, createdDate);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field createdDate
* @param createdDate the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByCreatedDate(java.util.Date createdDate) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CREATEDDATE, createdDate);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field createdDate
* @param createdDate the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified createdDate
*/
public final CursorPage queryPageByCreatedDate(java.util.Date createdDate,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_CREATEDDATE, createdDate);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
/**
* {@inheritDoc}
*/
public final Iterable queryByUpdatedBy(java.lang.String updatedBy) {
final Filter filter = createEqualsFilter(COLUMN_NAME_UPDATEDBY, updatedBy);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field updatedBy
* @param updatedBy the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByUpdatedBy(java.lang.String updatedBy) {
final Filter filter = createEqualsFilter(COLUMN_NAME_UPDATEDBY, updatedBy);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field updatedBy
* @param updatedBy the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified updatedBy
*/
public final CursorPage queryPageByUpdatedBy(java.lang.String updatedBy,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_UPDATEDBY, updatedBy);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
/**
* {@inheritDoc}
*/
public final Iterable queryByUpdatedDate(java.util.Date updatedDate) {
final Filter filter = createEqualsFilter(COLUMN_NAME_UPDATEDDATE, updatedDate);
return queryIterable(false, 0, -1, null, null, null, false, null, false, filter);
}
/**
* query-key-by method for attribute field updatedDate
* @param updatedDate the specified attribute
* @return an Iterable of keys to the DFactorys with the specified attribute
*/
public final Iterable queryKeysByUpdatedDate(java.util.Date updatedDate) {
final Filter filter = createEqualsFilter(COLUMN_NAME_UPDATEDDATE, updatedDate);
return queryIterableKeys(0, -1, null, null, null, false, null, false, filter);
}
/**
* query-page-by method for field updatedDate
* @param updatedDate the specified attribute
* @param pageSize the number of domain entities in the page
* @param cursorString non-null if get next page
* @return a Page of DFactorys for the specified updatedDate
*/
public final CursorPage queryPageByUpdatedDate(java.util.Date updatedDate,
int pageSize, String cursorString) {
final Filter filter = createEqualsFilter(COLUMN_NAME_UPDATEDDATE, updatedDate);
return queryPage(false, pageSize, null, null, null, false, null, false, cursorString, filter);
}
// ----------------------- one-to-one finders -------------------------
// ----------------------- many-to-one finders -------------------------
// ----------------------- many-to-many finders -------------------------
// ----------------------- uniqueFields finders -------------------------
// ----------------------- populate / persist method -------------------------
/**
* Persist an entity given all attributes
*/
public DFactory persist( java.lang.String id,
java.lang.String baseUrl,
java.lang.String clientId,
java.lang.String clientSecret) {
DFactory domain = null;
// if primaryKey specified, use it
if (null != id) {
domain = findByPrimaryKey(id);
}
// create new?
if (null == domain) {
domain = new DFactory();
// generate Id?
if (null != id) {
domain.setId(id);
}
// fields
domain.setBaseUrl(baseUrl);
domain.setClientId(clientId);
domain.setClientSecret(clientSecret);
// one-to-ones
// many-to-ones
persist(domain);
}
return domain;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy