Skip to content

Commit 8efd77c

Browse files
committed
Updated to Vaadin 7.7, Vaadin CDI 1.0.1 and using vaadin starter
1 parent 546adfe commit 8efd77c

File tree

3 files changed

+26
-46
lines changed

3 files changed

+26
-46
lines changed

pom.xml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,34 @@
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
15-
<version.vaadin>7.7.0.alpha3</version.vaadin>
15+
<version.vaadin>7.7.0</version.vaadin>
1616
<vaadin.plugin.version>${version.vaadin}</vaadin.plugin.version>
1717
<start-class>crud.Application</start-class>
1818
</properties>
1919

2020
<parent>
2121
<groupId>org.springframework.boot</groupId>
2222
<artifactId>spring-boot-starter-parent</artifactId>
23-
<version>1.3.1.RELEASE</version>
23+
<version>1.4.0.RELEASE</version>
2424
</parent>
25+
26+
<dependencyManagement>
27+
<dependencies>
28+
<dependency>
29+
<groupId>com.vaadin</groupId>
30+
<artifactId>vaadin-bom</artifactId>
31+
<version>${version.vaadin}</version>
32+
<type>pom</type>
33+
<scope>import</scope>
34+
</dependency>
35+
</dependencies>
36+
</dependencyManagement>
2537

2638
<dependencies>
2739
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-starter-actuator</artifactId>
30-
</dependency>
31-
<dependency>
32-
<groupId>org.springframework.boot</groupId>
33-
<artifactId>spring-boot-starter-web</artifactId>
40+
<groupId>com.vaadin</groupId>
41+
<artifactId>vaadin-spring-boot-starter</artifactId>
42+
<version>1.0.1</version>
3443
</dependency>
3544
<dependency>
3645
<groupId>org.springframework.boot</groupId>
@@ -45,36 +54,14 @@
4554
<artifactId>spring-boot-starter-test</artifactId>
4655
<scope>test</scope>
4756
</dependency>
48-
<dependency>
49-
<groupId>com.vaadin</groupId>
50-
<artifactId>vaadin-spring-boot</artifactId>
51-
<version>1.0.0</version>
52-
</dependency>
53-
<dependency>
54-
<groupId>com.vaadin</groupId>
55-
<artifactId>vaadin-server</artifactId>
56-
<version>${version.vaadin}</version>
57-
<exclusions>
58-
<!-- Remove some obsolete stuff not needed by server side Vaadin apps -->
59-
<exclusion>
60-
<groupId>com.vaadin</groupId>
61-
<artifactId>vaadin-sass-compiler</artifactId>
62-
</exclusion>
63-
</exclusions>
64-
</dependency>
65-
<dependency>
66-
<groupId>org.peimari</groupId>
67-
<artifactId>dawn</artifactId>
68-
<version>11</version>
69-
</dependency>
7057
<dependency>
7158
<groupId>org.hibernate</groupId>
7259
<artifactId>hibernate-validator</artifactId>
7360
</dependency>
7461
<dependency>
7562
<groupId>org.vaadin</groupId>
7663
<artifactId>viritin</artifactId>
77-
<version>1.44</version>
64+
<version>1.56</version>
7865
</dependency>
7966
<dependency>
8067
<groupId>org.vaadin.teemu</groupId>
@@ -100,7 +87,7 @@
10087
<plugin>
10188
<groupId>com.vaadin</groupId>
10289
<artifactId>vaadin-maven-plugin</artifactId>
103-
<version>7.7.0.alpha3</version>
90+
<version>7.7.0</version>
10491
<executions>
10592
<execution>
10693
<goals>

src/main/java/crud/Application.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5-
import org.springframework.boot.web.servlet.ServletComponentScan;
65
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
76

87
@SpringBootApplication
98
@EnableJpaRepositories
10-
// Enable additional servlet filter for cloud hosted fontawesome
11-
@ServletComponentScan("org.peimari.dawn")
129
public class Application {
1310

1411
public static void main(String[] args) {

src/main/java/crud/vaadin/MainUI.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,11 @@
2121
import org.vaadin.viritin.layouts.MHorizontalLayout;
2222
import org.vaadin.viritin.layouts.MVerticalLayout;
2323

24-
/**
25-
*
26-
*/
2724
@Title("PhoneBook CRUD example")
2825
@Theme("valo")
2926
@SpringUI
3027
public class MainUI extends UI {
3128

32-
/**
33-
*
34-
*/
35-
private static final long serialVersionUID = 1L;
36-
37-
@Autowired
3829
PersonRepository repo;
3930

4031
private MTable<Person> list = new MTable<>(Person.class)
@@ -48,6 +39,12 @@ public class MainUI extends UI {
4839
private Button delete = new ConfirmButton(FontAwesome.TRASH_O,
4940
"Are you sure you want to delete the entry?", this::remove);
5041

42+
43+
@Autowired
44+
public MainUI(PersonRepository r) {
45+
this.repo = r;
46+
}
47+
5148
@Override
5249
protected void init(VaadinRequest request) {
5350
setContent(
@@ -78,12 +75,11 @@ private void listEntities() {
7875
// Note that fetching strategies can be given to MTable constructor as well.
7976
// Use this approach if you expect you'll have lots of data in your
8077
// table.
81-
8278
list.setBeans(new SortableLazyList<>(
8379
// entity fetching strategy
8480
(firstRow, asc, sortProperty) -> repo.findAllBy(
8581
new PageRequest(
86-
firstRow / PAGESIZE,
82+
firstRow / PAGESIZE,
8783
PAGESIZE,
8884
asc ? Sort.Direction.ASC : Sort.Direction.DESC,
8985
// fall back to id as "natural order"

0 commit comments

Comments
 (0)