public interface PersistenceOperations
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_UNIT_DESC |
static String |
DEFAULT_UNIT_SUFFIX |
Modifier and Type | Method and Description |
---|---|
org.jboss.shrinkwrap.descriptor.api.persistence.PersistenceUnitCommon |
getExistingPersistenceUnit(Project project,
String unitName)
Get the object representing the persistence unit, null is returned when no persistence unit was found.
|
List<JavaResource> |
getProjectEntities(Project project)
Returns the list of all the JPA entities of the project
|
JavaResource |
newEmbeddableEntity(DirectoryResource target,
String entityName,
String entityPackage)
Creates a new
JavaResource for an embeddable entity in the specified project. |
org.jboss.forge.roaster.model.source.JavaClassSource |
newEmbeddableEntity(org.jboss.forge.roaster.model.source.JavaClassSource source)
Given a
JavaClassSource it decorates the source with code for an embeddable entity |
JavaResource |
newEmbeddableEntity(Project project,
String entityName,
String entityPackage)
Creates a new
JavaResource for an embeddable entity in the specified target. |
JavaResource |
newEntity(DirectoryResource target,
String entityName,
String entityPackage,
javax.persistence.GenerationType idStrategy)
Creates a new
JavaResource in the specified target. |
JavaResource |
newEntity(DirectoryResource target,
String entityName,
String entityPackage,
javax.persistence.GenerationType idStrategy,
String tableName)
Creates a new
JavaResource in the specified target. |
org.jboss.forge.roaster.model.source.JavaClassSource |
newEntity(org.jboss.forge.roaster.model.source.JavaClassSource source,
javax.persistence.GenerationType idStrategy,
String tableName)
Given a
JavaClassSource it decorates the source with code for an entity |
JavaResource |
newEntity(Project project,
String entityName,
String entityPackage,
javax.persistence.GenerationType idStrategy)
Creates a new
JavaResource in the specified project. |
JavaResource |
newEntity(Project project,
String entityName,
String entityPackage,
javax.persistence.GenerationType idStrategy,
String tableName)
Creates a new
JavaResource in the specified project. |
FileResource<?> |
setup(String unitName,
Project project,
JPADataSource dataSource,
boolean configureMetadata)
Setups JPA in the project for the given attributes.
|
static final String DEFAULT_UNIT_SUFFIX
static final String DEFAULT_UNIT_DESC
FileResource<?> setup(String unitName, Project project, JPADataSource dataSource, boolean configureMetadata)
unitName
- Name of the created Persistence Unitproject
- Project for which the JPA is being set updataSource
- JPA data-source configurationconfigureMetadata
- configure the metadataorg.jboss.shrinkwrap.descriptor.api.persistence.PersistenceUnitCommon getExistingPersistenceUnit(Project project, String unitName)
unitName
- Name of the Persistence Unitproject
- Project in which the JPA is being looked forJavaResource newEntity(Project project, String entityName, String entityPackage, javax.persistence.GenerationType idStrategy, String tableName) throws FileNotFoundException
JavaResource
in the specified project. If no project is available, use
newEntity(DirectoryResource, String, String, GenerationType)
project
- the current project to create the entity. Must not be nullentityName
- the name of the entityentityPackage
- the package of the entity to be createdidStrategy
- the ID strategy chosen for this entityFileNotFoundException
- if something wrong happens while saving the JavaClass
JavaResource newEntity(DirectoryResource target, String entityName, String entityPackage, javax.persistence.GenerationType idStrategy, String tableName)
JavaResource
in the specified target. If a project is available, use
newEntity(Project, String, String, GenerationType)
target
- the target directory resource to create this classentityName
- the name of the entityentityPackage
- the package of the entity to be createdidStrategy
- the ID strategy chosen for this entitytableName
- the table name (optional)FileNotFoundException
- if something wrong happens while saving the JavaClass
JavaResource newEntity(Project project, String entityName, String entityPackage, javax.persistence.GenerationType idStrategy) throws FileNotFoundException
JavaResource
in the specified project. If no project is available, use
newEntity(DirectoryResource, String, String, GenerationType)
project
- the current project to create the entity. Must not be nullentityName
- the name of the entityentityPackage
- the package of the entity to be createdidStrategy
- the ID strategy chosen for this entityFileNotFoundException
- if something wrong happens while saving the JavaClass
JavaResource newEntity(DirectoryResource target, String entityName, String entityPackage, javax.persistence.GenerationType idStrategy)
JavaResource
in the specified target. If a project is available, use
newEntity(Project, String, String, GenerationType)
target
- the target directory resource to create this classentityName
- the name of the entityentityPackage
- the package of the entity to be createdidStrategy
- the ID strategy chosen for this entityFileNotFoundException
- if something wrong happens while saving the JavaClass
org.jboss.forge.roaster.model.source.JavaClassSource newEntity(org.jboss.forge.roaster.model.source.JavaClassSource source, javax.persistence.GenerationType idStrategy, String tableName)
JavaClassSource
it decorates the source with code for an entitysource
- source of the class to decorateidStrategy
- the ID strategy chosen for this entitytableName
- the table name chose for this entityJavaResource newEmbeddableEntity(DirectoryResource target, String entityName, String entityPackage)
JavaResource
for an embeddable entity in the specified project. If a project is available,
use newEmbeddableEntity(Project, String, String)
target
- the target directory resource to create this classentityName
- the name of the entityentityPackage
- the package of the entity to be createdFileNotFoundException
- if something wrong happens while saving the JavaClass
JavaResource newEmbeddableEntity(Project project, String entityName, String entityPackage) throws FileNotFoundException
JavaResource
for an embeddable entity in the specified target. If no project is available,
use newEmbeddableEntity(DirectoryResource, String, String)
project
- the current project to create the entity. Must not be nullentityName
- the name of the entityentityPackage
- the package of the entity to be createdFileNotFoundException
- if something wrong happens while saving the JavaClass
org.jboss.forge.roaster.model.source.JavaClassSource newEmbeddableEntity(org.jboss.forge.roaster.model.source.JavaClassSource source)
JavaClassSource
it decorates the source with code for an embeddable entitysource
- source of the class to decorateList<JavaResource> getProjectEntities(Project project)
project
- the current projectCopyright © 2015 JBoss by Red Hat. All rights reserved.