/*
 * Copyright (c) 2013 Red Rainbow IT Solutions GmbH, Germany
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package org.jeecqrs.common.persistence.jeeventstore;

import org.jeecqrs.common.domain.model.AbstractEventSourcedAggregateRoot;

/**
 *
 * @param <T>  the aggregate type
 */
public abstract class AbstractJEEventStoreARRepository<T extends AbstractEventSourcedAggregateRoot> 
    extends AbstractJEEventStoreRepository<T> {

}

@@ -1190,16 +1190,52 @@
 store;%0A%0A
+import org.jeecqrs.common.Identity;%0A
 import o
@@ -1299,16 +1299,57 @@
 ateRoot;
+%0Aimport org.jodah.typetools.TypeResolver;
 %0A%0A/**%0A *
@@ -1383,16 +1383,74 @@
 te type%0A
+ * @param %3CID%3E  the type used to identify aggregate roots%0A
  */%0Apubl
@@ -1466,17 +1466,17 @@
 ct class
- 
+%0A
 Abstract
@@ -1543,16 +1543,44 @@
 gateRoot
+%3CT, ID%3E, ID extends Identity
 %3E %0A    e
@@ -1622,11 +1622,533 @@
 ry%3CT
-%3E %7B
+, ID%3E %7B%0A%0A    public AbstractJEEventStoreARRepository() %7B%0A        Class%3C?%3E%5B%5D typeArguments = TypeResolver%0A                .resolveRawArguments(AbstractJEEventStoreARRepository.class, getClass());%0A        Class%3CT%3E type = (Class) typeArguments%5B0%5D;%0A        if (TypeResolver.Unknown.class.equals(type))%0A            throw new IllegalStateException(%22Object type parameter missing on %22 +%0A                    AbstractJEEventStoreARRepository.class.getSimpleName() + %22 for class %22 + getClass());%0A        this.setObjectType(type);%0A    %7D
 %0A%0A%7D%0A

Use automatic type lookup for aggregate root repositories