spring-projects / spring-data-jpa Goto Github PK
View Code? Open in Web Editor NEWSimplifies the development of creating a JPA-based data access layer.
Home Page: https://spring.io/projects/spring-data-jpa/
License: Apache License 2.0
Simplifies the development of creating a JPA-based data access layer.
Home Page: https://spring.io/projects/spring-data-jpa/
License: Apache License 2.0
Oliver Drotbohm opened DATAJPA-38 and commented
Referenced from: commits 53c3cf9
1 votes, 3 watchers
Oliver Drotbohm opened DATAJPA-37 and commented
In Spring Data Commons we have a @PersistenceConstructor
annotation that demarcates the constructor to be used when instantiating objects. It would be cool if the query methods and maybe even findOne(…)
being able to detect that annotation and force the persistence provider to use that constructor (probably by using the Criteria API)
No further details from DATAJPA-37
Oliver Drotbohm opened DATAJPA-19 and commented
In Hades there is an extension module that includes some integration into Spring MVC that makes a few things quite easy.
First, it provides a custom WebArgumentResolver
to automatically parse pagination information from the HttpServletRequest
so that one can simply refer to it from a controller method:
public String showUsers(Model model, Pageable pageable) {
model.addAttribute("users", repository.readAll(pageable));
return "users";
}
Second there's a PropertyEditor
and Converter
implementation that is aware of all the repositories residing in an ApplicationContext
so that we can provide a WebArgumentResolver
to directly get a loaded entity injected into the controller method instead of injecting the id
and the developer needing to manually load the entity:
@RequestMapping("/users/{id}")
public String showUser(@PathVariable("id") User user) {
...
}
Where to put that code? Introducing a dependency towards the web module of Spring is not a good idea. So we have to come up with either a separate module in the same repo or have a separate repo even
Affects: 1.0 M1
Attachments:
jokeway opened DATAJPA-18 and commented
The Respository customImplementation is very common of using @PersistenceContext
and @Transactional
to handle custom method. So the customImplementation should inject the 'right' transactionManager (as same as <jpa:repositories /> config).
Use the default spring processing to create the bean is the simplest way, but also lost configurable.So I think we should 'replace' the customImplementation's PersistenceContext and Transactional by the <jpa:repositories /> config, especially when using the AutomaticJpaRepositoryConfigInformation.
3 votes, 4 watchers
Pablo Alcaraz opened DATAJPA-33 and commented
Junit dependency has the compile scope.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
It would have to be
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
Affects: 1.0 M1
Rain Wang opened DATAJPA-15 and commented
My App has a transactionMangername that is not a "transactionManager" name, I had set the the attribute of the entity-manager-factory-ref, but the app still scan the "tranactionManager"
Attachments:
Issue Links:
Referenced from: commits b884e73
1 votes, 1 watchers
Oruganti Shanker opened DATAJPA-36 and commented
According to the spring-data-jpa documentation, one can create custom repostories using the factory-class attribute and passing it to the repositories tag.
Example 1.16. Using the custom factory with the namespace
<repositories base-package="com.acme.repository"
factory-class="com.acme.MyRepositoryFactoryBean" />
However, when I try to do so, the parser gives the exception:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'factory-class' is not allowed to appear in element 'jpa:repositories'.
How do I add custom repositories?
The xml file has:
<jpa:repositories base-package="com.shutterfly.....repository"
factory-class="....jpa.repository.custom.CustomJpaRepositoryFactoryBean" />
Affects: 1.0 M1
Thomas Risberg opened DATAJPA-24 and commented
Should spring-jpa-1.0.xsd reference spring-repository-1.0.xsd instead of spring-repository.xsd
Affects: 1.0 M1
Attachments:
Issue Links:
Referenced from: commits 3580817
1 votes, 1 watchers
Oliver Drotbohm opened DATAJPA-12 and commented
The Sort
implementation in the core handles String
properties. As JPA 2.0 provides a meta model to define properties in a type-safe manner we should add a subclass of Sort
to rather use these properties. A QueryDsl implementation should be added also
Issue Links:
DATACMNS-402 Add support for sorting by a QueryDSL OrderSpecifier
DATAJPA-8 Integration of QueryDsl library
Referenced from: commits 5d6e44d, 1d6806b, 3110b4d, 692b238, 8668e01, 730e688
6 votes, 7 watchers
Oliver Drotbohm opened DATAJPA-3 and commented
There's quite comprehensive Docbook based reference documentation for the Hades project that we should migrate as well
This issue is a sub-task of DATAJPA-1
Referenced from: commits 8d2845c
Oliver Drotbohm opened DATAJPA-30 and commented
We should implement JPA support for the In-keyword
Issue Links:
Gordon Dickens opened DATAJPA-26 and commented
Unable to build with Maven version 3.0.2. Some, dependencies will not resolve. Possibly updating Maven plugin versions would remedy this issue, as I am typically able to build any Spring 3.0 - 3.1 project with current Maven plugins.
Affects: 1.0 M1
Attachments:
Oruganti Shanker opened DATAJPA-11 and commented
I downlaoded the spring-data-jpa and ran the sample UserRepositoryFinderTests application with both the embedded HSQL DB and against Oracle. The test against Oracle ran into a problem because the class User needed a table named USER, and the generated SQL for inserting into this table was giving errors, because the name USER is apparently reserved, and the SQL statement should qualify the table name with the schema name. It may be a good idea to rename the User class so that the sample works out of the box with Oracle. Everything worked fine when I changed the class name, e.g., when User is renamed to JPAUser
No further details from DATAJPA-11
GWA opened DATAJPA-50 and commented
When I want to create a JpaRepository
with an Entity like this:
@Entity
@IdClass(MyEntityPK)
public class MyEntity{
@Id private String parent;
@Id private int order;
…
}
MyEntityPK
is a simple bean with String parent;
int order;
. Then i get the following error :
java.lang.IllegalStateException: No supertype found
at org.hibernate.ejb.metamodel.AbstractIdentifiableType.requireSupertype(AbstractIdentifiableType.java:74)
at org.hibernate.ejb.metamodel.AbstractIdentifiableType.getIdType(AbstractIdentifiableType.java:162)
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:65)
at org.springframework.data.jpa.repository.utils.JpaClassUtils.getMetadata(JpaClassUtils.java:103)
Affects: 1.0 M2
Attachments:
Referenced from: commits 3962f1a
13 votes, 18 watchers
Oliver Drotbohm opened DATAJPA-32 and commented
Affects: 1.0 M1
Attachments:
Issue Links:
Oliver Drotbohm opened DATAJPA-29 and commented
When using pagination with a query method the returned Page
's metadata is invalid. The total number of pages gets calculated wrongly
Reference URL: http://forum.springsource.org/showthread.php?t=104016
Attachments:
Referenced from: commits 14a69ea
Gordon Dickens opened DATAJPA-27 and commented
With a clean repository and Maven 2.2.1, build fails - see attached file. Ensure that all dependencies are available in the SpringSource Milestone & Snapshot repositories.
Affects: 1.0 M1
Attachments:
Referenced from: commits d4fe867
Mark Pollack opened DATAJPA-2 and commented
See discussion in https://fisheye.springsource.org/cru/DATA-JPA-CR-3#c610
Attachments:
Issue Links:
Referenced from: commits e8c5666
Andres March opened DATAJPA-44 and commented
We are migrating from Hades and were very surprised to find exceptions in the JPA NamedQuery parsing. The queries are defined on the entities. The ones triggering the exceptions do not return entities. I think that this is permitted by the specification and did work fine with Hades and Hibernate. Here is an example:
@NamedQuery(name = "CountryAgreement.getLatestAgreementVersion", query = "select max(version) from CountryAgreement c where c.country.id = ?1 ")
The repository method Long getLatestAgreementVersion(Long countryId);
and exception:
Caused by: java.lang.IllegalArgumentException: No property getLatestAgreement found for type class java.lang.Long
at org.springframework.data.repository.query.parser.Property.<init>(Property.java:66)
at org.springframework.data.repository.query.parser.Property.<init>(Property.java:100)
at org.springframework.data.repository.query.parser.Property.create(Property.java:302)
at org.springframework.data.repository.query.parser.Property.create(Property.java:268)
at org.springframework.data.repository.query.parser.Property.from(Property.java:227)
at org.springframework.data.repository.query.parser.Property.from(Property.java:215)
at org.springframework.data.repository.query.parser.Part.<init>(Part.java:48)
at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:242)
at org.springframework.data.repository.query.parser.PartTree.buildTree(PartTree.java:101)
at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:77)
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:51)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:100)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:176)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:73)
at org.springframework.data.repository.support.RepositoryFactorySupport$QueryExecuterMethodInterceptor.<init>(RepositoryFactorySupport.java:259)
at org.springframework.data.repository.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:143)
at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:107)
at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:36)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 36 more
Affects: 1.0 M2
Attachments:
Referenced from: commits c2b7047
Rain Wang opened DATAJPA-9 and commented
I am using spring-data-jpa in my projects. I can set the auditor to the createdBy
and lastModifiedBy
by the AuditorAware
interface, but I want to set database time to the createdDate
and lastModifiedDate
. Could you please add an attribute to the jpa namespace element to set the dates, and add a DateAware
interface?
Attachments:
Referenced from: commits 9ae8caa, c919e2a
1 votes, 0 watchers
Oliver Drotbohm opened DATAJPA-43 and commented
With M2 we have changed the way to work with Specification
objects (to align the model to the newly introduced Querydsl support). We have to update the reference documentation to reflect those changes
Affects: 1.0 M2
Referenced from: commits 9023b2e
Stevo Slavić opened DATAJPA-23 and commented
In JpaQueryCreator
's toPredicate(…)
method instead of following lines
case IS_NULL:
return root.isNull();
case IS_NOT_NULL:
return root.isNotNull();
should be
case IS_NULL:
return path.isNull();
case IS_NOT_NULL:
return path.isNotNull();
Affects: 1.0 M1
Attachments:
Referenced from: commits 23fd134
1 votes, 1 watchers
Clinckart Stéphane opened DATAJPA-6 and commented
Thanks :-)
Affects: 1.0 M1
Reference URL: http://redmine.synyx.org/boards/2/topics/196?r=198#message-198
Issue Links:
Oliver Drotbohm opened DATAJPA-17 and commented
There's the Hades sample application (currently included with the Hades release train) and a showcase project at github that should be ported to Spring Data JPA
This issue is a sub-task of DATAJPA-1
Oliver Drotbohm opened DATAJPA-7 and commented
The auditing capabilities currently serve rudimentary requirements of tracking who created and modified entities. However there are more sophisticated frameworks like Hibernate Envers out there that transparently create revisions for all entities saved and allows accessing those in direct entity access as well as triggering queries on a particular revision. So a potential support for something like this is two fold. First we have to have an extension of Repository
interface with methods like:
T findById(ID id, Object revision);
List<T> findAll(Object revision);
On the other hand the query execution engine could be made aware of the revision a query shall be run against:
List<User> findByUsername(String username, @Revision Object revision);
As Envers is just one potential candidate we'd have to make the actual versioning library pluggable
Issue Links:
5 votes, 7 watchers
Oliver Drotbohm opened DATAJPA-4 and commented
The JPA query method name parsing currently builds a String
based query and includes a lot of the actual parsing logic. As this will be moved into the core with DATACMNS-10 we should refactor the JPA based implementation to use this one rather than a string based query
Issue Links:
Stevo Slavić opened DATAJPA-22 and commented
For some EntityManager
methods, like flush, default JpaRepository
implementation, SimpleJpaRepository
, just delegates to wrapped EntityManager
instance. Others like clear are not (easily) accessible (see referenced forum topic for use case details). So either wrap and expose EntityManager API, or provide accessor to EntityManager
in JpaRepository interface
Affects: 1.0 M1
Reference URL: http://redmine.synyx.org/boards/2/topics/231
Stevo Slavić opened DATAJPA-21 and commented
Eclipse can't validate spring context files which reference http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd since it's not available. Would have to manually create XML catalog entry. spring-security-3.1.xsd is already available even though Spring Security 3.1 is in RC status, so it seems to be a common practice to have XSD published even if it might change til final release
Affects: 1.0 M1
Issue Links:
2 votes, 2 watchers
Oliver Drotbohm opened DATAJPA-1 and commented
Sub-tasks:
DATAJPA-3 Port Hades reference documentation
DATAJPA-16 Port sample projects
DATAJPA-17 Port sample projects
Issue Links:
DATAJPA-2 JpaRepository should contain a findOne method that take a Specification object
DATACMNS-1 Introduce support for building repositories from Hades library
2 votes, 1 watchers
Hi,
I'm likely to use spring-data-jpa but :
One solution would be to provide my own CustomGenericJpaRepository but I have no access to the parent's entityManager in this class.
I can't say for sure but, AFAIK "isNew()" method is used to know if we should invoke a "persist" ou a "merge" in the "SimpleJpaRepository.save" method. I suppose we could invoke a merge in any case and that would work. Can you explain why the "isNew()" method is so important ?
Bests Regards
Stevo Slavić opened DATAJPA-51 and commented
Currently Specification API does not support search to return anything other than instance of query root (or some collection of root) JPA entity as result. But JPA itself supports result to be different class from query root and it typically isn't an entity bean class (see here and here).
Please add support for complex queries with search result classes different from Specification query root
Affects: 1.0 M2
42 votes, 25 watchers
Oliver Drotbohm opened DATAJPA-14 and commented
We should integrate query validation for String based queries
Affects: 1.0 M1
Attachments:
Stevo Slavić opened DATAJPA-35 and commented
Query like "SELECT u FROM User u JOIN FETCH u.roles r" doesn't work if repository/DAO method returns org.springframework.data.domain.Page - library tries to calculate total count with additional query "select count(u) FROM foo.bar.User u JOIN FETCH u.roles r" which throws "org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list"
Affects: 1.0 M1
4 votes, 5 watchers
Stevo Slavić opened DATAJPA-46 and commented
Already on many places in Spring like in @MVCs
@RequestParam
, param name is taken from debug info, so explicitly setting value attribute of annotation is not required. Hopefully same principle can be applied for @Param
, to remove need for specifying @Param
's value attribute in cases (and IMO that's majority) when method parameter name and @Param
name are same
Affects: 1.0 M2
Issue Links:
Andres March opened DATAJPA-45 and commented
ClassCastException on getReturnedDomainClass for parametrized types.
The query:
@NamedQuery(name = "ContentFlag.getNewFlagCountByReasonForTitleId", query = "select new map ( c.reason as reason, count(*) as numFlags ) "
+ "from ContentFlag c where c.content.title.id = ?1"
+ " and (c.dateFlagSet > c.content.statistics.dateFlagCleared or c.content.statistics.dateFlagCleared is null) "
+ "group by c.reason")
The method:
public abstract java.util.List com.qualcomm.qis.plaza.repo.ContentFlagRepository.getNewFlagCountByReasonForTitleId(java.lang.Long)
The actual return type:
java.util.List<java.util.Map<java.lang.String, java.lang.Object>>
The line where the exception is thrown:
return (Class<?>) ((ParameterizedType) type)
.getActualTypeArguments()[0];
The exception:
Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class
at org.springframework.data.repository.util.ClassUtils.getReturnedDomainClass(ClassUtils.java:63)
at org.springframework.data.repository.query.QueryMethod.getDomainClass(QueryMethod.java:107)
at org.springframework.data.jpa.repository.query.JpaQueryMethod.getNamedQueryName(JpaQueryMethod.java:126)
at org.springframework.data.jpa.repository.query.NamedQuery.lookupFrom(NamedQuery.java:71)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$DeclaredQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:132)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:73)
at org.springframework.data.repository.support.RepositoryFactorySupport$QueryExecuterMethodInterceptor.<init>(RepositoryFactorySupport.java:259)
at org.springframework.data.repository.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:143)
at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:107)
at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:36)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 36 more
Referenced from: commits spring-projects/spring-data-commons@680a74c
Oliver Drotbohm opened DATAJPA-16 and commented
There's the Hades sample application (currently included with the Hades release train) and a showcase project at github that should be ported to Spring Data JPA
This issue is a sub-task of DATAJPA-1
Chris Roberts opened DATAJPA-49 and commented
API changes made in M2 cause a some compile errors in the spring data jpa sample.
https://github.com/SpringSource/spring-data-jpa-examples/tree/master/spring-data-jpa-showcase
including the static create method on org.springframework.data.jpa.repository.support.SimpleJpaRepository
userRepository = new SimpleJpaRepository.create(User.class, em);
Perhaps changed to :
userRepository = new SimpleJpaRepository(JpaClassUtils.getMetadata(User.class,em), em);
and findById usage replaced by findOne
Affects: 1.0 M2
Oruganti Shanker opened DATAJPA-13 and commented
When I call findOne with a JpaRepository working against an Oracle DB, I get an "result returns more than one elements" exception. Instead of an exception, I would expect the findOne method to return one of the records matching the specification, as Mongo does.
Outline of code:
JpaRepository repository = ....;
Specification spec =...;
return repository.findOne(spec);
Exception:
Exception in thread "main" com.shutterfly.platform.infrastructure.dal.MDBFactoryBean$1: result returns more than one elements
at com.shutterfly.platform.infrastructure.dal.MDBFactoryBean.translateExceptionIfPossible(MDBFactoryBean.java:11)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
....
Attachments:
Referenced from: commits d108bc9
Stevo Slavić opened DATAJPA-48 and commented
JpaSpecificationExecutor public API has support for various combination of Specification
, Sort
, and Pageable
. One is missing tho, findAll(Specification<T>, Sort)
. private TypedQuery<T> getQuery(Specification<T> spec, Sort sort)
in JpaSpecificationExecutor
already has everything to support exposing such API.
Attached patch [^DATAJPA-Adds-support-for-finding-by-spec-and-sort.patch] adds List<T> findAll(Specification<T> spec, Sort sort);
to JpaSpecificationExecutor
interface, appropriate implementation in SimpleJpaRepository
and a test case.
Patch also configures project pom to add generated test source directory as maven test source directory using build-helper-maven-plugin. With this and m2eclipse configured to run "process-test-classes" goal on project import or when updating eclipse project configuration, project tests could compile
Affects: 1.0 M2
Reference URL: http://forum.springframework.org/showthread.php?p=356230
Attachments:
Referenced from: commits c4a7114
I'm currently implementing a CascadeBulkDeleteJPARepostory to rectify a problem we are having with bulk deletes not removing @EmbeddedCollections. This is a well known problem (see http://stackoverflow.com/questions/3903202/how-to-do-bulk-delete-in-jpa-when-using-element-collections) and am overwriting the SimpleJPARepository to fix such a problem (temporarily just by performing deleteAll(Collection) at this stage). But I would find it beneficial to have access to the variables set by the constructor (at least in 1.0.0.M2).
Now obviously I currently maintain a reference to the objects in my implementation but providing a:
EntityManger getEntityManager()
and
JpaEntityInformation<T, ID> getEntityMetadata()
in the SimpleJPARepostory would be quite useful for such cases.
Thanks & great work.
Jean-Pierre Bergamin opened DATAJPA-42 and commented
We'd like to see the spring data JPA project to be released as an OSGi bundle
Affects: 1.0 M2
Referenced from: commits 010f844
Oliver Drotbohm opened DATAJPA-20 and commented
The keyword reference in the Query creation section of the reference documentation shows an invalid sample query for the OrderBy
clause:
... where x.age > ?1 order by x.lastname desc
should be
... where x.age = ?1 order by x.lastname desc
Affects: 1.0 M1
Attachments:
Referenced from: commits e5b31d6
Ralph Schaer opened DATAJPA-39 and commented
I needed a projection method in all my repositories. Therefore I created an interface
@NoRepositoryBean
public interface MyRepository<T, ID extends Serializable> extends JpaRepository<T, ID>, QueryDslPredicateExecutor<T> {
public List<Object[]> findAll(Predicate predicate, Expression<?> first, Expression<?> second, Expression<?>... rest);
}
and the corresponding implementation.
public class MyRepositoryImpl<T, ID extends Serializable> extends QueryDslJpaRepository<T, ID> implements MyRepository<T, ID> {
...
@Override
public List<Object[]> findAll(Predicate predicate, Expression<?> first, Expression<?> second, Expression<?>... rest) {
return createQuery(predicate).list(first, second, rest);
}
...
}
Together with a FactoryBean
and a Factory
everything works fine. The only problem I had was that everything in QueryDslJpaRepository
is private. So I had to copy a lot of code from the superclass into my implementation because I wanted to use the createQuery(…)
method.
Is it possible to make QueryDslJpaRepository
more subclass friendly by makeing the createQuery(…)
method protected?
Ralph
Affects: 1.0 M2
Attachments:
Referenced from: commits 483baa4
Hi
I created my own Repository interface
public interface MyRepository<T, ID extends Serializable> extends JpaRepository<T, ID>, QueryDslPredicateExecutor {...}
and the corresponding implementation
public interface MyRepository<T, ID extends Serializable> extends JpaRepository<T, ID>, QueryDslPredicateExecutor {...}
Together with a FactoryBean and a Factory everything works fine. The only problem I had was that everything in QueryDslPredicateExecutor is private. So I had to copy a lot of code from this class into my implementation because I wanted to use the createQuery method. Is it possible to make QueryDslPredicateExecutor more subclass friendly or is this a bad idea?
Ralph
Oliver Drotbohm opened DATAJPA-5 and commented
We could leverage JSR-330 @Named
annotation to explicitly mark named parameters instead of our own @Param
annotation
No further details from DATAJPA-5
Dragan Gajic opened DATAJPA-31 and commented
The default value of clearAutomatically
element of @Modifying
is true
, which result in clearing persistent context after execution of query. If this modifying query is part of sequence of other update operations, for example when in the service layer we combine calls to several DAOs, clearing persistent context by default can lead to unexpected results. Since the service layer methods are usually bounded by transaction, which end is trigger for synchronization all update operations (merge) before modifying query may be loss because of the cleared persistence context.
I believe this is not uncommon situation, so in that sense maybe it is more appropriate to have this option as false by default.
Affects: 1.0 M1
Referenced from: commits 762e57c
Gordon Dickens opened DATAJPA-25 and commented
The version of SLF4J 1.5 is 2 years old and should be updated to use 1.6.1 or better
Affects: 1.0 M1
Attachments:
Referenced from: commits 3fb929a
Jon Lorusso opened DATAJPA-47 and commented
When I attempt to load Spring Data JPA on the appengine:
WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fooRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel;:
java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel;
at org.springframework.data.jpa.repository.utils.JpaClassUtils.getMetadata(JpaClassUtils.java:97)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:162)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:91)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:72)
at org.springframework.data.repository.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:132)
at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:107)
at org.springframework.data.repository.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:36)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$2.run(FactoryBeanRegistrySupport.java:133)
Affects: 1.0 M2
Oliver Drotbohm opened DATAJPA-8 and commented
The QueryDSL library offers a fluent interface for building type safe (JPA) queries. The API looks a lot smoother than the JPA Criteria API so that an integration would be quite a cool thing. I can imagine collaboration in the following areas:
We could offer an alternative to the standard JPA Criteria API based Specifications as the implementations should become much nicer with Querydsl. So we could have something like this:
public interface QueryDslSpecificationExecutor<T> {
T findAll(QueryDslSpecification<T>);
// further Specification executing methods like in JpaRepository
}
We could create a QueryDsl specific subclass of SimpleJpaRepository
and use this subclass in case the entity specific repository interface implements this 'mixin' so to speak.
To ease building queries with QueryDsl we could provide a base class that gets an EntityManager
injected and allows to create queries via a helper method. This class could be used for custom repository implementations then.
Issue Links:
DATAJPA-12 Add Sort implementations that use JPA Metamodel API and/or QueryDsl API
DATAMONGO-41 Prototype QueryDsl integration for repositories
Referenced from: commits a631572
6 votes, 5 watchers
Oliver Drotbohm opened DATAJPA-28 and commented
Currently ReflectiveEntityInformation
manually parses Id
and EmbeddedId
annotations to find the entity's id field or method. Unfortunately this excludes users using XML to map their entities. We should rather use the JPA 2.0 metamodel API to lookup the id fields. To do so we also should create a template method that gets the EntityManager
to create an IsNewAware
as well. Beyond that we could probably get rid of JpaRepositorySupport
entirely
Affects: 1.0 M1
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.