本文整理了Java中org.eclipse.persistence.internal.sessions.AbstractSession.getDescriptorForAlias()
方法的一些代码示例,展示了AbstractSession.getDescriptorForAlias()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractSession.getDescriptorForAlias()
方法的具体详情如下:
包路径:org.eclipse.persistence.internal.sessions.AbstractSession
类名称:AbstractSession
方法名:getDescriptorForAlias
[英]PUBLIC: Return the descriptor for the alias
[中]PUBLIC:返回别名的描述符
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Retrieves the descriptor associated with the given abstract schema name, which is the
* descriptor's alias.
*
* @param abstractSchemaName The managed type name associated with the managed type
* @return The EclipseLink {@link ClassDescriptor descriptor} representing the managed type
*/
ClassDescriptor getDescriptor(String abstractSchemaName) {
return getSession().getDescriptorForAlias(abstractSchemaName);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/** Returns the type of the class corresponding to the specified abstract
* schema type.
*/
public Object resolveSchema(String schemaName) {
ClassDescriptor descriptor = session.getDescriptorForAlias(schemaName);
return (descriptor != null) ? descriptor.getJavaClass() : null;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/** Returns the type of the class corresponding to the specified abstract
* schema type.
*/
public Object resolveSchema(String schemaName) {
ClassDescriptor descriptor = session.getDescriptorForAlias(schemaName);
return (descriptor != null) ? descriptor.getJavaClass() : null;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* Retrieves the descriptor associated with the given abstract schema name, which is the
* descriptor's alias.
*
* @param abstractSchemaName The managed type name associated with the managed type
* @return The EclipseLink {@link ClassDescriptor descriptor} representing the managed type
*/
ClassDescriptor getDescriptor(String abstractSchemaName) {
return getSession().getDescriptorForAlias(abstractSchemaName);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/** Returns the type of the class corresponding to the specified abstract
* schema type.
*/
public Object resolveSchema(String schemaName) {
ClassDescriptor descriptor = session.getDescriptorForAlias(schemaName);
return (descriptor != null) ? descriptor.getJavaClass() : null;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* Return the table descriptor specified for the class.
*/
@Override
public ClassDescriptor getDescriptorForAlias(String alias) {
return getParent().getDescriptorForAlias(alias);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Return the table descriptor specified for the class.
*/
@Override
public ClassDescriptor getDescriptorForAlias(String alias) {
return getParent().getDescriptorForAlias(alias);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
String customizerClassName = (String)entry.getValue();
ClassDescriptor descriptor = session.getDescriptorForAlias(name);
if (descriptor == null) {
try {
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* Extract descriptor from the session
*/
public Transporter getDescriptorForAlias(Transporter remoteTransporter) {
String alias = (String)remoteTransporter.getObject();
Transporter transporter = new Transporter();
try {
ClassDescriptor descriptor = getSession().getDescriptorForAlias(alias);
transporter.setObject(descriptor);
} catch (RuntimeException exception) {
transporter.setException(exception);
}
return transporter;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Extract descriptor from the session
*/
public Transporter getDescriptorForAlias(Transporter remoteTransporter) {
String alias = (String)remoteTransporter.getObject();
Transporter transporter = new Transporter();
try {
ClassDescriptor descriptor = getSession().getDescriptorForAlias(alias);
transporter.setObject(descriptor);
} catch (RuntimeException exception) {
transporter.setException(exception);
}
return transporter;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* Answer true if this node refers to an object described later in the EJBQL
* True: SELECT p FROM Project p
* False: SELECT p.id FROM Project p
*/
public boolean nodeRefersToObject(Node node, GenerationContext context) {
if (!node.isVariableNode()){
return false;
}
String name = ((VariableNode)node).getCanonicalVariableName();
String alias = context.getParseTreeContext().schemaForVariable(name);
if (alias != null){
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
if (descriptor != null){
return true;
}
}
return false;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL
* Answer the class associated with the provided schema name
*/
public Class classForSchemaName(String schemaName, GenerationContext context) {
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(schemaName);
if (descriptor == null) {
throw JPQLException.entityTypeNotFound(getQueryInfo(), schemaName);
}
Class theClass = descriptor.getJavaClass();
if (theClass == null) {
throw JPQLException.resolutionClassNotFoundException(getQueryInfo(), schemaName);
}
return theClass;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* Answer true if this node refers to an object described later in the EJBQL
* True: SELECT p FROM Project p
* False: SELECT p.id FROM Project p
*/
public boolean nodeRefersToObject(Node node, GenerationContext context) {
if (!node.isVariableNode()){
return false;
}
String name = ((VariableNode)node).getCanonicalVariableName();
String alias = context.getParseTreeContext().schemaForVariable(name);
if (alias != null){
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
if (descriptor != null){
return true;
}
}
return false;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Answer true if this node refers to an object described later in the EJBQL
* True: SELECT p FROM Project p
* False: SELECT p.id FROM Project p
*/
public boolean nodeRefersToObject(Node node, GenerationContext context) {
if (!node.isVariableNode()){
return false;
}
String name = ((VariableNode)node).getCanonicalVariableName();
String alias = context.getParseTreeContext().schemaForVariable(name);
if (alias != null){
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
if (descriptor != null){
return true;
}
}
return false;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL
* Answer the class associated with the provided schema name
*/
public Class classForSchemaName(String schemaName, GenerationContext context) {
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(schemaName);
if (descriptor == null) {
throw JPQLException.entityTypeNotFound(getQueryInfo(), schemaName);
}
Class theClass = descriptor.getJavaClass();
if (theClass == null) {
throw JPQLException.resolutionClassNotFoundException(getQueryInfo(), schemaName);
}
return theClass;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL
* Answer the class associated with the provided schema name
*/
public Class classForSchemaName(String schemaName, GenerationContext context) {
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(schemaName);
if (descriptor == null) {
throw JPQLException.entityTypeNotFound(getQueryInfo(), schemaName);
}
Class theClass = descriptor.getJavaClass();
if (theClass == null) {
throw JPQLException.resolutionClassNotFoundException(getQueryInfo(), schemaName);
}
return theClass;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Find by primary key.
*
* @param entityClass
* - the entity class to find.
* @param primaryKey
* - the entity primary key value, or primary key class, or a
* List of primary key values.
* @return the found entity instance or null, if the entity does not exist.
* @throws IllegalArgumentException
* if the first argument does not indicate an entity or if the
* second argument is not a valid type for that entity's
* primaryKey.
*/
public Object find(String entityName, Object primaryKey) {
try {
verifyOpen();
AbstractSession session = (AbstractSession) getActiveSession();
ClassDescriptor descriptor = session.getDescriptorForAlias(entityName);
if (descriptor == null || descriptor.isDescriptorTypeAggregate()) {
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("unknown_entitybean_name", new Object[] { entityName }));
}
return findInternal(descriptor, session, primaryKey, null, null);
} catch (LockTimeoutException e) {
throw e;
} catch (RuntimeException e) {
setRollbackOnly();
throw e;
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* resolveClass: Answer the class which corresponds to my variableName. This is the class for
* an alias, where the variableName is registered to an alias.
*/
public Class resolveClass(GenerationContext context) {
String alias = abstractSchemaName;
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
if (descriptor == null) {
throw JPQLException.entityTypeNotFound2(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), alias);
}
Class theClass = descriptor.getJavaClass();
if (theClass == null) {
throw JPQLException.resolutionClassNotFoundException2(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), alias);
}
return theClass;
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* resolveClass: Answer the class which corresponds to my variableName. This is the class for
* an alias, where the variableName is registered to an alias.
*/
public Class resolveClass(GenerationContext context) {
String alias = abstractSchemaName;
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
if (descriptor == null) {
throw JPQLException.entityTypeNotFound2(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), alias);
}
Class theClass = descriptor.getJavaClass();
if (theClass == null) {
throw JPQLException.resolutionClassNotFoundException2(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), alias);
}
return theClass;
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* resolveClass: Answer the class which corresponds to my variableName. This is the class for
* an alias, where the variableName is registered to an alias.
*/
public Class resolveClass(GenerationContext context) {
String alias = abstractSchemaName;
ClassDescriptor descriptor = context.getSession().getDescriptorForAlias(alias);
if (descriptor == null) {
throw JPQLException.entityTypeNotFound2(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), alias);
}
Class theClass = descriptor.getJavaClass();
if (theClass == null) {
throw JPQLException.resolutionClassNotFoundException2(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), alias);
}
return theClass;
}
}