org.hibernate.engine.spi.SessionFactoryImplementor.getImplementors()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.hibernate.engine.spi.SessionFactoryImplementor.getImplementors()方法的一些代码示例,展示了SessionFactoryImplementor.getImplementors()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SessionFactoryImplementor.getImplementors()方法的具体详情如下:
包路径:org.hibernate.engine.spi.SessionFactoryImplementor
类名称:SessionFactoryImplementor
方法名:getImplementors

SessionFactoryImplementor.getImplementors介绍

[英]Get the names of all persistent classes that implement/extend the given interface/class
[中]获取实现/扩展给定接口/类的所有持久类的名称

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String[] getImplementors(String className) throws MappingException {
  return delegate.getImplementors( className );
}

代码示例来源:origin: stackoverflow.com

CriteriaImpl c = (CriteriaImpl)query;
SessionImpl s = (SessionImpl)c.getSession();
SessionFactoryImplementor factory = (SessionFactoryImplementor)s.getSessionFactory();
String[] implementors = factory.getImplementors( c.getEntityOrClassName() );
CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable)factory.getEntityPersister(implementors[0]),
  factory, c, implementors[0], s.getEnabledFilters());
Field f = OuterJoinLoader.class.getDeclaredField("sql");
f.setAccessible(true);
String sql = (String)f.get(loader);

代码示例来源:origin: hibernate/hibernate-orm

String importedClassName = getImportedClass( token, factory );
if ( importedClassName != null ) {
  String[] implementors = factory.getImplementors( importedClassName );
  token = "$clazz" + count++ + "$";
  if ( implementors != null ) {

代码示例来源:origin: stackoverflow.com

CriteriaImpl criteriaImpl = (CriteriaImpl)criteria;
SessionImplementor session = criteriaImpl.getSession();
SessionFactoryImplementor factory = session.getFactory();
CriteriaQueryTranslator translator=new CriteriaQueryTranslator(factory,criteriaImpl,criteriaImpl.getEntityOrClassName(),CriteriaQueryTranslator.ROOT_SQL_ALIAS);
String[] implementors = factory.getImplementors( criteriaImpl.getEntityOrClassName() );

CriteriaJoinWalker walker = new CriteriaJoinWalker((OuterJoinLoadable)factory.getEntityPersister(implementors[0]), 
            translator,
            factory, 
            criteriaImpl, 
            criteriaImpl.getEntityOrClassName(), 
            session.getLoadQueryInfluencers()   );

String sql=walker.getSQLString();

代码示例来源:origin: stackoverflow.com

CriteriaImpl c = (CriteriaImpl) criteria;
SessionImpl s = (SessionImpl) c.getSession();
SessionFactoryImplementor factory = (SessionFactoryImplementor) s.getSessionFactory();
String[] implementors = factory.getImplementors(c.getEntityOrClassName());
LoadQueryInfluencers lqis = new LoadQueryInfluencers();
CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable) factory.getEntityPersister(implementors[0]), factory, c, implementors[0], lqis);
Field f = OuterJoinLoader.class.getDeclaredField("sql");
f.setAccessible(true);
String sql = (String) f.get(loader);

代码示例来源:origin: stackoverflow.com

try {
     CriteriaImpl c = (CriteriaImpl) criteria;
     SessionImpl s = (SessionImpl) c.getSession();
     SessionFactoryImplementor factory = (SessionFactoryImplementor) s.getSessionFactory();
     String[] implementors = factory.getImplementors(c.getEntityOrClassName());
     CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable) factory.getEntityPersister(implementors[0]),
         factory, c, implementors[0], s.getEnabledFilters());
     Field f = OuterJoinLoader.class.getDeclaredField("sql");
     f.setAccessible(true);
     String sql = (String) f.get(loader);
   } catch (Exception e) {
   }

代码示例来源:origin: stackoverflow.com

Criteria criteria = session.createCriteria(User.class);

CriteriaImpl c = (CriteriaImpl)criteria;
SessionImpl s = (SessionImpl)c.getSession();

SessionFactoryImplementor factory = (SessionFactoryImplementor)s.getSessionFactory();
String[] implementors = factory.getImplementors( c.getEntityOrClassName() );
CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable)factory.getEntityPersister(implementors[0]),
  factory, c, implementors[0], s.getEnabledFilters());

Field f = OuterJoinLoader.class.getDeclaredField("sql");
f.setAccessible(true);
String sql = (String)f.get(loader);

代码示例来源:origin: stackoverflow.com

SessionImpl s = (SessionImpl)c.getSession();
SessionFactoryImplementor factory = (SessionFactoryImplementor)s.getSessionFactory();
String[] implementors = factory.getImplementors( c.getEntityOrClassName() );
CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable)factory.getEntityPersister(implementors[0]), factory, c, implementors[0], s.getEnabledFilters());
Field f = OuterJoinLoader.class.getDeclaredField("sql");

代码示例来源:origin: stackoverflow.com

SessionImpl sessionImpl = (SessionImpl) criteriaImpl.getSession();
SessionFactoryImplementor factory = sessionImpl.getSessionFactory();
String[] implementors = factory.getImplementors(criteriaImpl.getEntityOrClassName());
OuterJoinLoadable persister = (OuterJoinLoadable) factory.getEntityPersister(implementors[0]);
LoadQueryInfluencers loadQueryInfluencers = new LoadQueryInfluencers();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

String importedClassName = getImportedClass( token, factory );
if ( importedClassName != null ) {
  String[] implementors = factory.getImplementors( importedClassName );
  token = "$clazz" + count++ + "$";
  if ( implementors != null ) {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

String importedClassName = getImportedClass( token, factory );
if ( importedClassName != null ) {
  String[] implementors = factory.getImplementors( importedClassName );
  token = "$clazz" + count++ + "$";
  if ( implementors != null ) {

代码示例来源:origin: Evolveum/midpoint

String[] implementors = factory.getImplementors(c.getEntityOrClassName());
CriteriaLoader loader = new CriteriaLoader((OuterJoinLoadable) factory.getEntityPersister(implementors[0]),
    factory, c, implementors[0], s.getLoadQueryInfluencers());

代码示例来源:origin: org.n52.series-api.db/dao

/**
 * Translate the {@link Criteria criteria} to SQL.
 *
 * @param criteria the criteria
 *
 * @return the SQL
 */
public static String toSQLString(Criteria criteria) {
  if (!(criteria instanceof CriteriaImpl)) {
    return criteria.toString();
  }
  CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
  SharedSessionContractImplementor sessionContractImpl = criteriaImpl.getSession();
  SessionFactoryImplementor factory = sessionContractImpl.getFactory();
  String entityOrClassName = criteriaImpl.getEntityOrClassName();
  CriteriaQueryTranslator translator = new CriteriaQueryTranslator(factory, criteriaImpl, entityOrClassName,
                                   CriteriaQueryTranslator.ROOT_SQL_ALIAS);
  String[] implementors = factory.getImplementors(entityOrClassName);
  OuterJoinLoadable outerJoinLoadable = (OuterJoinLoadable) factory.getEntityPersister(implementors[0]);
  LoadQueryInfluencers loadQueryInfluencers = sessionContractImpl.getLoadQueryInfluencers();
  CriteriaJoinWalker walker = new CriteriaJoinWalker(outerJoinLoadable, translator, factory, criteriaImpl,
                            entityOrClassName, loadQueryInfluencers);
  return walker.getSQLString();
}

代码示例来源:origin: org.n52.sensorweb/timeseries-series-dao

public static String getSqlString(Criteria criteria) {
  CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
  SessionImplementor session = criteriaImpl.getSession();
  SessionFactoryImplementor factory = extractSessionFactory(criteria);
  CriteriaQueryTranslator translator =
      new CriteriaQueryTranslator(factory, criteriaImpl, criteriaImpl.getEntityOrClassName(),
          CriteriaQueryTranslator.ROOT_SQL_ALIAS);
  String[] implementors = factory.getImplementors(criteriaImpl.getEntityOrClassName());
  CriteriaJoinWalker walker =
      new CriteriaJoinWalker((OuterJoinLoadable) factory.getEntityPersister(implementors[0]), translator,
          factory, criteriaImpl, criteriaImpl.getEntityOrClassName(), session.getLoadQueryInfluencers());
  return walker.getSQLString();
}

代码示例来源:origin: org.n52.series-api/series-dao

public static String getSqlString(Criteria criteria) {
  CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
  SessionImplementor session = criteriaImpl.getSession();
  SessionFactoryImplementor factory = extractSessionFactory(criteria);
  CriteriaQueryTranslator translator
      = new CriteriaQueryTranslator(factory, criteriaImpl, criteriaImpl.getEntityOrClassName(),
          CriteriaQueryTranslator.ROOT_SQL_ALIAS);
  String[] implementors = factory.getImplementors(criteriaImpl.getEntityOrClassName());
  CriteriaJoinWalker walker
      = new CriteriaJoinWalker((OuterJoinLoadable) factory.getEntityPersister(implementors[0]), translator,
          factory, criteriaImpl, criteriaImpl.getEntityOrClassName(), session.getLoadQueryInfluencers());
  return walker.getSQLString();
}

相关文章

微信公众号

最新文章

更多

SessionFactoryImplementor类方法