本文整理了Java中org.hibernate.cfg.Configuration.getClassMappings()
方法的一些代码示例,展示了Configuration.getClassMappings()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getClassMappings()
方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称:Configuration
方法名:getClassMappings
[英]Iterate the entity mappings
[中]迭代实体映射
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb
public Iterator getClassMappings() {
Thread thread = null;
ClassLoader contextClassLoader = null;
if (overridenClassLoader != null) {
thread = Thread.currentThread();
contextClassLoader = thread.getContextClassLoader();
thread.setContextClassLoader( overridenClassLoader );
}
try {
return cfg.getClassMappings();
}
finally {
if (thread != null) thread.setContextClassLoader( contextClassLoader );
}
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
public static String[] getTableNames() {
List<String> tableNames = new ArrayList<String>();
Configuration cfg = createConfiguration(new Properties());
Iterator<PersistentClass> classMappings = cfg.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass o = classMappings.next();
tableNames.add(o.getTable().getName());
}
return tableNames.toArray(new String[tableNames.size()]);
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly
public static String[] getTableNames() {
List<String> tableNames = new ArrayList<String>();
Configuration cfg = createConfiguration(new Properties());
Iterator<PersistentClass> classMappings = cfg.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass o = classMappings.next();
tableNames.add(o.getTable().getName());
}
return tableNames.toArray(new String[tableNames.size()]);
}
代码示例来源:origin: org.jbpm.jbpm3/jbpm-jpdl
private void initHibernatableClasses() {
hibernatableLongIdClasses = new HashSet();
hibernatableStringIdClasses = new HashSet();
for (Iterator iter = configuration.getClassMappings(); iter.hasNext();) {
PersistentClass persistentClass = (PersistentClass) iter.next();
if (LongType.class == persistentClass.getIdentifier().getType().getClass()) {
hibernatableLongIdClasses.add(persistentClass.getMappedClass());
}
else if (StringType.class == persistentClass.getIdentifier().getType().getClass()) {
hibernatableStringIdClasses.add(persistentClass.getMappedClass());
}
}
}
代码示例来源:origin: bonitasoft/bonita-engine
final Iterator<PersistentClass> it = configuration.getClassMappings();
代码示例来源:origin: bonitasoft/bonita-engine
final Iterator<PersistentClass> it = configuration.getClassMappings();
代码示例来源:origin: com.arsframework/ars-database
SessionFactory sessionFactory = bean.getObject();
Configuration configuration = bean.getConfiguration();
Iterator<PersistentClass> persistentIterator = configuration.getClassMappings();
while (persistentIterator.hasNext()) {
PersistentClass persistent = persistentIterator.next();
persistentIterator = configuration.getClassMappings();
while (persistentIterator.hasNext()) {
PersistentClass persistent = persistentIterator.next();
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
Iterator<PersistentClass> classes = (Iterator<PersistentClass>) cfg.getClassMappings();
ReflectionManager reflectionManager;
if ( cfg instanceof AnnotationConfiguration ) {
代码示例来源:origin: org.beangle.commons/beangle-commons-orm
.getProperty(Environment.DEFAULT_SCHEMA);
for (Iterator<PersistentClass> pcIter = config.getClassMappings(); pcIter.hasNext();) {
PersistentClass pc = pcIter.next();
if (!pc.isInherited()) {
代码示例来源:origin: org.compass-project/compass
for (Iterator it = cfg.getClassMappings(); it.hasNext();) {
PersistentClass clazz = (PersistentClass) it.next();
Class<?> mappedClass = clazz.getMappedClass();
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb
this.discardOnClose = discardOnClose;
this.sessionInterceptorClass = sessionInterceptorClass;
final Iterator<PersistentClass> classes = cfg.getClassMappings();
代码示例来源:origin: org.hibernate/hibernate-validator-legacy
Iterator<PersistentClass> classes = (Iterator<PersistentClass>) cfg.getClassMappings();
ReflectionManager reflectionManager;
try {
代码示例来源:origin: com.blazebit/blaze-persistence-integration-hibernate-4.3
@Override
public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
Class<?> valuesEntity;
boolean registerValuesEntity = true;
try {
valuesEntity = Class.forName("com.blazebit.persistence.impl.function.entity.ValuesEntity");
} catch (ClassNotFoundException e) {
throw new RuntimeException("Are you missing blaze-persistence-core-impl on the classpath?", e);
}
Iterator<PersistentClass> iter = configuration.getClassMappings();
while (iter.hasNext()) {
PersistentClass clazz = iter.next();
Class<?> entityClass = clazz.getMappedClass();
if (entityClass != null && entityClass.isAnnotationPresent(CTE.class)) {
clazz.getTable().setSubselect("select * from " + clazz.getJpaEntityName());
}
}
if (registerValuesEntity) {
// Register values entity if wasn't found
configuration.addAnnotatedClass(valuesEntity);
configuration.buildMappings();
PersistentClass clazz = configuration.getClassMapping(valuesEntity.getName());
clazz.getTable().setSubselect("select * from " + clazz.getJpaEntityName());
}
serviceRegistry.locateServiceBinding(PersisterClassResolver.class).setService(new CustomPersisterClassResolver());
serviceRegistry.locateServiceBinding(Database.class).setService(new SimpleDatabase(configuration.getTableMappings(), sessionFactory.getDialect(), new SimpleTableNameFormatter(), configuration.buildMapping()));
}
代码示例来源:origin: Blazebit/blaze-persistence
Iterator<PersistentClass> iter = configuration.getClassMappings();
while (iter.hasNext()) {
PersistentClass clazz = iter.next();
代码示例来源:origin: Blazebit/blaze-persistence
@Override
public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
Class<?> valuesEntity;
boolean registerValuesEntity = true;
try {
valuesEntity = Class.forName("com.blazebit.persistence.impl.function.entity.ValuesEntity");
} catch (ClassNotFoundException e) {
throw new RuntimeException("Are you missing blaze-persistence-core-impl on the classpath?", e);
}
Iterator<PersistentClass> iter = configuration.getClassMappings();
while (iter.hasNext()) {
PersistentClass clazz = iter.next();
Class<?> entityClass = clazz.getMappedClass();
if (entityClass != null && entityClass.isAnnotationPresent(CTE.class)) {
clazz.getTable().setSubselect("select * from " + clazz.getJpaEntityName());
}
}
if (registerValuesEntity) {
// Register values entity if wasn't found
configuration.addAnnotatedClass(valuesEntity);
configuration.buildMappings();
PersistentClass clazz = configuration.getClassMapping(valuesEntity.getName());
clazz.getTable().setSubselect("select * from " + clazz.getJpaEntityName());
}
serviceRegistry.locateServiceBinding(PersisterClassResolver.class).setService(new CustomPersisterClassResolver());
serviceRegistry.locateServiceBinding(Database.class).setService(new SimpleDatabase(configuration.getTableMappings(), sessionFactory.getDialect(), new SimpleTableNameFormatter(), configuration.buildMapping()));
}
代码示例来源:origin: bonitasoft/bonita-engine
statistics = sessionFactory.getStatistics();
final Iterator<PersistentClass> classMappingsIterator = configuration.getClassMappings();
classMapping = new ArrayList<>();
while (classMappingsIterator.hasNext()) {
代码示例来源:origin: bonitasoft/bonita-engine
statistics = sessionFactory.getStatistics();
final Iterator<PersistentClass> classMappingsIterator = configuration.getClassMappings();
classMapping = new ArrayList<>();
while (classMappingsIterator.hasNext()) {
代码示例来源:origin: com.querydsl/querydsl-jpa-codegen
Iterator<?> classMappings = configuration.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass pc = (PersistentClass) classMappings.next();
代码示例来源:origin: com.mysema.querydsl/querydsl-jpa-codegen
Iterator<?> classMappings = configuration.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass pc = (PersistentClass)classMappings.next();
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb
Iterator classes = configuration.getClassMappings();
ReflectionManager reflectionManager = configuration.getReflectionManager();
while ( classes.hasNext() ) {
内容来源于网络,如有侵权,请联系作者删除!