fixed bug with LAZY fetch of ElementCollections

This commit is contained in:
Walter Oggioni
2017-07-14 23:39:08 +02:00
parent 7bae3c9d14
commit f6b4ae3c71
5 changed files with 38 additions and 30 deletions

View File

@@ -10,13 +10,15 @@ scalaVersion := "2.12.2"
libraryDependencies += "org.tukaani" % "xz" % "1.6" libraryDependencies += "org.tukaani" % "xz" % "1.6"
libraryDependencies += "org.apache.commons" % "commons-compress" % "1.14" libraryDependencies += "org.apache.commons" % "commons-compress" % "1.14"
libraryDependencies += "org.projectlombok" % "lombok" % "1.16.18" % "provided" libraryDependencies += "org.projectlombok" % "lombok" % "1.16.18" % "provided"
//libraryDependencies += "javax" % "javaee-api" % "7.0" % "provided" libraryDependencies += "javax" % "javaee-api" % "7.0" % "provided"
libraryDependencies += "javax" % "javaee-api" % "7.0" //libraryDependencies += "javax" % "javaee-api" % "7.0 "
libraryDependencies += "junit" % "junit" % "4.12" % "test" libraryDependencies += "junit" % "junit" % "4.12" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test" libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
libraryDependencies += "com.thoughtworks.xstream" % "xstream" % "1.4.10" libraryDependencies += "com.thoughtworks.xstream" % "xstream" % "1.4.10"
libraryDependencies += "commons-io" % "commons-io" % "2.5" % "test" libraryDependencies += "commons-io" % "commons-io" % "2.5" % "test"
libraryDependencies += "org.jboss" % "jboss-ejb-client" % "4.0.0.CR5" % "test"
//libraryDependencies += "org.jboss.resteasy" % "resteasy-jaxrs" % "3.1.3.Final" % "test" //libraryDependencies += "org.jboss.resteasy" % "resteasy-jaxrs" % "3.1.3.Final" % "test"
//libraryDependencies += "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" //libraryDependencies += "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final"
@@ -34,13 +36,17 @@ libraryDependencies += "org.jboss.resteasy" % "resteasy-jaxb-provider" % "3.0.11
enablePlugins(WarPlugin) enablePlugins(WarPlugin)
artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
artifact.name + "-" + module.revision + "." + artifact.extension
}
val wildflyUsername = SettingKey[String]("wildfly-username", "The account username to use to connect to wildfly with jboss-cli.sh") val wildflyUsername = SettingKey[String]("wildfly-username", "The account username to use to connect to wildfly with jboss-cli.sh")
val wildflyPassword = SettingKey[String]("wildfly-password", "The account password to use to connect to wildfly with jboss-cli.sh") val wildflyPassword = SettingKey[String]("wildfly-password", "The account password to use to connect to wildfly with jboss-cli.sh")
val wildflyURL = SettingKey[String]("wildfly-url", "The username to use to connect to wildfly with jboss-cli.sh") val wildflyURL = SettingKey[String]("wildfly-url", "The username to use to connect to wildfly with jboss-cli.sh")
wildflyUsername := "admin" wildflyUsername := "root"
wildflyPassword := "123456" wildflyPassword := "123456"
wildflyURL := "localhost:9990" wildflyURL := "localhost:1234"
val deploy2Wildfly = TaskKey[Unit]("deploy2Wildfly", "Deploy to a wildfly server instance", KeyRanks.ATask) val deploy2Wildfly = TaskKey[Unit]("deploy2Wildfly", "Deploy to a wildfly server instance", KeyRanks.ATask)

View File

@@ -4,6 +4,7 @@ import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* Created by walter on 22/03/15. * Created by walter on 22/03/15.
@@ -46,29 +47,29 @@ public class PkgData
public String fileName; public String fileName;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> replaces; public Set<String> replaces;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> conflict; public Set<String> conflict;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> provides; public Set<String> provides;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> depend; public Set<String> depend;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> optdepend; public Set<String> optdepend;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> makedepend; public Set<String> makedepend;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> makeopkgopt; public Set<String> makeopkgopt;
@ElementCollection(fetch = FetchType.LAZY) @ElementCollection(fetch = FetchType.EAGER)
public List<String> backup; public Set<String> backup;
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
public Date updTimestamp; public Date updTimestamp;

View File

@@ -78,7 +78,7 @@ public class Parser
data.arch = propMap.get(key).get(0); data.arch = propMap.get(key).get(0);
break; break;
case "replaces": case "replaces":
data.replaces = propMap.get(key); data.replaces = new HashSet(propMap.get(key));
break; break;
case "packager": case "packager":
data.packager = propMap.get(key).get(0); data.packager = propMap.get(key).get(0);
@@ -102,25 +102,25 @@ public class Parser
data.description = propMap.get(key).get(0); data.description = propMap.get(key).get(0);
break; break;
case "provides": case "provides":
data.provides = propMap.get(key); data.provides = new HashSet(propMap.get(key));
break; break;
case "conflict": case "conflict":
data.conflict = propMap.get(key); data.conflict = new HashSet(propMap.get(key));
break; break;
case "backup": case "backup":
data.backup = propMap.get(key); data.backup = new HashSet(propMap.get(key));
break; break;
case "optdepend": case "optdepend":
data.optdepend = propMap.get(key); data.optdepend = new HashSet(propMap.get(key));
break; break;
case "depend": case "depend":
data.depend = propMap.get(key); data.depend = new HashSet(propMap.get(key));
break; break;
case "makedepend": case "makedepend":
data.makedepend = propMap.get(key); data.makedepend = new HashSet(propMap.get(key));
break; break;
case "makepkgopt": case "makepkgopt":
data.makeopkgopt = propMap.get(key); data.makeopkgopt = new HashSet(propMap.get(key));
break; break;
case "pkgbase": case "pkgbase":
data.base = propMap.get(key).get(0); data.base = propMap.get(key).get(0);

View File

@@ -73,6 +73,7 @@ public class PacmanWebService
} }
else if (name != null || arch != null || version != null) else if (name != null || arch != null || version != null)
{ {
QueryEngine qe = new QueryEngine(PkgData.class); QueryEngine qe = new QueryEngine(PkgData.class);
qe.select(); qe.select();
if (name != null) qe.where("name", "=", name); if (name != null) qe.where("name", "=", name);