本文整理了Java中org.springframework.data.mongodb.repository.Query.<init>
方法的一些代码示例,展示了Query.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.<init>
方法的具体详情如下:
包路径:org.springframework.data.mongodb.repository.Query
类名称:Query
方法名:<init>
暂无
代码示例来源:origin: sqshq/piggymetrics
@Query("{ $and: [ {'scheduledNotifications.BACKUP.active': true }, { $where: 'this.scheduledNotifications.BACKUP.lastNotified < " +
"new Date(new Date().setDate(new Date().getDate() - this.scheduledNotifications.BACKUP.frequency ))' }] }")
List<Recipient> findReadyForBackup();
代码示例来源:origin: sqshq/piggymetrics
@Query("{ $and: [ {'scheduledNotifications.REMIND.active': true }, { $where: 'this.scheduledNotifications.REMIND.lastNotified < " +
"new Date(new Date().setDate(new Date().getDate() - this.scheduledNotifications.REMIND.frequency ))' }] }")
List<Recipient> findReadyForRemind();
代码示例来源:origin: spring-projects/spring-data-examples
/**
* String query selecting one entity.
*
* @param lastname
* @return
*/
@Query("{ 'firstname': ?0, 'lastname': ?1}")
Maybe<Person> findByFirstnameAndLastname(String firstname, String lastname);
代码示例来源:origin: spring-projects/spring-data-examples
/**
* String query selecting one entity.
*
* @param lastname
* @return
*/
@Query("{ 'firstname': ?0, 'lastname': ?1}")
Mono<Person> findByFirstnameAndLastname(String firstname, String lastname);
代码示例来源:origin: spring-projects/spring-data-examples
@Query("{id: ?#{ hasRole('ROLE_ADMIN') ? {$exists:true} : principal.id}}")
List<Person> findAllForCurrentUserById();
}
代码示例来源:origin: spring-projects/spring-data-examples
@Query("{}")
Stream<Person> findAllByCustomQueryWithStream();
}
代码示例来源:origin: spring-projects/spring-data-book
/**
* Returns all {@link Product}s having the given attribute.
*
* @param attribute
* @return
*/
@Query("{ ?0 : ?1 }")
List<Product> findByAttributes(String key, String value);
}
代码示例来源:origin: com.capitalone.dashboard/core
/**
* Finds the {@link EnvironmentComponent} collector item id, environment name and component name.
*
* @param collectorItemId collector item id
* @param environmentName environment name
* @param componentName component name
* @return a {@link EnvironmentComponent}
*/
@Query(value="{ collectorItemId : ?0, environmentName : ?1, componentName : ?2}")
EnvironmentComponent findComponent(ObjectId collectorItemId, String environmentName, String componentName);
代码示例来源:origin: com.capitalone.dashboard/core
/**
* Finds the {@link CollectorItem} for a given collector and options. This should represent a unique
* instance of a {@link CollectorItem} for a given {@link com.capitalone.dashboard.model.Collector}.
*
* @param collectorId {@link com.capitalone.dashboard.model.Collector} id
* @param options options
* @return a {@link CollectorItem}
*/
@Query(value="{ 'collectorId' : ?0, options : ?1}")
T findByCollectorAndOptions(ObjectId collectorId, Map<String, Object> options);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find {@link Launch} by id, load only next fields:
* <li>id;
* <li>startTime;
* <li>status.
*
* @param id ID of Launch
* @return {@link Launch}
*/
@Query(value = "{ '_id': ?0 }", fields = "{'id' : 1, 'startTime':1, 'status':1, 'projectRef':1 }")
Launch loadStatusProjectRefAndStartTime(String id);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find ID of dashboard by user and projectName, load only id field
*
* @param userName Name of user
* @param projectName Name of project
* @param dashName Name of dashboard
* @return {@link Dashboard}
*/
@Query(value = SELECT_BY_USER_PROJECT_DASHNAME, fields = ID_FIELD)
Dashboard findOneByUserProject(String userName, String projectName, String dashName);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Finds log by TestStep ID. Returns fully populated
* {@link com.epam.ta.reportportal.database.entity.Log}
*
* @param testItem
* @return
*/
@Query(value = FIND_LOG_ENTRY_BY_STEP_ID, fields = "{'id' : 1}")
List<Log> findLogIdsByTestItemId(String testItem);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find {@link UserFilter} by user, project and id, load all fields
*
* @param userName
* @param projectName
* @param id
* @return {@link UserFilter}
*/
@Query(value = SELECT_BY_USER_ID_PROJECT)
UserFilter findOne(String userName, String id, String projectName);
代码示例来源:origin: com.capitalone.dashboard/core
/**
* Finds all enabled {@link ScoreCollectorItem}s
*
* @param collectorId ID
* @return list of {@link ScoreCollectorItem}s
*/
@Query(value = "{ 'collectorId' : ?0, enabled: true}")
List<ScoreCollectorItem> findEnabledScores(ObjectId collectorId);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Streaming launches by provided project ID
*
* @param id
* @return
*/
@Query(value = FIND_LAUNCH_ENTRY_BY_PROJECT_ID, fields = "{'id' : 1}")
Stream<Launch> streamIdsByProject(String id);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find {@link UserFilter} by userName, projectName and id, load only id field
*
* @param user
* @param projectName
* @param id
* @return {@link UserFilter}
*/
@Query(value = SELECT_BY_USER_ID_PROJECT, fields = ID_FIELD)
UserFilter findOneLoadId(String userName, String id, String projectName);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find dashboard by user,projectName and id, load all fields
*
* @param userName Name of user
* @param projectName Name of project
* @param id ID of dashboard
* @return {@link Dashboard}
*/
// TODO consider to move this method to root repository
@Query(value = SELECT_BY_USER_ID_PROJECT)
Dashboard findOne(String userName, String id, String projectName);
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find all dashboards of specified project
*
* @param projectRef Project ID
* @return {@link Dashboard} list
*/
@Override
@Query(value = "{'projectName' : ?0}")
List<Dashboard> findByProject(String projectRef);
}
代码示例来源:origin: pl.edu.icm.crpd/crpd-persistence
/**
* Retrieves {@link ThesisMetadata} by its internal id, only if it is in the committed state.
*
* @param id internal id
* @return found metadata, {@code null} if not found
*/
@Query("{ 'commitState' : 'COMMITTED', '_id' : ?0 }")
ThesisMetadata findCommitted(String id);
}
代码示例来源:origin: com.epam.reportportal/commons-dao
/**
* Find dashboard by user, projectName and id, load only id field
*
* @param userName Name of user
* @param projectName Name of project
* @param id ID of dashboard
* @return {@link Dashboard}
*/
@Query(value = SELECT_BY_USER_ID_PROJECT, fields = ID_FIELD)
Dashboard findOneLoadId(String userName, String id, String projectName);
内容来源于网络,如有侵权,请联系作者删除!