Commit Graph

325 Commits

Author SHA1 Message Date
Oliver Gierke
149cfa068c DATACMNS-182 - Added test case showing query method parsing works as expected. 2012-06-08 12:11:30 +02:00
Oliver Gierke
031129e461 DATACMNS-180 - Don't consider Java transient fields transient for persistence.
So far we have considered Java transient fields as transient through the isTransient() method on PersistentProperty. This resulted in the properties not being persisted eventually. We now consider all fields as non-transient by default as we actually have to persist them as the object cannot be re-created completely without doing so as the usage of the transient keyword might rely on the readObject(…) method inside the object which would actually reconstitute the transient field's state but we of course cannot call this method actually.
2012-06-06 12:33:17 +02:00
Oliver Gierke
e5c6af6b24 DATACMNS-179 - Defer adding initial entity set to AbstractMappingContext.
So far the domain classes to be added to the mapping context initially were added in afterPropertiesSet() of InitializingBean. This had the drawback that although the MappingContext is already set up properly the actual listeners of the events fired (e.g. index creating ones) might not have been set up properly. We list to the ContextRefreshedEvent indicating the entire ApplicationContext being set up completely. Thus all infrastructure components are set up properly and the timing issues doesn't exist anymore.
2012-06-04 12:24:10 +02:00
Oliver Gierke
31926a6299 DATACMNS-178 - Fixed dependency scope for JUnit.
Reduced scope of junit-dep dependency from compile to test.
2012-05-29 12:27:47 +02:00
Oliver Gierke
f2989f5836 DATACMNS-177 - Changed OSGi bundle identifier to org.sfw.data.core. 2012-05-23 18:13:14 +02:00
Oliver Gierke
1a24145ef9 DATACMNS-174 - Part.Type now exposes keywords. 2012-05-21 14:15:00 +02:00
Oliver Gierke
169bdfefaa DATACMNS-173 - Upgraded Maven Compiler and Surefire plugins.
Upgraded Surefire plugin to 2.12. Upgraded JUnit dependency to 4.10. Upgraded compiler plugin to 2.4.
2012-05-21 14:06:50 +02:00
Oliver Gierke
a7688b684c DATACMNS-172 - Improved handling of invalid PropertyPaths.
Introduced PropertyReferenceException to capture the invalid property and the base PropertyPath a property expression could be resolved into. Introduced getLeafProperty() to be able to access the leaf property of a property path being created.
2012-05-21 13:58:29 +02:00
Spring Buildmaster
b1d7e8927c DATACMNS-149 - Next development version. 2012-05-16 19:28:23 +02:00
Spring Buildmaster
9f48059bb5 DATACMNS-149 - Release version 1.3.0.RELEASE. 2012-05-16 10:15:47 -07:00
Oliver Gierke
7673567a8c DATACMNS-171 - Added isQueryForEntity() method to QueryMethod.
isQueryForEntity() returns true if the QueryMethod returns either a single entity, a collection or Page of those.
2012-05-16 14:27:53 +02:00
Oliver Gierke
0f7231ec01 DATACMNS-170 - Fixed potential NullPointerException in ReflectionEntityInstantiator.
Moved null-check before the attempt to make the discovered id field accessible.
2012-05-07 12:53:54 +02:00
Oliver Gierke
b8c2e625b3 Polished pom.xml.
Removed obsolete stuff as we're now deploying to Artifactory.
2012-05-07 09:46:26 +02:00
Oliver Gierke
e20938a3ae DATAMONGO-439 - Performance improvements in mapping subsystem.
Fixed minor performance problems discovered by the fix for DATAMONGO-439. We're now caching the information whether a constructor parameter is an enclosing class parameter. PersistentEntityParameterValueProvider is throwing an exception now if the parameter is not referring to a property of the entity (via the parameter name).
2012-05-03 17:25:51 +02:00
Spring Buildmaster
f67f9eb4c9 Prepare 1.3.0.BUILD-SNAPSHOT development. 2012-05-02 12:01:50 -07:00
Spring Buildmaster
a1a60f39f4 [artifactory-release] Release version 1.3.0.BUILD 2012-05-02 12:01:48 -07:00
Oliver Gierke
aec655a499 DATACMNS-167 - Improved Iterable handling in TypeDiscoverer.
If a type implemented Iterable<…> it was currently treated as a collection which might cause inappropriate conversion in the mapping sub-system. We now consider types collection like if they're either Iterable directly or assignable to Collection.
2012-05-02 20:55:30 +02:00
Oliver Gierke
5b0cb1a572 DATACMNS-166 - Improved API in Repositories / RepositoryFactoryInformation.
Renamed methods in RepositoryMetadata to be consistent with EntityMetadata. Changed return type of RepositoryMetadata.getIdType() to Class<? extends Serializable>. Changed RepositoryFactoryInformation interface to expose RepositoryInformation rather than just the repository interface. Added exposing the QueryMethod instances as well. Adapter Repositories wrapper and it's clients accordingly.
2012-05-02 19:49:11 +02:00
Oliver Gierke
7f6c03d36a DATACMNS-143 - Removed deprecations in MappingContextEvent. 2012-04-27 19:10:24 +02:00
Oliver Gierke
6a461c0a51 DATACMNS-161 - Upgrade to Querydsl 2.5.0.
Polished pom.xml a little.
2012-04-27 09:39:16 +02:00
Oliver Gierke
8448573c3e DATACMNS-158 - Test case failing to reproduce the ticket.
Added test case to show that invalid properties containing numeric digits do not cause a stack overflow.
2012-04-23 18:04:38 +02:00
Oliver Gierke
ddea8eda8f DATACMNS-157 - Query method lookup now only returns most specific method for overridden methods.
Supposed you have a base repository interface declaring a method:

interface BaseRepository<T, ID extends Serializable> extends Repository<T, ID> {

  T myGenericMethod();
}

as well as a concrete repository redeclaring this method to annotate a query on it:

interface ConcreteRepository extends BaseRepository<User, Long> {

  @Query("…")
  User myGenericMethod()
}

Until now we both returned the intermediate method as well as the concrete one which might cause failures as in this case a query derivation would be attempted for the intermediate method which will fail for obvious reasons. The fix now starts with looking up the most specific method when iterating over the repository's methods which causes the intermediate method to be skipped in case it was overridden.
2012-04-20 13:55:49 +02:00
Oliver Gierke
06dc1e5dba DATACMNS-156 - Removed deprecated persistence package. 2012-04-20 13:20:14 +02:00
Oliver Gierke
ecf3592d1f DATACMNS-153 - Fixed class loading issue in SimpleEntityPathResolver.
The path class is loaded using the domain class' class loader instead of the one of SimpleEntityPathResolver.
2012-04-20 13:01:10 +02:00
Oliver Gierke
f1516a96aa DATACMNS-154 - Fixed query method detection when re-declararing CrudRepositoryMethods.
With the fix for DATACMNS-151 we apparently broke the generic parameter type matching for methods that carry the domain class type parameter as argument. We now inspect the bound and make sure we compare the name of it if it's a TypeVariable or use the plain parameter type if its not.
2012-04-19 12:45:33 +02:00
Spring Buildmaster
91eef0e8a5 DATACMNS-148 - Next development version. 2012-04-16 11:55:00 +02:00
Spring Buildmaster
703b285962 Release version 1.3.0.RC1. 2012-04-16 11:54:50 +02:00
Oliver Gierke
81718ae373 DATACMNS-152 - Improved API in mapping subsystem.
PersistentProperty now exposes isEntity(). Mapping context now allows accessing a PersistentEntity referred to from a PersistentProperty. JavaDoc cleanups in MappingContext interface.
2012-04-14 13:27:50 +02:00
Oliver Gierke
67c8c53f5e DATACMNS-151 - Improve CrudRepository method signature generics.
Method signatures of save(…) methods in CrudRepository now return the concrete type passed in. This way subtypes can be persisted without casting the result back.

class Contact { … }
class Person extends Contact { … }

interface ContactRepository extends CrudRepository<Contact, Long> { … }

Before:

Person person = new Person();
person = (Person) repo.save(person);
         ^^^^^^^^

Now:

Person person = new Person();
person = repo.save(person);
2012-04-13 22:32:16 +02:00
Oliver Gierke
c158442dc7 DATACMNS-150 - Fixed potential ClassCastException in DomainClassConverter and -PropertyEditorRegistrar.
Introduced Repositories value object to easily access repository instances and EntityInformation objects registered in an ApplicationContext.
2012-04-13 21:18:07 +02:00
Oliver Gierke
aa12db22c0 DATACMNS-121 - Implement equals(…) and hashCode() of AbstractPersistentProperty.
Implemented equals(…) and hashCode() methods based on the field backing the property.
2012-04-11 21:00:03 +02:00
Oliver Gierke
f3d037ba7d DATACMNS-139 - Fixed potential StackOverflowException in PropertyPath.
When trying to access an inexistent property starting with an underscore (e.g. _id) PropertyPath.create(…) ran into a StackOverflowException. Changed the traversing regular expression to expect at least one capital letter for further traversals.
2012-04-11 18:18:58 +02:00
Oliver Gierke
109e7f903e DATACMNS-132 - Guard against untyped Maps and Collections in AbstractPersistentProperty.isEntity().
Just mentioned method threw a NullPointerException when the property was backed by an untyped Map or Collection as TypeInformation.getActualType() returns null in this case. Changed that to correctly return false.
2012-04-11 18:18:57 +02:00
Oliver Gierke
75c67f0b57 DATACMNS-124 - Removed accidentally committed code. 2012-04-11 18:18:43 +02:00
Oliver Gierke
a2e5cc439e DATACMNS-141 - Added Before and After as query parser keywords.
The query parser now supports After, IsAfter, Before and IsBefore as keywords. Added the Is* prefix to suitable keywords as well and refactored unit tests quite a bit to ease adding new keyword tests.
2012-04-09 17:39:16 +02:00
Oliver Gierke
b811fa3ea8 DATACMNS-124 - Added missing package-info.java files.
Polished JavaDocs. Polished MappingContextEvent and added deprecations to it to be cleaned up for 1.3.GA.
2012-04-04 17:39:30 +02:00
Oliver Gierke
5c248983d2 DATACMNS-120 - Added equals(…) and hashCode() methods to Parameter. 2012-04-03 10:32:52 +02:00
Oliver Gierke
cb375b250f DATACMNS-142 - Polished API of UserCredentials.
Added constant to represent no credentials. Removed empty constructor. Added methods to ask whether username or password is configured.
2012-04-02 15:24:09 +02:00
Oliver Gierke
b4d21008e3 DATACMNS-111 - Added query parser keywords StartingWith, EndingWith and Containing. 2012-03-21 16:41:51 +01:00
Oliver Gierke
8e52d75ca9 DATACMNS-135 - Added accessor for the underlying content to Revisions. 2012-03-21 12:38:12 +01:00
Oliver Gierke
9e44d587f8 DATACMNS-136 - Made some Spring dependencies optional in template.mf.
We have declared some Spring dependencies optional in the pom.xml file. I've changed the template.mf to declare the package dependencies of these artifacts as optional as well.
2012-03-20 11:45:21 +01:00
Oliver Gierke
f8d5e310a7 DATACMNS-135 - Added basic infrastructure to support historiography of data.
Added interfaces for common abstractions needed to implement historiography. A Revision is an entity associated with some RevisionMetadata. That in turn consists of a revision number and date at least and is backed by a implementation specific delegate. The Revisions wrapper class allows accessing the latest revision from a list of Revision instances no matter what order they are in. A RevisionRepository allows access the revision an entity was changed in the last time, access all Revisions of an entity as well as paged access to it.
2012-03-20 11:33:02 +01:00
Oliver Gierke
2f39b74cbc DATACMNS-133 - Fixed bean lookup in DomainClassConverter.
Previously DomainClassConverter looked up the RepositoryInformation instances from the entire BeanFactory hierarchy but only looked the actual repository up from the current BeanFactory and not the entire hierarchy. Fixed and added test case.
2012-03-20 11:03:51 +01:00
Oliver Gierke
c2fd1e255a DATACMNS-134 - Changed instantation infrastructure to be able to instantiate member types.
In case a member class is not static the compiler will either create a constructor with a parameter of the enclosing type or alter the existing ones to add a first parameter of that type. Thus when instantiating the class we need to detect that case and hand in the parent object as parameter value.

Updated PreferredConstructor and Parameter abstractions to allow detecting this case as well as the ParameterValueProvider abstraction to capture the parent object.
2012-03-09 15:06:06 +01:00
Oliver Gierke
9005e1903d DATACMNS-133 - Improved DomainClassConverter implementation.
DomainClassConverter now registers itself with the ConversionService handed into it. Added integration tests for lookup of RepositoryFactoryInformation.
2012-02-28 19:03:58 +01:00
Spring Buildmaster
3903fa7281 Next development version. 2012-02-07 11:23:22 -08:00
Spring Buildmaster
257d8af077 Release version 1.3.0.RELEASE. 2012-02-07 11:23:19 -08:00
Oliver Gierke
bfd306dba7 DATACMNS-131 - Formatting. 2012-02-03 12:07:56 +01:00
Oliver Gierke
4fcb4a7649 DATACMNS-131 - Polished pom.xml. 2012-02-03 12:07:41 +01:00
Oliver Gierke
01898131a6 DATACMNS-129 - Introduced CrudRepository.findAll(Iterable<ID> ids). 2012-02-02 18:29:30 +01:00