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

klass.model.meta.domain.AssociationEndDatabaseObjectAbstract Maven / Gradle / Ivy

The newest version!
package klass.model.meta.domain;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.*;
import java.io.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.gs.fw.common.mithra.*;
import com.gs.fw.common.mithra.attribute.*;
import com.gs.fw.common.mithra.util.*;
import com.gs.fw.common.mithra.notification.*;
import com.gs.fw.common.mithra.notification.listener.*;
import com.gs.fw.common.mithra.list.cursor.Cursor;
import com.gs.fw.common.mithra.bulkloader.*;
import java.util.*;
import java.sql.*;
import com.gs.fw.common.mithra.*;
import com.gs.fw.common.mithra.attribute.update.AttributeUpdateWrapper;
import com.gs.fw.common.mithra.bulkloader.BulkLoader;
import com.gs.fw.common.mithra.bulkloader.BulkLoaderException;
import com.gs.fw.common.mithra.cache.*;
import com.gs.fw.common.mithra.cache.offheap.*;
import com.gs.fw.common.mithra.connectionmanager.*;
import com.gs.fw.common.mithra.database.*;
import com.gs.fw.common.mithra.databasetype.*;
import com.gs.fw.common.mithra.finder.*;
import com.gs.fw.common.mithra.finder.orderby.OrderBy;
import com.gs.fw.common.mithra.finder.integer.IntegerResultSetParser;
import com.gs.fw.common.mithra.querycache.CachedQuery;
import com.gs.fw.common.mithra.remote.RemoteMithraService;
import com.gs.fw.common.mithra.transaction.BatchUpdateOperation;
import com.gs.fw.common.mithra.transaction.UpdateOperation;
/**
* This file was automatically generated using Mithra 18.0.0. Please do not modify it.
* Add custom logic to its subclass instead.
*/
public abstract class AssociationEndDatabaseObjectAbstract extends MithraAbstractTransactionalDatabaseObject implements MithraTransactionalDatabaseObject, MithraObjectFactory
{
	private SourcelessConnectionManager connectionManager;
	private SchemaManager schemaManager;
	private TablePartitionManager tablePartitionManager;
	private static final String COL_LIST_WITHOUT_PK = "\"ASSOCIATION_NAME\",\"RESULT_TYPE_NAME\",\"ORDINAL\",\"DIRECTION\",\"MULTIPLICITY\"";
	private static final String COL_LIST_WITHOUT_PK_WITH_ALIAS = "t0.\"ASSOCIATION_NAME\",t0.\"RESULT_TYPE_NAME\",t0.\"ORDINAL\",t0.\"DIRECTION\",t0.\"MULTIPLICITY\"";
	private static final String PK_WITH_ALIAS = "t0.\"OWNING_CLASS_NAME\" = ? AND t0.\"NAME\" = ?";
	private static final String PK_INDEX_COLS = "\"OWNING_CLASS_NAME\",\"NAME\"";
	protected AssociationEndDatabaseObjectAbstract()
	{
		super("AssociationEnd", "klass.model.meta.domain.AssociationEndFinder",
			7, 7,
			COL_LIST_WITHOUT_PK, COL_LIST_WITHOUT_PK_WITH_ALIAS,
			false, false, false,
			PK_WITH_ALIAS,
			PK_INDEX_COLS);
	}

	public MithraObjectPortal getMithraObjectPortal()
	{
		return AssociationEndFinder.getMithraObjectPortal();
	}

	public RelatedFinder getFinder()
	{
		return AssociationEndFinder.getFinderInstance();
	}

	public static AssociationEndData allocateOnHeapData()
	{
		return new AssociationEndData();
	}

	public static AssociationEndData allocateOffHeapData()
	{
		throw new RuntimeException("no off heap implementation");
	}

	public MithraDataObject deserializeFullData(ObjectInput in) throws IOException, ClassNotFoundException
	{
		MithraDataObject data = new AssociationEndData();
		data.zDeserializeFullData(in);
		return data;
	}

	public MithraObject deserializeForRefresh(ObjectInput in) throws IOException, ClassNotFoundException
	{
		AssociationEndData data = new AssociationEndData();
		data.zDeserializePrimaryKey(in);
		return this.createObject(data);
	}

	public Cache instantiateFullCache(MithraConfigurationManager.Config config)
	{
		Cache result;
		if (config.isParticipatingInTx())
		{
			result = new FullNonDatedTransactionalCache(AssociationEndFinder.getPrimaryKeyAttributes(), this, AssociationEndFinder.getImmutableAttributes());
		}
		else
		{
			result = new FullNonDatedCache(AssociationEndFinder.getPrimaryKeyAttributes(), this, AssociationEndFinder.getImmutableAttributes(), new NonTransactionalUnderlyingObjectGetter());
		}

		initPortal(result, config);
		return result;
	}

	public Cache instantiatePartialCache(MithraConfigurationManager.Config config)
	{
		Cache result;
		if (config.isParticipatingInTx())
		{
			result = new PartialNonDatedTransactionalCache(AssociationEndFinder.getPrimaryKeyAttributes(), this, AssociationEndFinder.getImmutableAttributes(), config.getCacheTimeToLive(), config.getRelationshipCacheTimeToLive());
		}
		else
		{
			result = new PartialNonDatedCache(AssociationEndFinder.getPrimaryKeyAttributes(), this, AssociationEndFinder.getImmutableAttributes(), new NonTransactionalUnderlyingObjectGetter(), config.getCacheTimeToLive(), config.getRelationshipCacheTimeToLive());
		}

		initPortal(result, config);
		return result;
	}

	private void initPortal(Cache cache, MithraConfigurationManager.Config config)
	{
		if (config.isThreeTierClient())
		{
			AssociationEndFinder.initializeClientPortal(this, cache, config);
		}
		else
		{
			AssociationEndFinder.initializePortal(this, cache, config);
		}

		if (config.isParticipatingInTx())
		{
			AssociationEnd.zConfigFullTx();
		}
		else
		{
			AssociationEnd.zConfigNonTx();
		}
	}

	public List getSimulatedSequenceInitValues()
	{
		return null;
	}

	public Object getSourceAttributeValueForSelectedObjectGeneric(SqlQuery query, int queryNumber)
	{
		return null;
	}

	public Object getSourceAttributeValueFromObjectGeneric(MithraDataObject object)
	{
		return null;
	}

	public Object getSourceAttributeValueGeneric(SqlQuery query, MapperStackImpl mapperStack, int queryNumber)
	{
		return null;
	}

	public String getDatabaseIdentifierGenericSource (Object source)
	{
		return connectionManager.getDatabaseIdentifier();
	}

	public DatabaseType getDatabaseTypeGenericSource(Object source)
	{
		return connectionManager.getDatabaseType();
	}

	public TimeZone getDatabaseTimeZoneGenericSource(Object source)
	{
		return getDatabaseTimeZone();
	}

	public Connection getConnectionGenericSource(Object source)
	{
		return connectionManagerWrapper.getConnection();
	}

	public BulkLoader createBulkLoaderGenericSource(Object source) throws BulkLoaderException 
	{
		return connectionManager.createBulkLoader();
	}

	public MithraDataObject inflateDataGenericSource(ResultSet rs, Object source, DatabaseType dt)
	throws SQLException 
	{
		return inflateAssociationEndData(rs, dt);
	}

	public void inflateNonPkDataGenericSource(MithraDataObject data, ResultSet rs, Object source, DatabaseType dt)
	throws SQLException 
	{
		inflateNonPkAssociationEndData(1, (AssociationEndData) data, rs, dt);
	}

	public MithraDataObject inflatePkDataGenericSource(ResultSet rs, Object source, DatabaseType dt)
	throws SQLException 
	{
		return inflateAssociationEndPkData(rs, dt);
	}

	public String getSchemaGenericSource(Object source)
	{
		if (this.schemaManager != null)
		{
			return this.schemaManager.getSchema(this.getDefaultSchema());
		}

		return this.getDefaultSchema();
	}

	public String getTableNameGenericSource(Object source) throws MithraDatabaseException
	{
		return getAssociationEndTableName();
	}

	public String getAssociationEndTableName() throws MithraDatabaseException
	{
		if (this.tablePartitionManager != null)
		{
			return this.tablePartitionManager.getTableName(this.getDefaultTableName());
		}

		return this.getDefaultTableName();
	}

	public void setPrimaryKeyAttributes(PreparedStatement stm, int pos, MithraDataObject dataObj,
		TimeZone databaseTimeZone, DatabaseType dt) throws SQLException
	{
		AssociationEndData data = (AssociationEndData)dataObj;
		TimeZone conversionTimeZone = null;
		stm.setString(pos++, data.getOwningClassName());
		stm.setString(pos++, data.getName());
	}

	public int setPrimaryKeyAttributesWithoutOptimistic(PreparedStatement stm, int pos, MithraDataObject dataObj,
		TimeZone databaseTimeZone, DatabaseType dt) throws SQLException
	{
		this.setPrimaryKeyAttributes(stm, pos, dataObj, databaseTimeZone, dt);
		return -1;
	}

	public String getPrimaryKeyWhereSql()
	{
		return "\"OWNING_CLASS_NAME\" = ? AND \"NAME\" = ?";
	}

	public String getPrimaryKeyWhereSqlWithNullableAttribute(MithraDataObject dataObj)
	{
		return "";
	}

	public String getPrimaryKeyWhereSqlWithNullableAttributeWithDefaultAlias(MithraDataObject dataObj)
	{
		return "";
	}

	public String getColumnListWithPk(String databaseAlias)
	{
		if (databaseAlias.equals(SqlQuery.DEFAULT_DATABASE_ALIAS))
		{
			return "t0.\"OWNING_CLASS_NAME\",t0.\"NAME\",t0.\"ASSOCIATION_NAME\",t0.\"RESULT_TYPE_NAME\",t0.\"ORDINAL\",t0.\"DIRECTION\",t0.\"MULTIPLICITY\"";
		}

		StringBuffer result = new StringBuffer((databaseAlias.length()+15)*7);
		result.append(databaseAlias).append(".").append("\"OWNING_CLASS_NAME\"");
		result.append(",").append(databaseAlias).append(".").append("\"NAME\"");
		result.append(",").append(databaseAlias).append(".").append("\"ASSOCIATION_NAME\"");
		result.append(",").append(databaseAlias).append(".").append("\"RESULT_TYPE_NAME\"");
		result.append(",").append(databaseAlias).append(".").append("\"ORDINAL\"");
		result.append(",").append(databaseAlias).append(".").append("\"DIRECTION\"");
		result.append(",").append(databaseAlias).append(".").append("\"MULTIPLICITY\"");
		return result.toString();
	}

	public Object getConnectionManager()
	{
		return connectionManager;
	}

	public void setConnectionManager(Object connectionManager, ConnectionManagerWrapper wrapper)
	{
		this.connectionManager = (SourcelessConnectionManager)connectionManager;
		this.connectionManagerWrapper = wrapper;
	}

	public AssociationEndData inflateAssociationEndData(ResultSet rs, DatabaseType dt)
	throws SQLException
	{
		AssociationEndData data = inflateAssociationEndPkData(rs, dt);
		inflateNonPkAssociationEndData(3, data, rs, dt);
		return data;
	}

	public AssociationEndData inflateAssociationEndPkData(ResultSet _rs, DatabaseType _dt)
	throws SQLException
	{
		AssociationEndData _data = new AssociationEndData();
		int _pos = 1;
		_data.setOwningClassName((_rs.getString(_pos++)));
		_data.setName((_rs.getString(_pos++)));
		return _data;
	}

	public void inflateNonPkAssociationEndData(int _pos, AssociationEndData _datax, ResultSet _rs, DatabaseType _dt)
	throws SQLException
	{
		{
			AssociationEndData _data = _datax;
			_data.setAssociationName((_rs.getString(_pos++)));
			_data.setResultTypeName((_rs.getString(_pos++)));
			_data.setOrdinal(_rs.getInt(_pos++));
			checkNullPrimitive(_rs, _data, "ordinal");
			_data.setDirection((_rs.getString(_pos++)));
			_data.setMultiplicity((_rs.getString(_pos++)));
		}
	}

	public DatabaseType getDatabaseType()
	{
		return connectionManager.getDatabaseType();
	}

	public TimeZone getDatabaseTimeZone()
	{
		return connectionManager.getDatabaseTimeZone();
	}

	protected String getSchema()
	{
		return this.getSchemaGenericSource(null);
	}

	public void setSchemaManager(Object schemaManager)
	{
		if( schemaManager instanceof SchemaManager )
		{
			this.schemaManager = (SchemaManager) schemaManager;
		}
		else
		{
			throw new IllegalArgumentException( "Schema manager class " + schemaManager.getClass().getName()
			+ " does not implement SchemaManager.class" );
		}
	}

	public void setTablePartitionManager(Object tablePartitionManager)
	{
		if( tablePartitionManager instanceof TablePartitionManager )
		{
			this.tablePartitionManager = (TablePartitionManager) tablePartitionManager;
		}
		else
		{
			throw new IllegalArgumentException( "Table partition manager class " + tablePartitionManager.getClass().getName()
			+ " does not implement TablePartitionManager.class" );
		}
	}

	public String getTableName()
	{
		return this.getDefaultTableName();
	}

	public String getDefaultTableName()
	{
		return "\"ASSOCIATION_END\"";
	}

	public void setInsertAttributes(PreparedStatement stm, MithraDataObject dataObj,
		TimeZone databaseTimeZone, int pos, DatabaseType dt) throws SQLException
	{
		AssociationEndData data = (AssociationEndData)dataObj;
		TimeZone conversionTimeZone = null;
		if(data.isOwningClassNameNull())
		{
			throwNullAttribute("owningClassName");
		}

		stm.setString(pos++, data.getOwningClassName());
		if(data.isNameNull())
		{
			throwNullAttribute("name");
		}

		stm.setString(pos++, data.getName());
		if(data.isAssociationNameNull())
		{
			throwNullAttribute("associationName");
		}

		stm.setString(pos++, data.getAssociationName());
		if(data.isResultTypeNameNull())
		{
			throwNullAttribute("resultTypeName");
		}

		stm.setString(pos++, data.getResultTypeName());
		stm.setInt(pos++, data.getOrdinal());
		if(data.isDirectionNull())
		{
			throwNullAttribute("direction");
		}

		stm.setString(pos++, data.getDirection());
		if(data.isMultiplicityNull())
		{
			throwNullAttribute("multiplicity");
		}

		stm.setString(pos++, data.getMultiplicity());
	}

	public String getInsertFields()
	{
		return "\"OWNING_CLASS_NAME\",\"NAME\",\"ASSOCIATION_NAME\",\"RESULT_TYPE_NAME\",\"ORDINAL\",\"DIRECTION\",\"MULTIPLICITY\"";
	}

	public String getInsertQuestionMarks()
	{
		return "?,?,?,?,?,?,?";
	}

	public String getOptimisticLockingWhereSql()
	{
		return "";
	}

	public MithraObject createObject(MithraDataObject newData)
	{
		AssociationEnd newObject = new AssociationEnd();
		newObject.zSetFromAssociationEndData((AssociationEndData) newData);
		return newObject;
	}

	public String getPkColumnList(String databaseAlias)
	{
		if (databaseAlias.equals(SqlQuery.DEFAULT_DATABASE_ALIAS))
		{
			return "t0.\"OWNING_CLASS_NAME\",t0.\"NAME\"";
		}

		StringBuffer result = new StringBuffer((databaseAlias.length()+15)*7);
		result.append(databaseAlias);
		result.append(".");
		result.append("\"OWNING_CLASS_NAME\"");
		result.append(",");
		result.append(databaseAlias);
		result.append(".");
		result.append("\"NAME\"");
		return result.toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy