-
Notifications
You must be signed in to change notification settings - Fork 4
/
live-templates.xml
55 lines (55 loc) · 4.47 KB
/
live-templates.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<templateSet group="SpringData">
<template name="co" value="ConsoleOutput.write($END$);" description="Console Output" toReformat="false" toShortenFQNames="true">
<context>
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
<template name="prs" value="personRepository.save(SIMPSONS);" description="Person repository save" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_EXPRESSION" value="true" />
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
<template name="prfbln" value="this.personRepository.findByLastNameIgnoreCaseAndAgeGreaterThan("simpson", 20)" description="Person repository findByLastName..." toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_EXPRESSION" value="true" />
</context>
</template>
<template name="casq" value="@org.springframework.data.cassandra.repository.Query("SELECT firstName, age FROM person WHERE lastName = ?0")" description="Cassandra Query" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
<template name="prp" value="@org.springframework.context.annotation.Bean org.springframework.data.repository.init.Jackson2RepositoryPopulatorFactoryBean repositoryPopulator() { org.springframework.data.repository.init.Jackson2RepositoryPopulatorFactoryBean factoryBean = new org.springframework.data.repository.init.Jackson2RepositoryPopulatorFactoryBean(); factoryBean.setResources(new org.springframework.core.io.Resource[] { new org.springframework.core.io.ClassPathResource("persons.json") }); return factoryBean; }" description="Person repository populator" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
<template name="prqdsl" value="com.querydsl.core.types.Predicate predicate = com.github.vanroy.springdata.querydsl.model.QPerson.person.firstName.equalsIgnoreCase("Barney");" description="Person repository QueryDSL" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_EXPRESSION" value="true" />
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
<template name="prspec" value="private static org.springframework.data.jpa.domain.Specification<com.github.vanroy.springdata.specifications.model.Person> personIsAdult() { return (root, query, cb) -> cb.greaterThanOrEqualTo(root.get("age"), 18); } private static org.springframework.data.jpa.domain.Specification<com.github.vanroy.springdata.specifications.model.Person> personIsASimpson() { return (root, query, cb) -> cb.equal(root.get("lastName"), "Simpson"); } " description="Person repository specifications" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
<template name="pcstream" value="@javax.annotation.PostConstruct public void startStreaming() { repository.findBy().doOnNext(notificationService::sendMessage).subscribe(); } " description="Person controller streaming" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
<template name="pclist" value="return reactor.core.publisher.Flux.merge( repository.findByAgeGreaterThan(30), repository.findByFirstName("Brian") ) .distinct() .collectList() .block();" description="Person controller list" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_EXPRESSION" value="true" />
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
<template name="prnq" value="@org.springframework.data.jpa.repository.Query(value = "SELECT * FROM person WHERE lower(last_name) = lower(?)", nativeQuery = true) java.lang.Iterable<com.github.vanroy.springdata.basics.model.Person> findByLastName(java.lang.String lastName); " description="Person repository Native SQL Query" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
</templateSet>