package <%=packageName%>.repository;

import <%=packageName%>.domain.User;
import org.joda.time.DateTime;<% if (databaseType == 'sql') { %>
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;<% } %><% if (databaseType == 'nosql') { %>
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;<% } %>

import java.util.List;

<% if (databaseType == 'sql') { %>/**
 * Spring Data JPA repository for the User entity.
 */<% } %><% if (databaseType == 'nosql') { %>/**
 * Spring Data MongoDB repository for the User entity.
 */<% } %>
public interface UserRepository extends <% if (databaseType == 'sql') { %>JpaRepository<% } %><% if (databaseType == 'nosql') { %>MongoRepository<% } %><User, String> {
    <% if (databaseType == 'sql') { %>
    @Query("select u from User u where u.activationKey = ?1")<% } %><% if (databaseType == 'nosql') { %>
    @Query("{activationKey: ?0}")<% } %>
    User getUserByActivationKey(String activationKey);
    <% if (databaseType == 'sql') { %>
    @Query("select u from User u where u.activated = false and u.createdDate > ?1")<% } %><% if (databaseType == 'nosql') { %>
    @Query("{activation_key: 'false', createdDate: {$gt: ?0}")<% } %>
    List<User> findNotActivatedUsersByCreationDateBefore(DateTime dateTime);

}

@@ -1286,24 +1286,25 @@
 e: %7B$gt: ?0%7D
+%7D
 %22)%3C%25 %7D %25%3E%0A  

Fix #528