• R/O
  • HTTP
  • SSH
  • HTTPS

vaadin: Commit

sample


Commit MetaInfo

Revision056e856c0d0dfaece0d9fb819984a7704b177ec6 (tree)
Time2016-05-13 00:35:47
Authorcintake <gozilla3st@user...>
Commitercintake

Log Message

(empty log message)

Change Summary

Incremental Difference

--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,13 @@
4545 </dependencyManagement>
4646
4747 <dependencies>
48- <!--<dependency org="javax.servlet.jsp" name="jsp-api" rev="2.2" />-->
48+ <dependency>
49+ <groupId>org.ow2.asm</groupId>
50+ <artifactId>asm</artifactId>
51+ <version>5.0.3</version>
52+ <scope>compile</scope>
53+ </dependency>
54+ <!--<dependency org="javax.servlet.jsp" name="jsp-api" rev="2.2" />-->
4955 <dependency>
5056 <groupId>javax.servlet</groupId>
5157 <artifactId>javax.servlet-api</artifactId>
@@ -74,214 +80,224 @@
7480 <!--
7581 Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
7682
77- For widgetset compilation, vaadin-client-compiler is automatically added on the
78- compilation classpath by vaadin-maven-plugin so normally there is no need for an
79- explicit dependency.
80- -->
81- <!--
82- <dependency>
83- <groupId>com.vaadin</groupId>
84- <artifactId>vaadin-client-compiler</artifactId>
85- <scope>provided</scope>
86- </dependency>
87- -->
88- <dependency>
89- <groupId>com.vaadin</groupId>
90- <artifactId>vaadin-themes</artifactId>
91- </dependency>
92- <dependency>
93- <groupId>com.orientechnologies</groupId>
94- <artifactId>orientdb-server</artifactId>
95- <version>2.1.7</version>
96- </dependency>
97- <dependency>
98- <groupId>com.orientechnologies</groupId>
99- <artifactId>orientdb-enterprise</artifactId>
100- <version>2.1.7</version>
101- </dependency>
102- <dependency>
103- <groupId>com.orientechnologies</groupId>
104- <artifactId>orientdb-graphdb</artifactId>
105- <version>2.1.7</version>
106- </dependency>
107- <dependency>
108- <groupId>com.orientechnologies</groupId>
109- <artifactId>orientdb-object</artifactId>
110- <version>2.1.7</version>
111- </dependency>
112- <dependency>
113- <groupId>net.korabo.lib</groupId>
114- <artifactId>korabolib</artifactId>
115- <version>1.2.4</version>
116- </dependency>
117- <dependency>
118- <groupId>org.vaadin.addons</groupId>
119- <artifactId>dcharts-widget</artifactId>
120- <version>1.7.0</version>
121- <scope>compile</scope>
122- </dependency>
123- <dependency>
124- <groupId>org.vaadin.addons.lazyquerycontainer</groupId>
125- <artifactId>vaadin-lazyquerycontainer</artifactId>
126- <version>7.6.1.3</version>
127- </dependency>
128- </dependencies>
83+ For widgetset compilation, vaadin-client-compiler is automatically added on the
84+ compilation classpath by vaadin-maven-plugin so normally there is no need for an
85+ explicit dependency.
86+ -->
87+ <!--
88+ <dependency>
89+ <groupId>com.vaadin</groupId>
90+ <artifactId>vaadin-client-compiler</artifactId>
91+ <scope>provided</scope>
92+ </dependency>
93+ -->
94+ <dependency>
95+ <groupId>com.vaadin</groupId>
96+ <artifactId>vaadin-themes</artifactId>
97+ </dependency>
98+ <dependency>
99+ <groupId>org.vaadin.addons.lazyquerycontainer</groupId>
100+ <artifactId>vaadin-lazyquerycontainer</artifactId>
101+ <version>7.6.1.3</version>
102+ </dependency>
103+ <dependency>
104+ <groupId>org.tylproject.vaadin.addon.fieldbinder</groupId>
105+ <artifactId>field-binder</artifactId>
106+ <version>1.4</version>
107+ </dependency>
108+ <dependency>
109+ <groupId>com.orientechnologies</groupId>
110+ <artifactId>orientdb-server</artifactId>
111+ <version>2.1.7</version>
112+ </dependency>
113+ <dependency>
114+ <groupId>com.orientechnologies</groupId>
115+ <artifactId>orientdb-enterprise</artifactId>
116+ <version>2.1.7</version>
117+ </dependency>
118+ <dependency>
119+ <groupId>com.orientechnologies</groupId>
120+ <artifactId>orientdb-graphdb</artifactId>
121+ <version>2.1.7</version>
122+ </dependency>
123+ <dependency>
124+ <groupId>com.orientechnologies</groupId>
125+ <artifactId>orientdb-object</artifactId>
126+ <version>2.1.7</version>
127+ </dependency>
128+ <dependency>
129+ <groupId>net.korabo.lib</groupId>
130+ <artifactId>korabolib</artifactId>
131+ <version>1.2.4</version>
132+ </dependency>
133+ <dependency>
134+ <groupId>org.vaadin.addons</groupId>
135+ <artifactId>dcharts-widget</artifactId>
136+ <version>1.7.0</version>
137+ <scope>compile</scope>
138+ </dependency>
139+ <dependency>
140+ <groupId>org.vaadin.addons.lazyquerycontainer</groupId>
141+ <artifactId>vaadin-lazyquerycontainer</artifactId>
142+ <version>7.6.1.3</version>
143+ </dependency>
144+ </dependencies>
129145
130- <build>
131- <plugins>
132- <plugin>
133- <groupId>org.apache.maven.plugins</groupId>
134- <artifactId>maven-compiler-plugin</artifactId>
135- <version>3.3</version>
136- <configuration>
137- <encoding>${project.encoding}</encoding>
138- <source>1.8</source>
139- <target>1.8</target>
140- </configuration>
141- </plugin>
142- <plugin>
143- <groupId>org.apache.maven.plugins</groupId>
144- <artifactId>maven-resources-plugin</artifactId>
145- <version>2.6</version>
146- <configuration>
147- <encoding>${project.encoding}</encoding>
148- </configuration>
149- </plugin>
150- <plugin>
151- <groupId>org.apache.maven.plugins</groupId>
152- <artifactId>maven-war-plugin</artifactId>
153- <version>2.3</version>
154- <configuration>
155- <failOnMissingWebXml>false</failOnMissingWebXml>
156- <!-- Exclude some unnecessary files generated by the GWT compiler. -->
157- <packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**,
158- WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
159- </configuration>
160- </plugin>
161- <plugin>
162- <groupId>com.vaadin</groupId>
163- <artifactId>vaadin-maven-plugin</artifactId>
164- <version>${vaadin.plugin.version}</version>
165- <configuration>
166- <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
167- <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
168- <draftCompile>false</draftCompile>
169- <compileReport>false</compileReport>
170- <style>OBF</style>
171- <strict>true</strict>
172- <runTarget>http://localhost:8888/vaadin01</runTarget>
173- </configuration>
174- <executions>
175- <execution>
176- <goals>
177- <goal>update-theme</goal>
178- <goal>update-widgetset</goal>
179- <goal>compile</goal>
180- <!-- disabled by default to use on-the-fly theme compilation -->
181- <!-- <goal>compile-theme</goal> -->
182- </goals>
183- </execution>
184- </executions>
185- </plugin>
186- <plugin>
187- <groupId>org.apache.maven.plugins</groupId>
188- <artifactId>maven-source-plugin</artifactId>
189- <version>2.4</version>
190- </plugin>
191- <plugin>
192- <groupId>org.apache.maven.plugins</groupId>
193- <artifactId>maven-clean-plugin</artifactId>
194- <version>2.6.1</version>
195- <!-- Clean up also any pre-compiled themes -->
196- <configuration>
197- <filesets>
198- <fileset>
199- <directory>src/main/webapp/VAADIN/themes</directory>
200- <includes>
201- <include>**/styles.css</include>
202- <include>**/styles.scss.cache</include>
203- </includes>
204- </fileset>
205- </filesets>
206- </configuration>
207- </plugin>
146+ <build>
147+ <plugins>
148+ <plugin>
149+ <groupId>org.apache.maven.plugins</groupId>
150+ <artifactId>maven-compiler-plugin</artifactId>
151+ <version>3.3</version>
152+ <configuration>
153+ <encoding>${project.encoding}</encoding>
154+ <source>1.8</source>
155+ <target>1.8</target>
156+ </configuration>
157+ </plugin>
158+ <plugin>
159+ <groupId>org.apache.maven.plugins</groupId>
160+ <artifactId>maven-resources-plugin</artifactId>
161+ <version>2.6</version>
162+ <configuration>
163+ <encoding>${project.encoding}</encoding>
164+ </configuration>
165+ </plugin>
166+ <plugin>
167+ <groupId>org.apache.maven.plugins</groupId>
168+ <artifactId>maven-war-plugin</artifactId>
169+ <version>2.3</version>
170+ <configuration>
171+ <failOnMissingWebXml>false</failOnMissingWebXml>
172+ <!-- Exclude some unnecessary files generated by the GWT compiler. -->
173+ <packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**,
174+ WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
175+ </configuration>
176+ </plugin>
177+ <plugin>
178+ <groupId>com.vaadin</groupId>
179+ <artifactId>vaadin-maven-plugin</artifactId>
180+ <version>${vaadin.plugin.version}</version>
181+ <configuration>
182+ <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
183+ <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
184+ <draftCompile>false</draftCompile>
185+ <compileReport>false</compileReport>
186+ <style>OBF</style>
187+ <strict>true</strict>
188+ <runTarget>http://localhost:8888/vaadin01</runTarget>
189+ </configuration>
190+ <executions>
191+ <execution>
192+ <goals>
193+ <goal>update-theme</goal>
194+ <goal>update-widgetset</goal>
195+ <goal>compile</goal>
196+ <!-- disabled by default to use on-the-fly theme compilation -->
197+ <!-- <goal>compile-theme</goal> -->
198+ </goals>
199+ </execution>
200+ </executions>
201+ </plugin>
202+ <plugin>
203+ <groupId>org.apache.maven.plugins</groupId>
204+ <artifactId>maven-source-plugin</artifactId>
205+ <version>2.4</version>
206+ </plugin>
207+ <plugin>
208+ <groupId>org.apache.maven.plugins</groupId>
209+ <artifactId>maven-clean-plugin</artifactId>
210+ <version>2.6.1</version>
211+ <!-- Clean up also any pre-compiled themes -->
212+ <configuration>
213+ <filesets>
214+ <fileset>
215+ <directory>src/main/webapp/VAADIN/themes</directory>
216+ <includes>
217+ <include>**/styles.css</include>
218+ <include>**/styles.scss.cache</include>
219+ </includes>
220+ </fileset>
221+ </filesets>
222+ </configuration>
223+ </plugin>
208224
209- <!-- The Jetty plugin allows us to easily test the development build by
210- running jetty:run on the command line. -->
211- <plugin>
212- <groupId>org.eclipse.jetty</groupId>
213- <artifactId>jetty-maven-plugin</artifactId>
214- <version>${jetty.plugin.version}</version>
215- <configuration>
216- <scanIntervalSeconds>2</scanIntervalSeconds>
217- </configuration>
218- </plugin>
219- </plugins>
225+ <!-- The Jetty plugin allows us to easily test the development build by
226+ running jetty:run on the command line. -->
227+ <plugin>
228+ <groupId>org.eclipse.jetty</groupId>
229+ <artifactId>jetty-maven-plugin</artifactId>
230+ <version>${jetty.plugin.version}</version>
231+ <configuration>
232+ <scanIntervalSeconds>2</scanIntervalSeconds>
233+ </configuration>
234+ </plugin>
235+ </plugins>
220236
221- <pluginManagement>
222- <plugins>
223- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
224- <!-- TODO Remove when http://dev.vaadin.com/ticket/14924 is resolved -->
225- <plugin>
226- <groupId>org.eclipse.m2e</groupId>
227- <artifactId>lifecycle-mapping</artifactId>
228- <version>1.0.0</version>
229- <configuration>
230- <lifecycleMappingMetadata>
231- <pluginExecutions>
232- <pluginExecution>
233- <pluginExecutionFilter>
234- <groupId>com.vaadin</groupId>
235- <artifactId>
236- vaadin-maven-plugin
237- </artifactId>
238- <versionRange>[7.1.11,)</versionRange>
239- <goals>
240- <goal>resources</goal>
241- <goal>update-widgetset</goal>
242- <goal>compile</goal>
243- <goal>compile-theme</goal>
244- <goal>update-theme</goal>
245- </goals>
246- </pluginExecutionFilter>
247- <action>
248- <ignore></ignore>
249- </action>
250- </pluginExecution>
251- </pluginExecutions>
252- </lifecycleMappingMetadata>
253- </configuration>
254- </plugin>
255- </plugins>
256- </pluginManagement>
237+ <pluginManagement>
238+ <plugins>
239+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
240+ <!-- TODO Remove when http://dev.vaadin.com/ticket/14924 is resolved -->
241+ <plugin>
242+ <groupId>org.eclipse.m2e</groupId>
243+ <artifactId>lifecycle-mapping</artifactId>
244+ <version>1.0.0</version>
245+ <configuration>
246+ <lifecycleMappingMetadata>
247+ <pluginExecutions>
248+ <pluginExecution>
249+ <pluginExecutionFilter>
250+ <groupId>com.vaadin</groupId>
251+ <artifactId>
252+ vaadin-maven-plugin
253+ </artifactId>
254+ <versionRange>[7.1.11,)</versionRange>
255+ <goals>
256+ <goal>resources</goal>
257+ <goal>update-widgetset</goal>
258+ <goal>compile</goal>
259+ <goal>compile-theme</goal>
260+ <goal>update-theme</goal>
261+ </goals>
262+ </pluginExecutionFilter>
263+ <action>
264+ <ignore></ignore>
265+ </action>
266+ </pluginExecution>
267+ </pluginExecutions>
268+ </lifecycleMappingMetadata>
269+ </configuration>
270+ </plugin>
271+ </plugins>
272+ </pluginManagement>
257273
258- </build>
274+ </build>
259275
260- <profiles>
261- <profile>
262- <!-- Vaadin pre-release repositories -->
263- <id>vaadin-prerelease</id>
264- <activation>
265- <activeByDefault>false</activeByDefault>
266- </activation>
276+ <profiles>
277+ <profile>
278+ <!-- Vaadin pre-release repositories -->
279+ <id>vaadin-prerelease</id>
280+ <activation>
281+ <activeByDefault>false</activeByDefault>
282+ </activation>
267283
268- <repositories>
269- <repository>
270- <id>vaadin-prereleases</id>
271- <url>http://maven.vaadin.com/vaadin-prereleases</url>
272- </repository>
284+ <repositories>
285+ <repository>
286+ <id>vaadin-prereleases</id>
287+ <url>http://maven.vaadin.com/vaadin-prereleases</url>
288+ </repository>
273289 <repository>
274- <id>vaadin-addons</id>
275- <url>http://maven.vaadin.com/vaadin-addons</url>
290+ <id>vaadin-addons</id>
291+ <url>http://maven.vaadin.com/vaadin-addons</url>
276292 </repository>
277- </repositories>
278- <pluginRepositories>
279- <pluginRepository>
280- <id>vaadin-prereleases</id>
281- <url>http://maven.vaadin.com/vaadin-prereleases</url>
282- </pluginRepository>
283- </pluginRepositories>
284- </profile>
285- </profiles>
293+ </repositories>
294+ <pluginRepositories>
295+ <pluginRepository>
296+ <id>vaadin-prereleases</id>
297+ <url>http://maven.vaadin.com/vaadin-prereleases</url>
298+ </pluginRepository>
299+ </pluginRepositories>
300+ </profile>
301+ </profiles>
286302
287303 </project>
--- a/src/main/java/net/korabo/app/vaadin01/ent/Contact.java
+++ b/src/main/java/net/korabo/app/vaadin01/ent/Contact.java
@@ -5,18 +5,19 @@
55 */
66 package net.korabo.app.vaadin01.ent;
77
8+import com.orientechnologies.orient.core.id.ORID;
89 import java.io.Serializable;
910 import java.util.Date;
1011 import javax.persistence.Id;
12+import javax.persistence.Version;
1113 import net.korabo.lib.beans.InstanceUtil;
1214
1315 /**
1416 *
1517 * @author cintake
1618 */
17-public class Contact implements Serializable, Cloneable {
19+public class Contact extends KBaseEntity implements Serializable, Cloneable {
1820
19- private Long id;
2021
2122 private String firstName = "";
2223 private String lastName = "";
@@ -24,13 +25,7 @@ public class Contact implements Serializable, Cloneable {
2425 private String email = "";
2526 private Date birthDate;
2627
27- public Long getId() {
28- return id;
29- }
3028
31- public void setId(Long id) {
32- this.id = id;
33- }
3429
3530 public String getFirstName() {
3631 return firstName;
--- /dev/null
+++ b/src/main/java/net/korabo/app/vaadin01/ent/InstanceID.java
@@ -0,0 +1,32 @@
1+/*
2+ * To change this license header, choose License Headers in Project Properties.
3+ * To change this template file, choose Tools | Templates
4+ * and open the template in the editor.
5+ */
6+package net.korabo.app.vaadin01.ent;
7+
8+/**
9+ *
10+ * @author manager
11+ */
12+public class InstanceID {
13+ private String ClassID;
14+ private Long ID;
15+
16+ public String getClassID() {
17+ return ClassID;
18+ }
19+
20+ public void setClassID(String ClassID) {
21+ this.ClassID = ClassID;
22+ }
23+
24+ public Long getID() {
25+ return ID;
26+ }
27+
28+ public void setID(Long ID) {
29+ this.ID = ID;
30+ }
31+
32+}
--- /dev/null
+++ b/src/main/java/net/korabo/app/vaadin01/ent/KBaseEntity.java
@@ -0,0 +1,31 @@
1+/*
2+ * To change this license header, choose License Headers in Project Properties.
3+ * To change this template file, choose Tools | Templates
4+ * and open the template in the editor.
5+ */
6+package net.korabo.app.vaadin01.ent;
7+
8+import com.orientechnologies.orient.core.id.ORID;
9+import javax.persistence.Id;
10+import javax.persistence.Version;
11+
12+/**
13+ *
14+ * @author manager
15+ */
16+public abstract class KBaseEntity {
17+
18+ @Id
19+ protected ORID id;
20+ @Version
21+ protected Long version;
22+
23+ public ORID getId() {
24+ return id;
25+ }
26+
27+ public Long getVersion() {
28+ return version;
29+ }
30+
31+}
--- /dev/null
+++ b/src/main/java/net/korabo/app/vaadin01/srv/ContactBeanQuery.java
@@ -0,0 +1,71 @@
1+/*
2+ * To change this license header, choose License Headers in Project Properties.
3+ * To change this template file, choose Tools | Templates
4+ * and open the template in the editor.
5+ */
6+package net.korabo.app.vaadin01.srv;
7+
8+import com.orientechnologies.orient.core.db.OPartitionedDatabasePool;
9+import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
10+import java.util.ArrayList;
11+import java.util.List;
12+import java.util.Map;
13+import net.korabo.app.vaadin01.ent.Contact;
14+import org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery;
15+import org.vaadin.addons.lazyquerycontainer.QueryDefinition;
16+
17+/**
18+ *
19+ * @author manager
20+ */
21+public class ContactBeanQuery extends AbstractBeanQuery<Contact>{
22+
23+ private final OPartitionedDatabasePool pool;
24+
25+ public ContactBeanQuery(QueryDefinition definition,
26+ Map<String, Object> queryConfiguration, Object[] sortPropertyIds,
27+ boolean[] sortStates) {
28+ super(definition, queryConfiguration, sortPropertyIds, sortStates);
29+ this.pool = (OPartitionedDatabasePool)queryConfiguration.get("OPartitionedDatabasePool");
30+ }
31+
32+
33+ @Override
34+ protected Contact constructBean() {
35+ return new Contact();
36+ }
37+
38+ @Override
39+ public int size() {
40+ try (
41+ OObjectDatabaseTx db = new OObjectDatabaseTx(pool.acquire())) {
42+ db.getEntityManager().registerEntityClass(Contact.class);
43+ return (int) db.countClass(Contact.class);
44+ }
45+ }
46+
47+ @Override
48+ protected List<Contact> loadBeans(int i, int i1) {
49+ ArrayList arrayList = new ArrayList();
50+ try (
51+ OObjectDatabaseTx db = new OObjectDatabaseTx(pool.acquire())) {
52+ db.getEntityManager().registerEntityClass(Contact.class);
53+ for (Contact contact : db.browseClass(Contact.class).) {
54+ boolean passesFilter = (stringFilter == null || stringFilter.isEmpty())
55+ || contact.toString().toLowerCase()
56+ .contains(stringFilter.toLowerCase());
57+ if (passesFilter) {
58+// contact = db.detach(contact);
59+ arrayList.add(db.detach(contact, true));
60+ }
61+ }
62+
63+ }
64+ }
65+
66+ @Override
67+ protected void saveBeans(List<Contact> list, List<Contact> list1, List<Contact> list2) {
68+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
69+ }
70+
71+}
--- a/src/main/java/net/korabo/app/vaadin01/srv/ContactService.java
+++ b/src/main/java/net/korabo/app/vaadin01/srv/ContactService.java
@@ -11,15 +11,11 @@ import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
1111 import java.io.IOException;
1212 import java.util.ArrayList;
1313 import java.util.Calendar;
14-import java.util.Collections;
15-import java.util.Comparator;
16-import java.util.HashMap;
1714 import java.util.List;
1815 import java.util.Random;
1916 import java.util.logging.Level;
2017 import java.util.logging.Logger;
2118 import net.korabo.app.vaadin01.ent.Contact;
22-import net.korabo.lib.beans.InstanceUtil;
2319
2420 /**
2521 *
@@ -40,7 +36,7 @@ public class ContactService {
4036 private static ContactService instance;
4137 private static OPartitionedDatabasePool pool;
4238
43- public static ContactService createDemoService(){
39+ public static ContactService createDemoService() {
4440 try {
4541 return createService0();
4642 } catch (IOException ex) {
@@ -48,7 +44,7 @@ public class ContactService {
4844 }
4945 return null;
5046 }
51-
47+
5248 private static ContactService createService0() throws IOException {
5349 if (instance == null) {
5450
@@ -65,7 +61,7 @@ public class ContactService {
6561 String url = remote + nameDB;
6662
6763 OServerAdmin serverAdmin = new OServerAdmin(url).connect("root", "korabo");
68- if (!serverAdmin.listDatabases().containsKey(nameDB)){
64+ if (!serverAdmin.listDatabases().containsKey(nameDB)) {
6965 serverAdmin.createDatabase(nameDB, "object", "plocal");
7066 System.out.println(" Database '" + nameDB + "' created!..");
7167 }
@@ -75,6 +71,7 @@ public class ContactService {
7571 try (
7672 OObjectDatabaseTx db = new OObjectDatabaseTx(pool.acquire())) {
7773 db.getEntityManager().registerEntityClass(Contact.class);
74+
7875 if (db.countClass(Contact.class) == 0) {
7976 // init
8077 Random r = new Random(0);
@@ -89,7 +86,7 @@ public class ContactService {
8986 cal.set(1930 + r.nextInt(70),
9087 r.nextInt(11), r.nextInt(28));
9188 contact.setBirthDate(cal.getTime());
92- db.save(contact);
89+ db.attachAndSave(contact);
9390 }
9491 db.commit();
9592 }
@@ -109,13 +106,13 @@ public class ContactService {
109106 OObjectDatabaseTx db = new OObjectDatabaseTx(pool.acquire())) {
110107 db.getEntityManager().registerEntityClass(Contact.class);
111108 for (Contact contact : db.browseClass(Contact.class)) {
112- boolean passesFilter = (stringFilter == null || stringFilter.isEmpty())
113- || contact.toString().toLowerCase()
114- .contains(stringFilter.toLowerCase());
115- if (passesFilter) {
116- contact = db.detach(contact);
117- arrayList.add(contact);
118- }
109+ boolean passesFilter = (stringFilter == null || stringFilter.isEmpty())
110+ || contact.toString().toLowerCase()
111+ .contains(stringFilter.toLowerCase());
112+ if (passesFilter) {
113+// contact = db.detach(contact);
114+ arrayList.add(db.detach(contact, true));
115+ }
119116 }
120117
121118 }
@@ -156,6 +153,13 @@ public class ContactService {
156153 }
157154
158155 public synchronized void save(Contact entry) {
156+ try (
157+ OObjectDatabaseTx db = new OObjectDatabaseTx(pool.acquire())) {
158+ db.getEntityManager().registerEntityClass(Contact.class);
159+ db.begin();
160+ db.attachAndSave(entry);
161+ db.commit();
162+ }
159163 // if (entry.getId() == null) {
160164 // entry.setId(nextId++);
161165 // }
--- a/src/main/webapp/VAADIN/themes/mytheme/addons.scss
+++ b/src/main/webapp/VAADIN/themes/mytheme/addons.scss
@@ -1,7 +1,7 @@
1-/* This file is automatically managed and will be overwritten from time to time. */
2-/* Do not manually edit this file. */
3-
4-/* Import and include this mixin into your project theme to include the addon themes */
5-@mixin addons {
6-}
7-
1+/* This file is automatically managed and will be overwritten from time to time. */
2+/* Do not manually edit this file. */
3+
4+/* Import and include this mixin into your project theme to include the addon themes */
5+@mixin addons {
6+}
7+
Show on old repository browser