use of org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml in project jbosstools-hibernate by jbosstools.
the class HibernateJpaProject method getBasicHibernateProperties.
public BasicHibernateProperties getBasicHibernateProperties() {
if (getContextRoot() != null) {
PersistenceXml persistenceXml = getContextRoot().getPersistenceXml();
Persistence persistence = persistenceXml.getRoot();
if (persistence.getPersistenceUnitsSize() > 0) {
PersistenceUnit persistenceUnit = persistence.getPersistenceUnit(0);
if (persistenceUnit instanceof HibernatePersistenceUnit) {
return ((HibernatePersistenceUnit) persistenceUnit).getHibernatePersistenceUnitProperties();
}
}
}
return null;
}
use of org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml in project jbosstools-hibernate by jbosstools.
the class AddGeneratedClassesJob method mappingFileContains.
boolean mappingFileContains(JpaProject jpaProject, String fullyQualifiedTypeName) {
PersistenceXml persistenceXml = jpaProject.getContextRoot().getPersistenceXml();
if (persistenceXml == null) {
return false;
}
Persistence persistence = persistenceXml.getRoot();
if (persistence == null) {
return false;
}
if (persistence.getPersistenceUnitsSize() == 0) {
return false;
}
PersistenceUnit persistenceUnit = persistence.getPersistenceUnit(0);
for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFileRefs()) {
if (mappingFileRef.getPersistentType(fullyQualifiedTypeName) != null) {
return true;
}
}
return false;
}
Aggregations