Commit d0256b51222f5ff32bab178e4215b2b40a4040cd
1 parent
838bad8e
Exists in
master
FWK-203: Exclusão de funcionalidades e classes depreciadas na versão 2.4
Task-Url: https://demoiselle.atlassian.net/browse/FWK-203
Showing
1 changed file
with
16 additions
and
49 deletions
Show diff stats
impl/extension/jpa/src/main/java/br/gov/frameworkdemoiselle/internal/configuration/EntityManagerConfig.java
| ... | ... | @@ -40,12 +40,8 @@ import java.io.Serializable; |
| 40 | 40 | |
| 41 | 41 | import javax.persistence.EntityManager; |
| 42 | 42 | |
| 43 | -import org.slf4j.Logger; | |
| 44 | - | |
| 45 | 43 | import br.gov.frameworkdemoiselle.annotation.Name; |
| 46 | 44 | import br.gov.frameworkdemoiselle.configuration.Configuration; |
| 47 | -import br.gov.frameworkdemoiselle.util.Beans; | |
| 48 | -import br.gov.frameworkdemoiselle.util.Strings; | |
| 49 | 45 | |
| 50 | 46 | /** |
| 51 | 47 | * Configuration class responsible for retrieving specific entity manager parameter values from properties file. |
| ... | ... | @@ -54,62 +50,34 @@ import br.gov.frameworkdemoiselle.util.Strings; |
| 54 | 50 | public class EntityManagerConfig implements Serializable { |
| 55 | 51 | |
| 56 | 52 | private static final long serialVersionUID = 1L; |
| 57 | - | |
| 58 | - /** | |
| 59 | - * @deprecated | |
| 60 | - */ | |
| 61 | - // TODO Implementação apenas para manter a compatibilidade entre a versão 2.3 com a 2.4. | |
| 62 | - @Name("unit.name") | |
| 63 | - @Deprecated | |
| 64 | - private String persistenceUnitName; | |
| 65 | 53 | |
| 66 | 54 | @Name("default.unit.name") |
| 67 | 55 | private String defaultPersistenceUnitName; |
| 68 | - | |
| 56 | + | |
| 69 | 57 | @Name("entitymanager.scope") |
| 70 | 58 | private EntityManagerScope entityManagerScope = EntityManagerScope.REQUEST; |
| 71 | - | |
| 72 | - /** | |
| 73 | - * Getter for persistence unit name. | |
| 74 | - */ | |
| 75 | - // TODO Implementação apenas para manter a compatibilidade entre a versão 2.3 com a 2.4. | |
| 76 | - /** | |
| 77 | - * @deprecated | |
| 78 | - * @return | |
| 79 | - */ | |
| 80 | - @Deprecated | |
| 81 | - public String getPersistenceUnitName() { | |
| 82 | - return persistenceUnitName; | |
| 83 | - } | |
| 84 | 59 | |
| 85 | 60 | /** |
| 86 | 61 | * Getter for persistence unit name. |
| 87 | 62 | */ |
| 88 | 63 | public String getDefaultPersistenceUnitName() { |
| 89 | - // TODO Implementação apenas para manter a compatibilidade entre a versão 2.3 com a 2.4. | |
| 90 | - if (!Strings.isEmpty(getPersistenceUnitName())) { | |
| 91 | - Logger logger = Beans.getReference(Logger.class); | |
| 92 | - logger.warn("A propriedade frameworkdemoiselle.persistence.unit.name=" | |
| 93 | - + getPersistenceUnitName() | |
| 94 | - + " não será suportada nas próximas versões do framework. Para evitar futuros problemas atualize a propriedade para frameworkdemoiselle.persistence.default.unit.name=" | |
| 95 | - + getPersistenceUnitName()); | |
| 96 | - | |
| 97 | - return getPersistenceUnitName(); | |
| 98 | - } | |
| 99 | - | |
| 100 | 64 | return defaultPersistenceUnitName; |
| 101 | 65 | } |
| 102 | 66 | |
| 103 | 67 | /** |
| 104 | - * <p>Defines the scope of {@link EntityManager}'s produced by the internal producer.</p> | |
| 105 | - * | |
| 106 | - * <p>Valid values are NOSCOPE,REQUEST,SESSION,VIEW,CONVERSATION and APPLICATION.</p> | |
| 107 | - * | |
| 108 | - * <p>NOSCOPE means every injected entity manager will be a different instance.</p> | |
| 109 | - * | |
| 110 | - * <p>The default value is REQUEST, meaning the producer will create the same | |
| 111 | - * entity manager for the duration of the request.</p> | |
| 112 | - * | |
| 68 | + * <p> | |
| 69 | + * Defines the scope of {@link EntityManager}'s produced by the internal producer. | |
| 70 | + * </p> | |
| 71 | + * <p> | |
| 72 | + * Valid values are NOSCOPE,REQUEST,SESSION,VIEW,CONVERSATION and APPLICATION. | |
| 73 | + * </p> | |
| 74 | + * <p> | |
| 75 | + * NOSCOPE means every injected entity manager will be a different instance. | |
| 76 | + * </p> | |
| 77 | + * <p> | |
| 78 | + * The default value is REQUEST, meaning the producer will create the same entity manager for the duration of the | |
| 79 | + * request. | |
| 80 | + * </p> | |
| 113 | 81 | */ |
| 114 | 82 | public EntityManagerScope getEntityManagerScope() { |
| 115 | 83 | return entityManagerScope; |
| ... | ... | @@ -123,9 +91,8 @@ public class EntityManagerConfig implements Serializable { |
| 123 | 91 | * Supported scopes for the entity manager |
| 124 | 92 | * |
| 125 | 93 | * @author serpro |
| 126 | - * | |
| 127 | 94 | */ |
| 128 | - public enum EntityManagerScope{ | |
| 129 | - NOSCOPE,REQUEST,SESSION,VIEW,CONVERSATION,APPLICATION; | |
| 95 | + public enum EntityManagerScope { | |
| 96 | + NOSCOPE, REQUEST, SESSION, VIEW, CONVERSATION, APPLICATION; | |
| 130 | 97 | } |
| 131 | 98 | } | ... | ... |