本文整理汇总了Java中org.eclipse.persistence.internal.sessions.AbstractSession类的典型用法代码示例。如果您正苦于以下问题:Java AbstractSession类的具体用法?Java AbstractSession怎么用?Java AbstractSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSession类属于org.eclipse.persistence.internal.sessions包,在下文中一共展示了AbstractSession类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initializeDefaultQueries
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
/**
* THIS IS CALLED FIRST
* Allow the platform to initialize the CRUD queries to defaults.
* Configure the CRUD operations using GET/PUT and DELETE.
*/
@Override
public void initializeDefaultQueries(DescriptorQueryManager qm, AbstractSession session) {
if (!qm.hasInsertQuery()) {
qm.setInsertCall(getCall(qm, DemoOperation.INSERT));
}
if (!qm.hasUpdateQuery()) {
qm.setUpdateCall(getCall(qm, DemoOperation.UPDATE));
}
if (!qm.hasReadObjectQuery()) {
qm.setReadObjectCall(getCall(qm, DemoOperation.FIND));
}
if (!qm.hasDeleteQuery()) {
qm.setDeleteCall(getCall(qm, DemoOperation.REMOVE));
}
}
开发者ID:rhulha,项目名称:EclipseLinkNoSQLDemoPlugin,代码行数:21,代码来源:DemoPlatform.java
示例2: buildCallFromStatement
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
public DatasourceCall buildCallFromStatement(SQLStatement statement, DatabaseQuery query, AbstractSession session) {
//System.out.println("buildCallFromStatement");
if (!query.isObjectLevelReadQuery()) {
throw new EISException("Query too complex, only select queries are supported: " + query);
}
MappedInteraction interaction = new MappedInteraction();
// Experimantal
interaction.setProperty("SQLStatement", statement);
interaction.setProperty(OPERATION, DemoOperation.FIND);
interaction.setProperty(TABLE, ((EISDescriptor) query.getDescriptor()).getDataTypeName());
interaction.setProperty(KEYS, getPrimaryKeys(query.getDescriptor()));
//interaction.setInputRow(row);
return interaction;
}
开发者ID:rhulha,项目名称:EclipseLinkNoSQLDemoPlugin,代码行数:18,代码来源:DemoPlatform.java
示例3: buildDBTable
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
/**
* INTERNAL: Return the create table object.
*/
public void buildDBTable(AbstractSession session, DBMapping dbMapping) throws ValidationException {
DBTable dBTable;
Entity entity = (Entity) intrinsicEntity.get(0);
Table table;
if (attribute instanceof RelationAttribute) {
dBTable = new DBRelationTable(getFullName(), entity, (RelationAttribute) attribute);//Todo pass managedClass
} else if (attribute instanceof ElementCollection) {
dBTable = new DBCollectionTable(getFullName(), entity, (ElementCollection) attribute);
} else if((table = entity.getTable(getFullName())) instanceof SecondaryTable){
dBTable = new DBSecondaryTable(getFullName(), entity, (SecondaryTable)table);
} else {
dBTable = new DBBaseTable(getFullName(), entity);
}
dBTable.setId(NBModelerUtil.getAutoGeneratedStringId());
for (Iterator<FieldDefinition> itetrator = getFields().iterator(); itetrator.hasNext();) {
JPAMFieldDefinition field = (JPAMFieldDefinition) itetrator.next();
field.buildDBColumn(dBTable, session, this);
}
dbMapping.addTable(dBTable);
}
开发者ID:jeddict,项目名称:jeddict,代码行数:28,代码来源:JPAMTableDefinition.java
示例4: profileExecutionOfQuery
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
public Object profileExecutionOfQuery( DatabaseQuery query, Record row, AbstractSession session )
{
if( this.profileWeight < SessionProfiler.HEAVY )
{
return session.internalExecuteQuery( query, (AbstractRecord) row );
}
startOperationProfile( query.getMonitorName() );
startOperationProfile( query.getClass().getSimpleName() );
occurred( query.getClass().getSimpleName(), session );
occurred( query.getMonitorName(), session );
try
{
return session.internalExecuteQuery( query, (AbstractRecord) row );
}
finally
{
endOperationProfile( query.getMonitorName() );
endOperationProfile( query.getClass().getSimpleName() );
}
}
开发者ID:werval,项目名称:werval,代码行数:22,代码来源:MetricsSessionProfiler.java
示例5: select
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
/**
* INTERNAL:
*/
protected Object select(Accessor accessor, AbstractSession writeSession, String seqName, Integer size) {
ValueReadQuery query = getSelectQuery();
if (query != null) {
if (accessor != null) {
// PERF: Prepare the query before being cloned.
// Also BUG: SQLCall could not be prepared concurrently by different queries.
// Setting user define allow custom SQL query to be prepared without translation row.
query.setIsUserDefined(true);
query.checkPrepare(writeSession, null);
query = (ValueReadQuery)query.clone();
query.setAccessor(accessor);
}
} else {
query = buildSelectQuery(seqName, size);
if (accessor != null) {
query.setAccessor(accessor);
}
}
Vector args = createArguments(query, seqName, size);
if (args != null) {
return writeSession.executeQuery(query, args);
} else {
return writeSession.executeQuery(query);
}
}
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:29,代码来源:QuerySequence.java
示例6: test
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
protected Object test(Accessor accessor, AbstractSession writeSession, String seqName, Integer size) {
ValueReadQuery query = getTestQuery();
if (query != null) {
if (accessor != null) {
// PERF: Prepare the query before being cloned.
// Also BUG: SQLCall could not be prepared concurrently by different queries.
// Setting user define allow custom SQL query to be prepared without translation row.
query.setIsUserDefined(true);
query.checkPrepare(writeSession, null);
query = (ValueReadQuery)query.clone();
query.setAccessor(accessor);
}
} else {
query = buildTestQuery(seqName);
if (accessor != null) {
query.setAccessor(accessor);
}
}
Vector args = createArguments(query, seqName, size);
if (args != null) {
return writeSession.executeQuery(query, args);
} else {
return writeSession.executeQuery(query);
}
}
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:26,代码来源:QuerySequence.java
示例7: processDataResults
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
protected void processDataResults(AbstractSession session) {
int originalMax = baseQuery.getMaxRows();
int originalFirst = baseQuery.getFirstResult();
try {
baseQuery.setMaxRows(0);
baseQuery.setFirstResult(0);
super.processDataResults(session);
} finally {
baseQuery.setMaxRows(originalMax);
baseQuery.setFirstResult(originalFirst);
}
}
开发者ID:encircled,项目名称:Joiner,代码行数:16,代码来源:FixedJoinerAttributeManager.java
示例8: registerInstance
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
public void registerInstance(Entity entity, AbstractSession session) {
// Can be called outside of a transaction when fetching lazy attributes
if (!TransactionSynchronizationManager.isActualTransactionActive())
return;
if (!(session instanceof UnitOfWork))
throw new RuntimeException("Session is not a UnitOfWork: " + session);
getInstanceContainerResourceHolder(getStorageName(session)).registerInstanceForUnitOfWork(entity, (UnitOfWork) session);
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:PersistenceImplSupport.java
示例9: getGeneratedValue
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) {
DataSource dataSource = ((JNDIConnector) writeSession.getLogin().getConnector()).getDataSource();
DataFieldMaxValueIncrementer incrementer = MaxValueIncrementerFactory.getIncrementer(dataSource,
sequenceName);
return Long.valueOf(incrementer.nextLongValue());
}
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:KradEclipseLinkCustomizer.java
示例10: buildFieldTypes
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
/**
* INTERNAL: Build the foreign key constraints.
*/
@Override
protected void buildFieldTypes(AbstractSession session) {
// The ForeignKeyConstraint object is the newer way of doing things.
// We support FieldDefinition.getForeignKeyFieldName() due to backwards compatibility
// by converting it. To allow mixing both ways, we just add converted one to foreignKeys list.
for (FieldDefinition field : getFields()) {
if (field.getForeignKeyFieldName() != null) {
addForeignKeyConstraint(buildForeignKeyConstraint(field, session.getPlatform()));
}
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:15,代码来源:JPAMTableDefinition.java
示例11: createUniqueConstraintsOnDatabase
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
void createUniqueConstraintsOnDatabase(final AbstractSession session) throws ValidationException, DatabaseException {
if ((!session.getPlatform().supportsUniqueKeyConstraints())
|| getUniqueKeys().isEmpty()
|| session.getPlatform().requiresUniqueConstraintCreationOnTableCreate()) {
return;
}
for (UniqueKeyConstraint uniqueKey : getUniqueKeys()) {
session.priviledgedExecuteNonSelectingCall(new org.eclipse.persistence.queries.SQLCall(buildUniqueConstraintCreationWriter(session, uniqueKey, new StringWriter()).toString()));
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMTableDefinition.java
示例12: createForeignConstraintsOnDatabase
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
void createForeignConstraintsOnDatabase(final AbstractSession session) throws ValidationException, DatabaseException {
if ((!session.getPlatform().supportsForeignKeyConstraints()) || getForeignKeyMap().isEmpty()) {
return;
}
for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) {
if (!foreignKey.disableForeignKey()) {
session.priviledgedExecuteNonSelectingCall(new SQLCall(buildConstraintCreationWriter(session, foreignKey, new StringWriter()).toString()));
}
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMTableDefinition.java
示例13: JPAMMetadataProcessor
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
public JPAMMetadataProcessor(AbstractSession session, ClassLoader loader, boolean weaveLazy, boolean weaveEager, boolean weaveFetchGroups, boolean multitenantSharedEmf, boolean multitenantSharedCache, Map predeployProperties, MetadataProcessor compositeProcessor) {
m_loader = loader;
m_session = session;
m_project = new JPAMMetadataProject(session, weaveLazy, weaveEager, weaveFetchGroups, multitenantSharedEmf, multitenantSharedCache);
m_predeployProperties = predeployProperties;
m_compositeProcessor = compositeProcessor;
if (m_compositeProcessor != null) {
m_compositeProcessor.addCompositeMemberProcessor(this);
m_project.setCompositeProcessor(m_compositeProcessor);
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:12,代码来源:JPAMMetadataProcessor.java
示例14: getJdbcConnection
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
public ConnectionHandle getJdbcConnection(EntityManager em, boolean readOnly)
throws PersistenceException, SQLException {
AbstractSession session = (AbstractSession) getSession(em);
// The connection was already acquired eagerly in beginTransaction,
// unless lazyDatabaseTransaction was set to true.
Connection con = session.getAccessor().getConnection();
return (con != null ? new SimpleConnectionHandle(con) : null);
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:11,代码来源:EclipseLinkJpaDialect.java
示例15: occurred
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
public void occurred( String operationName, DatabaseQuery query, AbstractSession session )
{
if( this.profileWeight < SessionProfiler.NORMAL )
{
return;
}
occurred( operationName, session );
occurred( query.getMonitorName() + ":" + operationName, session );
}
开发者ID:werval,项目名称:werval,代码行数:11,代码来源:MetricsSessionProfiler.java
示例16: update
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
/**
* INTERNAL:
*/
protected void update(Accessor accessor, AbstractSession writeSession, String seqName, Number sizeOrNewValue) {
DataModifyQuery query = getUpdateQuery();
if (query != null) {
if (accessor != null) {
// PERF: Prepare the query before being cloned.
// Also BUG: SQLCall could not be prepared concurrently by different queries.
// Setting user define allow custom SQL query to be prepared without translation row.
query.setIsUserDefined(true);
query.checkPrepare(writeSession, null);
query = (DataModifyQuery)query.clone();
query.setAccessor(accessor);
}
} else {
query = buildUpdateQuery(seqName, sizeOrNewValue);
if (query == null) {
return;
}
if (accessor != null) {
query.setAccessor(accessor);
}
}
Vector args = createArguments(query, seqName, sizeOrNewValue);
if (args != null) {
writeSession.executeQuery(query, args);
} else {
writeSession.executeQuery(query);
}
}
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:32,代码来源:QuerySequence.java
示例17: getGeneratedValue
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
public Object getGeneratedValue(Accessor accessor, AbstractSession writeSession, String seqName) {
if (shouldUsePreallocation()) {
return null;
} else {
Number value = updateAndSelectSequence(accessor, writeSession, seqName, 1);
if (value == null) {
throw DatabaseException.errorPreallocatingSequenceNumbers();
}
return value;
}
}
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:12,代码来源:StandardSequence.java
示例18: getGeneratedVector
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession, String seqName, int size) {
if (shouldUsePreallocation()) {
Number value = updateAndSelectSequence(accessor, writeSession, seqName, size);
if (value == null) {
throw DatabaseException.errorPreallocatingSequenceNumbers();
}
return createVector(value, seqName, size);
} else {
return null;
}
}
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:12,代码来源:StandardSequence.java
示例19: getGeneratedValue
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
public Object getGeneratedValue(Accessor accessor,
AbstractSession writeSession, String seqName) {
return (long)(Math.random()*Long.MAX_VALUE);
}
开发者ID:RETIT,项目名称:continuous-performance-evaluation,代码行数:6,代码来源:UUIDSequence.java
示例20: getGeneratedVector
import org.eclipse.persistence.internal.sessions.AbstractSession; //导入依赖的package包/类
@Override
public Vector getGeneratedVector(Accessor accessor,
AbstractSession writeSession, String seqName, int size) {
return null;
}
开发者ID:RETIT,项目名称:continuous-performance-evaluation,代码行数:6,代码来源:UUIDSequence.java
注:本文中的org.eclipse.persistence.internal.sessions.AbstractSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论