[jira] [Commented] (DELTASPIKE-940) @Transactional and @EntityManagerConfig each use a different method to resolve EntityManagers

2016-01-21 Thread Xavier Dury (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15110440#comment-15110440
 ] 

Xavier Dury commented on DELTASPIKE-940:


Now I realize that there is an advantage using {{EntityManagerResolver}} 
instead of qualifiers: with qualifiers, you need to {{@Produces}} the entity 
manager which can cause trouble if it belongs to a passivation-capable scope 
(see {{SerializableEntityManager}}). The problem does not exist with 
{{EntityManagerResolver}} which does not produce anything but keeps the entity 
manager reference for on-demand resolving. So maybe, it is the 
{{@Transactional}} annotation which should have an {{entityManagerResolver}} 
attribute.

> @Transactional and @EntityManagerConfig each use a different method to 
> resolve EntityManagers
> -
>
> Key: DELTASPIKE-940
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-940
> Project: DeltaSpike
>  Issue Type: Improvement
>  Components: Data-Module, JPA-Module
>Reporter: Xavier Dury
>Assignee: Thomas Hug
>Priority: Minor
>
> When an application uses multiple {{EntityManager}}'s, there must be a way to 
> specify which one(s) should be used. Currently, {{@Transactional}} and 
> {{@EntityManagerConfig}} use different approaches:
> - {{@Transactional}} can take one or more qualifiers directly in its 
> {{qualifier()}} member ({{@Transactional(qualifier = MyDB.class)}})
> - While {{@EntityManagerConfig}} must define an {{EntityManagerResolver}} 
> ({{@EntityManagerConfig(entityManagerResolver = 
> MyDBEntityManagerResolver.class}})
> I think both should be unified and use a single way to specify which 
> {{EntityManager}} to use. IMHO, the {{@Transactional}} way of doing looks 
> better and should be applied to {{@EntityManagerConfig}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (DELTASPIKE-1036) Repositories should support java.util.Optional as return type

2015-12-03 Thread Xavier Dury (JIRA)
Xavier Dury created DELTASPIKE-1036:
---

 Summary: Repositories should support java.util.Optional as return 
type
 Key: DELTASPIKE-1036
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1036
 Project: DeltaSpike
  Issue Type: Improvement
  Components: Data-Module
Reporter: Xavier Dury
Priority: Minor


I don't know what is deltaspike's strategy regarding support of java 8 features 
but it would be nice if repositories could use Optional as return type.

When using @Query, there would be no need to specify singleResult = OPTIONAL.

It would be nice if deltaspike could gradually support java 8 features a bit 
like how spring does (if java.util.Optional is present on the classpath, then 
it can be used in various places, otherwise features relying on it are not 
usable).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (DELTASPIKE-940) @Transactional and @EntityManagerConfig each use a different method to resolve EntityManagers

2015-06-29 Thread Xavier Dury (JIRA)
Xavier Dury created DELTASPIKE-940:
--

 Summary: @Transactional and @EntityManagerConfig each use a 
different method to resolve EntityManagers
 Key: DELTASPIKE-940
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-940
 Project: DeltaSpike
  Issue Type: Improvement
  Components: Data-Module, JPA-Module
Reporter: Xavier Dury
Priority: Minor


When an application uses multiple {{EntityManager}}'s, there must be a way to 
specify which one(s) should be used. Currently, {{@Transactional}} and 
{{@EntityManagerConfig}} use different approaches:


- {{@Transactional}} can take one or more qualifiers directly in its 
{{qualifier()}} member ({{@Transactional(qualifier = MyDB.class)}})
- While {{@EntityManagerConfig}} must define an {{EntityManagerResolver}} 
({{@EntityManagerConfig(entityManagerResolver = 
MyDBEntityManagerResolver.class}})

I think both should be unified and use a single way to specify which 
{{EntityManager}} to use. IMHO, the {{@Transactional}} way of doing looks 
better and should be applied to {{@EntityManagerConfig}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (DELTASPIKE-910) Add EntityRepository.getPrimaryKey(E entity)

2015-05-22 Thread Xavier Dury (JIRA)
Xavier Dury created DELTASPIKE-910:
--

 Summary: Add EntityRepository.getPrimaryKey(E entity)
 Key: DELTASPIKE-910
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-910
 Project: DeltaSpike
  Issue Type: New Feature
  Components: JPA-Module
Reporter: Xavier Dury
Priority: Trivial


It would be nice to add a method to retrieve the primary key of an entity on 
its {{EntityRepository}} (by using 
{{entityManagerFactory.getPersistenceUnitUtil().getIdentifier(entity)}}).

This would help implementing generic JSF {{DataModel}} based on 
{{EntityRepository}}, especially for methods like {{getRowKey()}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)