Commit Graph

50 Commits

Author SHA1 Message Date
Oliver Gierke
83f8306656 DATACMNS-19 - Refactored return type for Repository.findAll(…) and according methods to return Iterable instead of List. 2011-03-11 18:58:48 +01:00
Oliver Gierke
e00ca67a12 DATACMNS-20 - Renamed Repository.findById(…) to findOne(…).
Added some @SuppressWarnings where necessary.
2011-03-11 18:15:45 +01:00
Oliver Gierke
80359c4d07 DATAJPA-19 - Added Hades extensions module.
Added DomainClassPropertyEditor and DomainClassConverter to automatically bind domain classes to Spring MVC controller methods. Same applies to PageableArgumentResolver. Polished up some generics.

Introduced RepositoryFactoryInformation interface being implemented by RepositoryFactorySupport that allows the extension components to get access to the raw factories, access EntityInformation of it and then find out about the repository interface to lookup the actual repository instance.
2011-03-11 16:11:39 +01:00
Oliver Gierke
dd6e56d013 DATACMNS-14 - Fixed various issues in the poms.
Added Milestone repository to aspects module to find AspectJ 1.6.11.M2. Reduced logging dependencies to test scope, altered two classes to use SLF4J instead of Commons logging. Use Log4J 1.2.16 as this does not require explicit excludes for mail, JMS and JMX anymore.
2011-03-10 18:22:43 +01:00
Michael Hunger
ff2f593dd6 moved indexed 2011-03-09 23:01:07 +00:00
Oliver Gierke
e157f380bb DATADOC-34 - Infrastructure for callbacks on RepositoryQuery creation.
Introduced QueryCreationListener that allows plugging in functionality after a query was created.

Heavily refactored QueryMethod and RepositoryQuery subsystem. Splitted up simple EntityMetadata (domain class and potentially other stuff) from the more advanced methods like getId(Object) and isNew(…). QueryMethod now carries a type enum that allows switching over it to determine the execution. Beyond that QueryMethod now returns a EntityMetadata rather than a plain class. 

RepositoryQuery in turn exposes the query method. PartTree allows iterating over all contained Parts as well now. Introduced AbstractEntityInformation that regards an entity as new if its id is null. Simplified handling of RepositoryProxyPostProcessors and aligned them to QueryCreationListener handling.
2011-03-04 10:07:49 +01:00
Oliver Gierke
3a6113c5e8 Added toString methods to make debugging easier. 2011-03-02 11:14:50 +01:00
Oliver Gierke
cae2961275 DATACMNS-19 - Fixed PersistableEntityMetadata.
Added generics to PersistableEntityMetadata and let it being handed the actual domain class to return.
2011-03-02 09:03:25 +01:00
Oliver Gierke
695f4ca9c0 Fixed sorting not being applied if provided via method parameter.
AbstractQueryCreator now uses the Sort object from the parameters if the PartTree not already contains a Sort object (which got there due to a OrderBy directive in the method name).
2011-03-01 20:44:28 +01:00
Oliver Gierke
ff844d7cbc Changed getReturnedDomainClass to only resolve generic type for Collections and Pages. 2011-03-01 20:44:28 +01:00
Oliver Gierke
1b98d32a4f Extended resolveQuery of QueryLookupStrategy to take domain class as well. 2011-03-01 20:44:28 +01:00
Oliver Gierke
b0a04b16c6 Added getBindableValue(int index) to ParameterAccessor.
Adapted ParametersParameterAccessor accordingly.
2011-03-01 20:44:28 +01:00
Michael Hunger
c738effd39 fixed bug with stateholder holding onto the temporary state for too long 2011-03-01 13:43:32 +01:00
Oliver Gierke
20443bb4b6 DATACMNS-17 - Introduced metamodel for entities and repositories.
Unified IsNewAware and IdAware to EntityMetadata. Refactored base repository support to use this abstraction. Introduced RepositoryMetadata and DefaultRepositoryMetadata implementation to capture all the additional information that we need around a repository interface. Adapted factory API to use this abstraction. Opened up method parameter and return types to prepare enabling the usage of the infrastructure for interfaces that do not extend Repository interface.
2011-02-25 13:53:45 +01:00
Oliver Gierke
0721c7921c DATACMNS-16 - Added 'NotIn' keyword. 2011-02-23 10:23:09 +01:00
Oliver Gierke
7753b9b446 DATAJPA-28 - Changed invocation order of createIsNewStrategy(…).
Lazily initializing the IsNewAware on first access now as classes implementing the method might wanna delegate to a template method using a constructor parameter. If createIsNewStrategy(…) is called from our constructor already the subclasses additional constructor arguments are not available yet.
2011-02-22 21:52:17 +01:00
Oliver Gierke
dd45054da2 DATACMNS-16, DATAJPA-29 - Cleaned up Part class.
Removed operator property (as it was JPA specific) and added 'In' keyword.
2011-02-22 21:51:49 +01:00
Oliver Gierke
aeee6935f5 DATACMNS-15 - Added support to discover Distinct keyword.
Query method names now support Distinct in method name prefixes. Beyond that I laxed the prefix constraints a little so that it can potentially contain anything before a 'By' separator:

- findByLastname -> simply query
- findUsersByLastname -> simple query
- findUsersDistinctByFirstname -> distinct query
- findDistinctUsersByFirstname -> distinct query
- findDistinctByLastname -> distinct query
2011-02-21 19:07:22 +01:00
Oliver Gierke
a529e2cd8a DATADOC-24 - Refactored SimpleParameterAccessor to improve usability.
Extracted ParameterAccessor interface that uses a simple Iterator<Object> to traverse over bindable parameters. Renamed SimpleParameterAccessor to ParametersParameterAccessor to better reflect its specialty (improved JavaDoc according to this as well).
2011-02-16 20:30:14 +01:00
Oliver Gierke
f36dd1e459 Renamed generic type from PK to ID. 2011-02-09 16:35:17 +01:00
Oliver Gierke
1068f9dfb1 DATACMNS-13 - Removed registration of PersistenceExceptionTranslationPostProcessor.
Moved registration of PersistenceExceptionTranslationPostProcessor into JPA module as registering it for all repositories creates an unnecessary burden to repository implementations that to not need external exception translation but rather do it themselves already.
2011-01-27 14:48:06 +02:00
Oliver Gierke
467283325a DATACMNS-12 - Refactored transaction support of RepositoryFactoryBeanSupport into separate subclass.
As we will deal with data stores not supporting transactions we should not activate transactions by default. For persistence technologies providing transaction support there's TransactionalRepositoryFactoryBeanSupport now, which pretty much contains the functionality that formerly resided in RFBS.

Note this required changes in the namespace as well. Concrete persistence technology specific namespaces now have to choose between repository-attributes or transactional-repository-attributes attribute group whereas the latter contains the transaction-manager-ref attribute.
2011-01-26 17:43:17 +02:00
Oliver Gierke
0ab6b00549 Fixed JavaDoc of Page interface. 2011-01-25 17:34:23 +02:00
Oliver Gierke
312fad40e2 Fixed bug in OrderBySource.
OrderBySource can now take part in nested property resolving as well and correctly resolves properties containing a camel case letter.
2011-01-25 11:53:31 +02:00
Oliver Gierke
bd68d421da Ported bug fix for Hades #425 - PageRequest should reject 0 page size.
Applied patch provided by Stevo Slavic, thanks!
2011-01-21 02:03:02 +01:00
Michael Hunger
2f11dd80fd renamed Index.name to Index.indexName to avoid confusion with potential name property 2011-01-12 10:51:03 +01:00
Michael Hunger
7b70951b8d added type target and name property to @Indexed 2011-01-11 12:56:02 +01:00
Oliver Gierke
bc876b7584 Introduced Property abstraction for more sophisticated query method name parsing.
The newly introduced Property class allows to find nested property paths by splitting up the raw property name along its camel case parts and trying to find a valid property for the actual type we resolve the property in. Once one is found it will use the rest of the string and try to build nested properties from it.
2011-01-07 22:17:55 +01:00
Oliver Gierke
ca03775dae Fixed generics in RepositoryFactoryBeanSupport. 2011-01-05 21:11:08 +01:00
Oliver Gierke
aacb129658 Changed getFirstItem() of Pageable to getOffset(). 2010-12-29 18:03:34 +01:00
Oliver Gierke
5ce44ec4e7 Iterate over all methods to find potential base class methods. 2010-12-29 17:59:08 +01:00
Oliver Gierke
298695c901 Fixed some Findbugs issues.
Renamed finalize(…) in AbstractQueryCreator to complete(…).
2010-12-29 15:29:13 +01:00
Oliver Gierke
640388b83e Added package-info.java files to explain package purposes. 2010-12-29 14:43:00 +01:00
Oliver Gierke
36f4553be9 Removed obsolete class. 2010-12-29 14:42:37 +01:00
Oliver Gierke
f2a85beacb Cleaned up all license headers to align the exepected format. 2010-12-29 14:05:36 +01:00
Oliver Gierke
413341a1aa Extended callback methods to take repository interface into account when creating repository backing object.
As factory implementations might have to inspect the actual repository interface to select a concrete repository implementation, we have to hand the interface to the methods returning the class and returning the actual object.
2010-12-29 12:54:28 +01:00
Oliver Gierke
03bc52d137 Removed all references to 'DAO', 'hades' and 'Synyx'.
Polished JavaDoc here and there.
2010-12-29 12:52:58 +01:00
Oliver Gierke
3de3ef4955 Fixed placeholders in SLF4J logging statements (see Hades #417). 2010-12-27 15:26:44 +01:00
Oliver Gierke
df61026aaa Fixed RepositoryInterfaceAwareBeanPostProcessor.
Use correct bean type (FactoryBean instead of plain Factory) as well as the correct property (repositoryInterface).
2010-12-23 19:02:29 +01:00
Oliver Gierke
e1ffab6131 Simplified implementation of SimpleParameterAccessor.
Changed API of Parameters and Parameter class accordingly. Adapted test cases as well.
2010-12-07 20:47:28 +01:00
Oliver Gierke
a551a6a061 Improvements in AbstractRepositoryConfigDefinitionParser.
Slight modification to the callback that's called once per repositories root node. Clarified JavaDoc regarding it's purpose.
2010-12-06 21:19:03 +01:00
Oliver Gierke
2b7c555273 DATACMNS-10 - Made some QueryMethod methods public. 2010-12-02 19:26:22 +01:00
Oliver Gierke
4bd005d17b DATACMNS-10 - Introduce method name parser to build criteria based queries.
Minor tweaks to Parameter and Parameters to remove some JPA implications (1-based position indexes). Introduced PartTree abstraction that results from query parsing and allows simple API to traverse the query parts. Added AbstractQueryCreator to implement general traversing logic on PartTree and provide typed callback hooks for persistence technology specific creation of a criteria query.
2010-12-02 18:56:16 +01:00
Oliver Gierke
e82b896fa9 Refactored internal mechanism to resolve RepositoryQuery instances.
Simplified creation of RepositoryQuery instances by changing the QueryLookupStrategy interface method to take a plain Method instead of a QueryMethod. This way we get rid of an indirection where subclasses have to implement two methods (one creating a QueryMethod, one returning the QueryLookupStrategy). Thus a QueryLookupStrategy is responsible for creating RepositoryQueries from a Method and using a QueryMethod is an implementation detail of QueryLookupStrategy implementations actually.
2010-11-30 12:40:12 +01:00
Oliver Gierke
1c80a56626 Generified QueryLookupStrategy to allow type safe calls to resolveQuery(…) without the need for an explicit cast. 2010-11-29 23:00:41 +01:00
Oliver Gierke
6194acd825 Initial commit for repository abstraction.
Extracted common functionality from project Hades to build a common infrastructure for generic repository implementations independent of the underlying persistence mechanism. Fixes DATACMNS-2, DATACMNS-3, DATACMNS-4, DATACMNS-5, DATACMNS-6, DATACMNS-8, DATACMNS-9.
2010-11-28 18:15:38 +01:00
Thomas Risberg
b750d48df4 changed package name 2010-11-17 17:36:42 -05:00
Mark Pollack
46315f9916 Remove override annotation for building on Java 5 2010-11-09 11:44:12 -05:00
Thomas Risberg
dbe37a6d21 moved @Indexed to data-commons 2010-10-21 14:21:51 -04:00
Thomas Risberg
0f7984a331 Switched to use new project layout; updated build; moved files around 2010-10-07 12:14:39 -04:00