fixed bug with LAZY fetch of ElementCollections
This commit is contained in:
14
build.sbt
14
build.sbt
@@ -10,13 +10,15 @@ scalaVersion := "2.12.2"
|
||||
libraryDependencies += "org.tukaani" % "xz" % "1.6"
|
||||
libraryDependencies += "org.apache.commons" % "commons-compress" % "1.14"
|
||||
libraryDependencies += "org.projectlombok" % "lombok" % "1.16.18" % "provided"
|
||||
//libraryDependencies += "javax" % "javaee-api" % "7.0" % "provided"
|
||||
libraryDependencies += "javax" % "javaee-api" % "7.0"
|
||||
libraryDependencies += "javax" % "javaee-api" % "7.0" % "provided"
|
||||
//libraryDependencies += "javax" % "javaee-api" % "7.0 "
|
||||
|
||||
libraryDependencies += "junit" % "junit" % "4.12" % "test"
|
||||
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
|
||||
libraryDependencies += "com.thoughtworks.xstream" % "xstream" % "1.4.10"
|
||||
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-client" % "3.1.3.Final"
|
||||
@@ -34,13 +36,17 @@ libraryDependencies += "org.jboss.resteasy" % "resteasy-jaxb-provider" % "3.0.11
|
||||
|
||||
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 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")
|
||||
|
||||
wildflyUsername := "admin"
|
||||
wildflyUsername := "root"
|
||||
wildflyPassword := "123456"
|
||||
wildflyURL := "localhost:9990"
|
||||
wildflyURL := "localhost:1234"
|
||||
|
||||
val deploy2Wildfly = TaskKey[Unit]("deploy2Wildfly", "Deploy to a wildfly server instance", KeyRanks.ATask)
|
||||
|
||||
|
@@ -4,6 +4,7 @@ import javax.persistence.*;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Created by walter on 22/03/15.
|
||||
@@ -12,8 +13,8 @@ import java.util.List;
|
||||
|
||||
@Entity
|
||||
@XmlRootElement
|
||||
@NamedQuery(name="searchById", query = "SELECT p FROM PkgData p WHERE p.id = :id")
|
||||
@Table(indexes = { @Index(columnList = "md5sum", unique = true), @Index(columnList = "fileName", unique = true) })
|
||||
@NamedQuery(name = "searchById", query = "SELECT p FROM PkgData p WHERE p.id = :id")
|
||||
@Table(indexes = {@Index(columnList = "md5sum", unique = true), @Index(columnList = "fileName", unique = true)})
|
||||
public class PkgData
|
||||
{
|
||||
@Id
|
||||
@@ -46,29 +47,29 @@ public class PkgData
|
||||
|
||||
public String fileName;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> replaces;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> replaces;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> conflict;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> conflict;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> provides;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> provides;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> depend;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> depend;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> optdepend;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> optdepend;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> makedepend;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> makedepend;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> makeopkgopt;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> makeopkgopt;
|
||||
|
||||
@ElementCollection(fetch = FetchType.LAZY)
|
||||
public List<String> backup;
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
public Set<String> backup;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
public Date updTimestamp;
|
||||
|
@@ -78,7 +78,7 @@ public class Parser
|
||||
data.arch = propMap.get(key).get(0);
|
||||
break;
|
||||
case "replaces":
|
||||
data.replaces = propMap.get(key);
|
||||
data.replaces = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "packager":
|
||||
data.packager = propMap.get(key).get(0);
|
||||
@@ -102,25 +102,25 @@ public class Parser
|
||||
data.description = propMap.get(key).get(0);
|
||||
break;
|
||||
case "provides":
|
||||
data.provides = propMap.get(key);
|
||||
data.provides = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "conflict":
|
||||
data.conflict = propMap.get(key);
|
||||
data.conflict = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "backup":
|
||||
data.backup = propMap.get(key);
|
||||
data.backup = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "optdepend":
|
||||
data.optdepend = propMap.get(key);
|
||||
data.optdepend = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "depend":
|
||||
data.depend = propMap.get(key);
|
||||
data.depend = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "makedepend":
|
||||
data.makedepend = propMap.get(key);
|
||||
data.makedepend = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "makepkgopt":
|
||||
data.makeopkgopt = propMap.get(key);
|
||||
data.makeopkgopt = new HashSet(propMap.get(key));
|
||||
break;
|
||||
case "pkgbase":
|
||||
data.base = propMap.get(key).get(0);
|
||||
|
@@ -73,6 +73,7 @@ public class PacmanWebService
|
||||
}
|
||||
else if (name != null || arch != null || version != null)
|
||||
{
|
||||
|
||||
QueryEngine qe = new QueryEngine(PkgData.class);
|
||||
qe.select();
|
||||
if (name != null) qe.where("name", "=", name);
|
||||
|
Reference in New Issue
Block a user