diff --git a/cuba.ipr b/cuba.ipr
index 2ff975ae8f..981349c117 100644
--- a/cuba.ipr
+++ b/cuba.ipr
@@ -82,7 +82,7 @@
-
+
@@ -656,6 +656,7 @@
+
jar://$PROJECT_DIR$/../lib/server/hsqldb-1.8.0.9.jar!/
diff --git a/modules/core/src/META-INF/cuba-persistence.xml b/modules/core/src/META-INF/cuba-persistence.xml
index 4f8122ecba..809d641f5e 100644
--- a/modules/core/src/META-INF/cuba-persistence.xml
+++ b/modules/core/src/META-INF/cuba-persistence.xml
@@ -16,6 +16,7 @@
+
diff --git a/modules/core/src/com/haulmont/cuba/core/entity/BaseUuidEntity.java b/modules/core/src/com/haulmont/cuba/core/entity/BaseUuidEntity.java
index 3ad819b736..803def03f1 100644
--- a/modules/core/src/com/haulmont/cuba/core/entity/BaseUuidEntity.java
+++ b/modules/core/src/com/haulmont/cuba/core/entity/BaseUuidEntity.java
@@ -33,10 +33,6 @@ public class BaseUuidEntity implements BaseEntity
@Column(name = "CREATED_BY", length = PersistenceProvider.LOGIN_FIELD_LEN)
private String createdBy;
- public BaseUuidEntity() {
- id = UuidProvider.createUuid();
- }
-
public UUID getId() {
return id;
}
diff --git a/modules/core/src/com/haulmont/cuba/core/entity/Server.java b/modules/core/src/com/haulmont/cuba/core/entity/Server.java
index 26e01c80c8..95cafa94c7 100644
--- a/modules/core/src/com/haulmont/cuba/core/entity/Server.java
+++ b/modules/core/src/com/haulmont/cuba/core/entity/Server.java
@@ -18,6 +18,8 @@ import javax.persistence.EntityListeners;
@Table(name = "SYS_SERVER")
public class Server extends StandardEntity
{
+ private static final long serialVersionUID = 1892335683693067357L;
+
@Column(name = "NAME")
private String name;
diff --git a/modules/core/src/com/haulmont/cuba/security/entity/Profile.java b/modules/core/src/com/haulmont/cuba/security/entity/Profile.java
index 50e41ac6e4..b97aa791dc 100644
--- a/modules/core/src/com/haulmont/cuba/security/entity/Profile.java
+++ b/modules/core/src/com/haulmont/cuba/security/entity/Profile.java
@@ -14,11 +14,14 @@ import com.haulmont.cuba.core.entity.StandardEntity;
import javax.persistence.*;
import java.util.Set;
+import java.io.Serializable;
@Entity(name = "sec$Profile")
@Table(name = "SEC_PROFILE")
public class Profile extends StandardEntity
{
+ private static final long serialVersionUID = -9008053062363137148L;
+
@Column(name = "NAME")
private String name;
diff --git a/modules/core/src/com/haulmont/cuba/security/entity/ProfileRole.java b/modules/core/src/com/haulmont/cuba/security/entity/ProfileRole.java
index 3fe02861f4..d144e8f78d 100644
--- a/modules/core/src/com/haulmont/cuba/security/entity/ProfileRole.java
+++ b/modules/core/src/com/haulmont/cuba/security/entity/ProfileRole.java
@@ -21,6 +21,8 @@ import javax.persistence.JoinColumn;
@Table(name = "SEC_PROFILE_ROLE")
public class ProfileRole extends StandardEntity
{
+ private static final long serialVersionUID = 6151402331592361210L;
+
@ManyToOne(optional = false)
@JoinColumn(name = "PROFILE_ID")
private Profile profile;
diff --git a/modules/core/src/com/haulmont/cuba/security/entity/Role.java b/modules/core/src/com/haulmont/cuba/security/entity/Role.java
index 2dc8f999b4..6889a13331 100644
--- a/modules/core/src/com/haulmont/cuba/security/entity/Role.java
+++ b/modules/core/src/com/haulmont/cuba/security/entity/Role.java
@@ -20,6 +20,8 @@ import javax.persistence.Column;
@Table(name = "SEC_ROLE")
public class Role extends StandardEntity
{
+ private static final long serialVersionUID = -4889116218059626402L;
+
@Column(name = "NAME")
private String name;
diff --git a/modules/core/src/com/haulmont/cuba/security/entity/User.java b/modules/core/src/com/haulmont/cuba/security/entity/User.java
index b97f2c29d4..19c9e6b707 100644
--- a/modules/core/src/com/haulmont/cuba/security/entity/User.java
+++ b/modules/core/src/com/haulmont/cuba/security/entity/User.java
@@ -20,6 +20,8 @@ import java.util.Set;
@Table(name = "SEC_USER")
public class User extends StandardEntity
{
+ private static final long serialVersionUID = 5007187642916030394L;
+
@Column(name = "LOGIN", length = PersistenceProvider.LOGIN_FIELD_LEN)
private String login;
diff --git a/modules/core/test/com/haulmont/cuba/core/CubaTestCase.java b/modules/core/test/com/haulmont/cuba/core/CubaTestCase.java
index 67c3dabc4d..cf360bd078 100644
--- a/modules/core/test/com/haulmont/cuba/core/CubaTestCase.java
+++ b/modules/core/test/com/haulmont/cuba/core/CubaTestCase.java
@@ -21,9 +21,10 @@ public class CubaTestCase extends TestCase
protected void setUp() throws Exception {
super.setUp();
- setUpDeploymentFiles();
- TestContainer.start();
-
+ if (!TestContainer.isStarted()) {
+ setUpDeploymentFiles();
+ TestContainer.start();
+ }
System.setProperty(SecurityProvider.IMPL_PROP, "com.haulmont.cuba.core.impl.TestSecurityProvider");
}
}
diff --git a/modules/core/test/com/haulmont/cuba/core/PersistenceTest.java b/modules/core/test/com/haulmont/cuba/core/PersistenceTest.java
index a504b355e8..0e4d255ddf 100644
--- a/modules/core/test/com/haulmont/cuba/core/PersistenceTest.java
+++ b/modules/core/test/com/haulmont/cuba/core/PersistenceTest.java
@@ -10,6 +10,7 @@
package com.haulmont.cuba.core;
import com.haulmont.cuba.core.entity.Server;
+import com.haulmont.cuba.core.global.UuidProvider;
import javax.transaction.*;
import javax.naming.Context;
@@ -25,7 +26,8 @@ public class PersistenceTest extends CubaTestCase
EntityManagerAdapter em = PersistenceProvider.getEntityManager();
assertNotNull(em);
Server server = new Server();
- id = server.getId();
+ id = UuidProvider.createUuid();
+ server.setId(id);
server.setName("localhost");
server.setAddress("127.0.0.1");
server.setRunning(true);
diff --git a/modules/core/test/com/haulmont/cuba/core/TestContainer.java b/modules/core/test/com/haulmont/cuba/core/TestContainer.java
index 95a38f2dc9..3b0118ad0b 100644
--- a/modules/core/test/com/haulmont/cuba/core/TestContainer.java
+++ b/modules/core/test/com/haulmont/cuba/core/TestContainer.java
@@ -21,9 +21,7 @@ import javax.management.*;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Comparator;
-import java.util.List;
-import java.util.TreeSet;
+import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -31,9 +29,9 @@ public class TestContainer
{
private static boolean started;
- private static TreeSet filesByExt = new TreeSet(new ExtensionComparator());
+ private static List filesByExt = new ArrayList();
- private static TreeSet filesByPrefix = new TreeSet(new PrefixComparator());
+ private static List filesByPrefix = new ArrayList();
private static class ExtensionComparator implements Comparator
{
@@ -72,6 +70,10 @@ public class TestContainer
}
}
+ public static boolean isStarted() {
+ return started;
+ }
+
private static Integer getPrefix(String s) {
Pattern pattern = Pattern.compile("\\A\\d+");
Matcher matcher = pattern.matcher(s);
@@ -101,9 +103,12 @@ public class TestContainer
return;
EJB3StandaloneBootstrap.boot(null);
+
+ Collections.sort(filesByExt, new ExtensionComparator());
for (String fileName : filesByExt) {
deployFile(fileName);
}
+ Collections.sort(filesByPrefix, new PrefixComparator());
for (String fileName : filesByPrefix) {
deployFile(fileName);
}
diff --git a/modules/core/test/com/haulmont/cuba/security/UserRoleTest.java b/modules/core/test/com/haulmont/cuba/security/UserRoleTest.java
index 738d8192cd..c026e8f9b5 100644
--- a/modules/core/test/com/haulmont/cuba/security/UserRoleTest.java
+++ b/modules/core/test/com/haulmont/cuba/security/UserRoleTest.java
@@ -11,6 +11,7 @@
package com.haulmont.cuba.security;
import com.haulmont.cuba.core.*;
+import com.haulmont.cuba.core.global.UuidProvider;
import com.haulmont.cuba.security.entity.User;
import com.haulmont.cuba.security.entity.Role;
import com.haulmont.cuba.security.entity.Profile;
@@ -27,22 +28,25 @@ public class UserRoleTest extends CubaTestCase
EntityManagerAdapter em = PersistenceProvider.getEntityManager();
User user = new User();
- UUID userId = user.getId();
+ UUID userId = UuidProvider.createUuid();
+ user.setId(userId);
user.setLogin("testUser1");
user.setName("Test User 1");
em.persist(user);
Role role = new Role();
- UUID roleId = role.getId();
+ role.setId(UuidProvider.createUuid());
role.setName("testRole1");
em.persist(role);
Profile profile = new Profile();
- profile.setName("Default");
+ profile.setId(UuidProvider.createUuid());
+ profile.setName("testProfile");
profile.setUser(user);
em.persist(profile);
ProfileRole profileRole = new ProfileRole();
+ profileRole.setId(UuidProvider.createUuid());
profileRole.setProfile(profile);
profileRole.setRole(role);
em.persist(profileRole);