diff --git a/core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/CostEstimator.scala b/core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/CostEstimator.scala
index ed1732f1d38..c0f82313597 100644
--- a/core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/CostEstimator.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/CostEstimator.scala
@@ -1,18 +1,17 @@
package edu.uci.ics.amber.engine.architecture.scheduling
-import edu.uci.ics.amber.core.storage.{DocumentFactory, StorageConfig}
+import edu.uci.ics.amber.core.storage.DocumentFactory
import edu.uci.ics.amber.core.tuple.Tuple
+import edu.uci.ics.amber.core.virtualidentity.ActorVirtualIdentity
import edu.uci.ics.amber.core.workflow.WorkflowContext
import edu.uci.ics.amber.engine.architecture.scheduling.DefaultCostEstimator.DEFAULT_OPERATOR_COST
import edu.uci.ics.amber.engine.common.AmberLogging
-import edu.uci.ics.amber.core.virtualidentity.ActorVirtualIdentity
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.dao.SqlServer.withTransaction
import edu.uci.ics.texera.dao.jooq.generated.Tables.{WORKFLOW_EXECUTIONS, WORKFLOW_VERSION}
-import org.jooq.types.UInteger
-import scala.util.{Failure, Success, Try}
import java.net.URI
+import scala.util.{Failure, Success, Try}
/**
* A cost estimator should estimate a cost of running a region under the given resource constraints as units.
@@ -85,11 +84,7 @@ class DefaultCostEstimator(
val uriString: String = withTransaction(
SqlServer
- .getInstance(
- StorageConfig.jdbcUrl,
- StorageConfig.jdbcUsername,
- StorageConfig.jdbcPassword
- )
+ .getInstance()
.createDSLContext()
) { context =>
context
@@ -99,7 +94,7 @@ class DefaultCostEstimator(
.on(WORKFLOW_VERSION.VID.eq(WORKFLOW_EXECUTIONS.VID))
.where(
WORKFLOW_VERSION.WID
- .eq(UInteger.valueOf(wid))
+ .eq(wid.toInt)
.and(WORKFLOW_EXECUTIONS.STATUS.eq(3.toByte))
)
.orderBy(WORKFLOW_EXECUTIONS.STARTING_TIME.desc())
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitMaster.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitMaster.scala
index a46bc20bb84..ca7de7e7592 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitMaster.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitMaster.scala
@@ -2,7 +2,7 @@ package edu.uci.ics.texera.web
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.typesafe.scalalogging.LazyLogging
-import edu.uci.ics.amber.core.storage.DocumentFactory
+import edu.uci.ics.amber.core.storage.{DocumentFactory, StorageConfig}
import edu.uci.ics.amber.core.storage.util.mongo.MongoDatabaseManager
import edu.uci.ics.amber.core.workflow.{PhysicalPlan, WorkflowContext}
import edu.uci.ics.amber.engine.architecture.controller.ControllerConfig
@@ -16,6 +16,7 @@ import edu.uci.ics.amber.engine.common.client.AmberClient
import edu.uci.ics.amber.engine.common.storage.SequentialRecordStorage
import edu.uci.ics.amber.engine.common.{AmberConfig, AmberRuntime, Utils}
import edu.uci.ics.amber.core.virtualidentity.ExecutionIdentity
+import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.JwtAuth.setupJwtAuth
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.WorkflowExecutions
import edu.uci.ics.texera.web.resource.WorkflowWebsocketResource
@@ -98,6 +99,12 @@ class ComputingUnitMaster extends io.dropwizard.Application[Configuration] with
override def run(configuration: Configuration, environment: Environment): Unit = {
+ SqlServer.initConnection(
+ StorageConfig.jdbcUrl,
+ StorageConfig.jdbcUsername,
+ StorageConfig.jdbcPassword
+ )
+
val webSocketUpgradeFilter =
WebSocketUpgradeFilter.configureContext(environment.getApplicationContext)
webSocketUpgradeFilter.getFactory.getPolicy.setIdleTimeout(Duration.ofHours(1).toMillis)
@@ -149,7 +156,7 @@ class ComputingUnitMaster extends io.dropwizard.Application[Configuration] with
*/
private def cleanExecutions(
executions: List[WorkflowExecutions],
- statusChangeFunc: Byte => Byte
+ statusChangeFunc: Short => Short
): Unit = {
// drop the collection and update the status to ABORTED
executions.foreach(execEntry => {
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitWorker.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitWorker.scala
index b8302a8aee8..a93e3faf076 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitWorker.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/ComputingUnitWorker.scala
@@ -26,6 +26,7 @@ object ComputingUnitWorker {
def main(args: Array[String]): Unit = {
val argMap = parseArgs(args)
+
// start actor system worker node
AmberRuntime.startActorWorker(argMap.get(Symbol("serverAddr")).asInstanceOf[Option[String]])
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/ServletAwareConfigurator.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/ServletAwareConfigurator.scala
index ce0e65913bc..5f8257ca89c 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/ServletAwareConfigurator.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/ServletAwareConfigurator.scala
@@ -4,7 +4,6 @@ import com.typesafe.scalalogging.LazyLogging
import edu.uci.ics.texera.web.auth.JwtAuth.jwtConsumer
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import org.apache.http.client.utils.URLEncodedUtils
-import org.jooq.types.UInteger
import java.net.URI
import java.nio.charset.Charset
@@ -39,7 +38,7 @@ class ServletAwareConfigurator extends ServerEndpointConfig.Configurator with La
config.getUserProperties.put(
classOf[User].getName,
new User(
- UInteger.valueOf(claims.getClaimValue("userId").asInstanceOf[Long]),
+ claims.getClaimValue("userId").asInstanceOf[Long].toInt,
claims.getSubject,
String.valueOf(claims.getClaimValue("email").asInstanceOf[String]),
null,
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/TexeraWebApplication.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/TexeraWebApplication.scala
index b5a52b47542..be2e9691eeb 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/TexeraWebApplication.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/TexeraWebApplication.scala
@@ -4,9 +4,11 @@ import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.github.dirkraft.dropwizard.fileassets.FileAssetsBundle
import com.typesafe.scalalogging.LazyLogging
+import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.core.storage.util.dataset.GitVersionControlLocalFileStorage
import edu.uci.ics.amber.engine.common.Utils
import edu.uci.ics.amber.util.PathUtils
+import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.JwtAuth.setupJwtAuth
import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.web.resource._
@@ -98,6 +100,12 @@ class TexeraWebApplication
// serve backend at /api
environment.jersey.setUrlPattern("/api/*")
+ SqlServer.initConnection(
+ StorageConfig.jdbcUrl,
+ StorageConfig.jdbcUsername,
+ StorageConfig.jdbcPassword
+ )
+
// redirect all 404 to index page, according to Angular routing requirements
val eph = new ErrorPageErrorHandler
eph.addErrorPage(404, "/")
@@ -148,5 +156,6 @@ class TexeraWebApplication
environment.jersey.register(classOf[AdminExecutionResource])
environment.jersey.register(classOf[UserQuotaResource])
environment.jersey.register(classOf[AIAssistantResource])
+
}
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/WebsocketInput.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/WebsocketInput.scala
index bc4a3eddba4..2e3506c21b0 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/WebsocketInput.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/WebsocketInput.scala
@@ -3,17 +3,16 @@ package edu.uci.ics.texera.web
import edu.uci.ics.texera.web.model.websocket.request.TexeraWebSocketRequest
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.subjects.PublishSubject
-import org.jooq.types.UInteger
import scala.reflect.{ClassTag, classTag}
class WebsocketInput(errorHandler: Throwable => Unit) {
- private val wsInput = PublishSubject.create[(TexeraWebSocketRequest, Option[UInteger])]()
+ private val wsInput = PublishSubject.create[(TexeraWebSocketRequest, Option[Integer])]()
def subscribe[T <: TexeraWebSocketRequest: ClassTag](
- callback: (T, Option[UInteger]) => Unit
+ callback: (T, Option[Integer]) => Unit
): Disposable = {
- wsInput.subscribe((evt: (TexeraWebSocketRequest, Option[UInteger])) => {
+ wsInput.subscribe((evt: (TexeraWebSocketRequest, Option[Integer])) => {
evt._1 match {
case req: T if classTag[T].runtimeClass.isInstance(req) =>
try {
@@ -28,7 +27,7 @@ class WebsocketInput(errorHandler: Throwable => Unit) {
})
}
- def onNext(req: TexeraWebSocketRequest, uidOpt: Option[UInteger]): Unit = {
+ def onNext(req: TexeraWebSocketRequest, uidOpt: Option[Integer]): Unit = {
wsInput.onNext((req, uidOpt))
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/GuestAuthFilter.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/GuestAuthFilter.scala
index 318a12c8f2d..398d2affabb 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/GuestAuthFilter.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/GuestAuthFilter.scala
@@ -1,7 +1,7 @@
package edu.uci.ics.texera.web.auth
import edu.uci.ics.texera.web.auth.GuestAuthFilter.GUEST
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import io.dropwizard.auth.AuthFilter
@@ -18,7 +18,7 @@ import javax.ws.rs.core.SecurityContext
override protected def newInstance = new GuestAuthFilter
}
- val GUEST: User = new User(null, "guest", null, null, null, UserRole.REGULAR, null)
+ val GUEST: User = new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR)
}
@PreMatching
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/SessionUser.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/SessionUser.scala
index baee51b24fb..e3c722e96ba 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/SessionUser.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/SessionUser.scala
@@ -1,8 +1,7 @@
package edu.uci.ics.texera.web.auth
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
-import org.jooq.types.UInteger
import java.security.Principal
@@ -11,11 +10,11 @@ class SessionUser(val user: User) extends Principal {
override def getName: String = user.getName
- def getUid: UInteger = user.getUid
+ def getUid: Integer = user.getUid
def getEmail: String = user.getEmail
def getGoogleId: String = user.getGoogleId
- def isRoleOf(role: UserRole): Boolean = user.getRole == role
+ def isRoleOf(role: UserRoleEnum): Boolean = user.getRole == role
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserAuthenticator.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserAuthenticator.scala
index 2a4947dc2ce..05c331ec683 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserAuthenticator.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserAuthenticator.scala
@@ -1,10 +1,10 @@
package edu.uci.ics.texera.web.auth
import com.typesafe.scalalogging.LazyLogging
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import io.dropwizard.auth.Authenticator
-import org.jooq.types.UInteger
+
import org.jose4j.jwt.consumer.JwtContext
import java.util.Optional
@@ -16,10 +16,11 @@ object UserAuthenticator extends Authenticator[JwtContext, SessionUser] with Laz
try {
val userName = context.getJwtClaims.getSubject
val email = context.getJwtClaims.getClaimValue("email").asInstanceOf[String]
- val userId = UInteger.valueOf(context.getJwtClaims.getClaimValue("userId").asInstanceOf[Long])
- val role = UserRole.valueOf(context.getJwtClaims.getClaimValue("role").asInstanceOf[String])
+ val userId = context.getJwtClaims.getClaimValue("userId").asInstanceOf[Long].toInt
+ val role =
+ UserRoleEnum.valueOf(context.getJwtClaims.getClaimValue("role").asInstanceOf[String])
val googleId = context.getJwtClaims.getClaimValue("googleId").asInstanceOf[String]
- val user = new User(userId, userName, email, null, googleId, role, null)
+ val user = new User(userId, userName, email, null, googleId, null, role)
Optional.of(new SessionUser(user))
} catch {
case e: Exception =>
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserRoleAuthorizer.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserRoleAuthorizer.scala
index 67ceade63ab..40322e881aa 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserRoleAuthorizer.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/auth/UserRoleAuthorizer.scala
@@ -1,10 +1,10 @@
package edu.uci.ics.texera.web.auth
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import io.dropwizard.auth.Authorizer
object UserRoleAuthorizer extends Authorizer[SessionUser] {
override def authorize(user: SessionUser, role: String): Boolean = {
- user.isRoleOf(UserRole.valueOf(role))
+ user.isRoleOf(UserRoleEnum.valueOf(role))
}
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/CollaborationResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/CollaborationResource.scala
index ac782c93102..8c995bc6ef2 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/CollaborationResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/CollaborationResource.scala
@@ -9,7 +9,6 @@ import edu.uci.ics.texera.web.model.collab.response.HeartBeatResponse
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import edu.uci.ics.texera.web.resource.CollaborationResource._
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowAccessResource
-import org.jooq.types.UInteger
import javax.websocket.server.ServerEndpoint
import javax.websocket.{OnClose, OnMessage, OnOpen, Session}
@@ -25,7 +24,7 @@ object CollaborationResource {
final val DUMMY_WID = -1
private def checkIsReadOnly(wId: Int, uId: Int): Boolean = {
- !WorkflowAccessResource.hasWriteAccess(UInteger.valueOf(wId), UInteger.valueOf(uId))
+ !WorkflowAccessResource.hasWriteAccess(Integer.valueOf(wId), Integer.valueOf(uId))
}
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/UserConfigResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/UserConfigResource.scala
index ff364962ee9..26420098b80 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/UserConfigResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/UserConfigResource.scala
@@ -1,11 +1,10 @@
package edu.uci.ics.texera.web.resource
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
-import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.dao.jooq.generated.Tables.USER_CONFIG
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.UserConfigDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{User, UserConfig}
+import edu.uci.ics.texera.web.auth.SessionUser
import io.dropwizard.auth.Auth
import javax.annotation.security.RolesAllowed
@@ -25,7 +24,7 @@ import scala.jdk.CollectionConverters.CollectionHasAsScala
class UserConfigResource {
final private lazy val userDictionaryDao = new UserConfigDao(
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.configuration
)
@@ -43,7 +42,7 @@ class UserConfigResource {
*/
private def getDict(user: User): Map[String, String] = {
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.select()
.from(USER_CONFIG)
@@ -79,7 +78,7 @@ class UserConfigResource {
*/
private def getValueByKey(user: User, key: String): String = {
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.fetchOne(
USER_CONFIG,
@@ -118,7 +117,7 @@ class UserConfigResource {
private def dictEntryExists(user: User, key: String): Boolean = {
userDictionaryDao.existsById(
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.newRecord(USER_CONFIG.UID, USER_CONFIG.KEY)
.values(user.getUid, key)
@@ -154,7 +153,7 @@ class UserConfigResource {
private def deleteDictEntry(user: User, key: String): Unit = {
userDictionaryDao.deleteById(
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.newRecord(USER_CONFIG.UID, USER_CONFIG.KEY)
.values(user.getUid, key)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/AuthResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/AuthResource.scala
index 513d5dbeaef..4d4689a5988 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/AuthResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/AuthResource.scala
@@ -1,6 +1,5 @@
package edu.uci.ics.texera.web.resource.auth
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.engine.common.AmberConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.JwtAuth._
@@ -11,7 +10,7 @@ import edu.uci.ics.texera.web.model.http.request.auth.{
}
import edu.uci.ics.texera.web.model.http.response.TokenIssueResponse
import edu.uci.ics.texera.dao.jooq.generated.Tables.USER
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.UserDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import edu.uci.ics.texera.web.resource.auth.AuthResource._
@@ -24,7 +23,7 @@ object AuthResource {
final private lazy val userDao = new UserDao(
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.configuration
)
@@ -40,7 +39,7 @@ object AuthResource {
def retrieveUserByUsernameAndPassword(name: String, password: String): Option[User] = {
Option(
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.select()
.from(USER)
@@ -88,7 +87,7 @@ class AuthResource {
val user = new User
user.setName(username)
user.setEmail(username)
- user.setRole(UserRole.ADMIN)
+ user.setRole(UserRoleEnum.ADMIN)
// hash the plain text password
user.setPassword(new StrongPasswordEncryptor().encryptPassword(request.password))
userDao.insert(user)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/GoogleAuthResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/GoogleAuthResource.scala
index 175a62fc2ab..4cac1eb3059 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/GoogleAuthResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/auth/GoogleAuthResource.scala
@@ -3,7 +3,6 @@ package edu.uci.ics.texera.web.resource.auth
import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier
import com.google.api.client.http.javanet.NetHttpTransport
import com.google.api.client.json.gson.GsonFactory
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.engine.common.AmberConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.JwtAuth.{
@@ -13,7 +12,7 @@ import edu.uci.ics.texera.web.auth.JwtAuth.{
jwtToken
}
import edu.uci.ics.texera.web.model.http.response.TokenIssueResponse
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.UserDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import edu.uci.ics.texera.web.resource.auth.GoogleAuthResource.userDao
@@ -25,7 +24,7 @@ import javax.ws.rs.core.MediaType
object GoogleAuthResource {
final private lazy val userDao = new UserDao(
SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
.configuration
)
@@ -90,7 +89,7 @@ class GoogleAuthResource {
user.setName(googleName)
user.setEmail(googleEmail)
user.setGoogleId(googleId)
- user.setRole(UserRole.INACTIVE)
+ user.setRole(UserRoleEnum.INACTIVE)
user.setGoogleAvatar(googleAvatar)
userDao.insert(user)
user
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DashboardResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DashboardResource.scala
index e14b0d839e7..86464b7ba02 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DashboardResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DashboardResource.scala
@@ -8,7 +8,7 @@ import edu.uci.ics.texera.web.resource.dashboard.SearchQueryBuilder.{ALL_RESOURC
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetResource.DashboardDataset
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.DashboardWorkflow
import io.dropwizard.auth.Auth
-import org.jooq.types.UInteger
+
import org.jooq.{Field, OrderField}
import java.util
@@ -24,7 +24,7 @@ object DashboardResource {
dataset: Option[DashboardDataset] = None
)
- case class UserInfo(userId: UInteger, userName: String, googleAvatar: Option[String])
+ case class UserInfo(userId: Integer, userName: String, googleAvatar: Option[String])
case class DashboardSearchResult(results: List[DashboardClickableFileEntry], more: Boolean)
@@ -53,10 +53,10 @@ object DashboardResource {
@QueryParam("modifiedDateStart") @DefaultValue("") modifiedStartDate: String = "",
@QueryParam("modifiedDateEnd") @DefaultValue("") modifiedEndDate: String = "",
@QueryParam("owner") owners: java.util.List[String] = new util.ArrayList(),
- @QueryParam("id") workflowIDs: java.util.List[UInteger] = new util.ArrayList(),
+ @QueryParam("id") workflowIDs: java.util.List[Integer] = new util.ArrayList(),
@QueryParam("operator") operators: java.util.List[String] = new util.ArrayList(),
- @QueryParam("projectId") projectIds: java.util.List[UInteger] = new util.ArrayList(),
- @QueryParam("datasetId") datasetIds: java.util.List[UInteger] = new util.ArrayList(),
+ @QueryParam("projectId") projectIds: java.util.List[Integer] = new util.ArrayList(),
+ @QueryParam("datasetId") datasetIds: java.util.List[Integer] = new util.ArrayList(),
@QueryParam("start") @DefaultValue("0") offset: Int = 0,
@QueryParam("count") @DefaultValue("20") count: Int = 20,
@QueryParam("orderBy") @DefaultValue("EditTimeDesc") orderBy: String = "EditTimeDesc"
@@ -180,9 +180,9 @@ class DashboardResource {
@GET
@Path("/resultsOwnersInfo")
def resultsOwnersInfo(
- @QueryParam("userIds") userIds: util.List[UInteger]
- ): util.Map[UInteger, UserInfo] = {
- val scalaUserIds: Set[UInteger] = userIds.asScala.toSet
+ @QueryParam("userIds") userIds: util.List[Integer]
+ ): util.Map[Integer, UserInfo] = {
+ val scalaUserIds: Set[Integer] = userIds.asScala.toSet
val records = context
.select(USER.UID, USER.NAME, USER.GOOGLE_AVATAR)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DatasetSearchQueryBuilder.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DatasetSearchQueryBuilder.scala
index b83903b7e1f..3c28963dd71 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DatasetSearchQueryBuilder.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/DatasetSearchQueryBuilder.scala
@@ -1,7 +1,7 @@
package edu.uci.ics.texera.web.resource.dashboard
import edu.uci.ics.texera.dao.jooq.generated.Tables.{DATASET, DATASET_USER_ACCESS}
-import edu.uci.ics.texera.dao.jooq.generated.enums.DatasetUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.User.USER
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{Dataset, User}
import edu.uci.ics.texera.web.resource.dashboard.DashboardResource.DashboardClickableFileEntry
@@ -14,7 +14,7 @@ import edu.uci.ics.texera.web.resource.dashboard.FulltextSearchQueryUtils.{
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetResource
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetResource.DashboardDataset
import org.jooq.impl.DSL
-import org.jooq.types.UInteger
+
import org.jooq.{Condition, GroupField, Record, TableLike}
import scala.jdk.CollectionConverters.CollectionHasAsScala
@@ -35,13 +35,13 @@ object DatasetSearchQueryBuilder extends SearchQueryBuilder {
* constructs the FROM clause for querying datasets with specific access controls.
*
* Parameter:
- * - uid: UInteger - Represents the unique identifier of the current user.
+ * - uid: Integer - Represents the unique identifier of the current user.
* - uid is 'null' if the user is not logged in or performing a public search.
* - Otherwise, `uid` holds the identifier for the logged-in user.
* - includePublic - Boolean - Specifies whether to include public datasets in the result.
*/
override protected def constructFromClause(
- uid: UInteger,
+ uid: Integer,
params: DashboardResource.SearchQueryParams,
includePublic: Boolean = false
): TableLike[_] = {
@@ -57,14 +57,14 @@ object DatasetSearchQueryBuilder extends SearchQueryBuilder {
if (uid == null) {
// If `uid` is null, the user is not logged in or performing a public search
// We only select datasets marked as public
- condition = DATASET.IS_PUBLIC.eq(1.toByte)
+ condition = DATASET.IS_PUBLIC.eq(true)
} else {
// When `uid` is present, we add a condition to only include datasets with direct user access.
val userAccessCondition = DATASET_USER_ACCESS.UID.eq(uid)
if (includePublic) {
// If `includePublic` is true, we extend visibility to public datasets as well.
- condition = userAccessCondition.or(DATASET.IS_PUBLIC.eq(1.toByte))
+ condition = userAccessCondition.or(DATASET.IS_PUBLIC.eq(true))
} else {
condition = userAccessCondition
}
@@ -73,7 +73,7 @@ object DatasetSearchQueryBuilder extends SearchQueryBuilder {
}
override protected def constructWhereClause(
- uid: UInteger,
+ uid: Integer,
params: DashboardResource.SearchQueryParams
): Condition = {
val splitKeywords = params.keywords.asScala
@@ -99,11 +99,11 @@ object DatasetSearchQueryBuilder extends SearchQueryBuilder {
}
override protected def getGroupByFields: Seq[GroupField] = {
- Seq(DATASET.DID)
+ Seq.empty
}
override protected def toEntryImpl(
- uid: UInteger,
+ uid: Integer,
record: Record
): DashboardResource.DashboardClickableFileEntry = {
val dataset = record.into(DATASET).into(classOf[Dataset])
@@ -114,7 +114,7 @@ object DatasetSearchQueryBuilder extends SearchQueryBuilder {
record
.get(
DATASET_USER_ACCESS.PRIVILEGE,
- classOf[DatasetUserAccessPrivilege]
+ classOf[PrivilegeEnum]
),
dataset.getOwnerUid == uid,
List(),
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/FulltextSearchQueryUtils.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/FulltextSearchQueryUtils.scala
index 167d4831378..0538840d65d 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/FulltextSearchQueryUtils.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/FulltextSearchQueryUtils.scala
@@ -15,31 +15,66 @@ object FulltextSearchQueryUtils {
fields: List[Field[String]]
): Condition = {
if (fields.isEmpty) return noCondition()
+
+ // Filter out empty keywords and trim
val trimmedKeywords = keywords.filter(_.nonEmpty).map(_.trim)
- val fullFieldNames = fields.map(_.toString.replace("\"", ""))
- val indexedCompoundFields = fullFieldNames.mkString(",")
- trimmedKeywords.foldLeft(noCondition()) { (acc, key) =>
- val words = key.split("\\s+")
- acc.and(
- condition(
- s"MATCH($indexedCompoundFields) AGAINST('${words.mkString("+", " +", "")}' IN BOOLEAN MODE)",
- key
- )
- )
+
+ // Build a SQL expression that concatenates all fields with spaces,
+ // then feeds them into to_tsvector('english', ...).
+ // E.g.: to_tsvector('english', COALESCE(firstName, '') || ' ' || COALESCE(lastName, ''))
+ val combinedFields = fields
+ .map(f => s"COALESCE($f, '')") // handle null -> ''
+ .mkString(" || ' ' || ")
+
+ // Fold each keyword into the final Condition
+ trimmedKeywords.foldLeft(noCondition()) { (acc, keyword) =>
+ // For each "keyword", split it into words
+ val words = keyword.split("\\s+").filter(_.nonEmpty)
+
+ // In Postgres tsquery syntax, an AND search uses '&' between terms
+ // e.g.: apple & banana
+ val tsQuery = words.mkString(" & ")
+
+ // Build the raw SQL string for Postgres FTS
+ // e.g.: to_tsvector('english', COALESCE(firstName, '') || ' ' || COALESCE(lastName, '')) @@ to_tsquery('english', 'apple & banana')
+ val conditionExpr =
+ s"to_tsvector('english', $combinedFields) @@ to_tsquery('english', '$tsQuery')"
+
+ // 'condition(...)' is presumably your helper method that takes a raw SQL string
+ // and an optional binding for debug/logging
+ acc.and(condition(conditionExpr, keyword))
}
}
def getSubstringSearchFilter(
keywords: Seq[String],
- fields: List[Field[String]]
+ fields: List[Field[String]],
+ caseInsensitive: Boolean = false
): Condition = {
+ // If no fields, return a "no-op" condition
if (fields.isEmpty) return noCondition()
+
+ // Trim and discard empty keywords
val trimmedKeywords = keywords.filter(_.nonEmpty).map(_.trim)
- val fullFieldNames = fields.map(_.toString.replace("\"", ""))
- fullFieldNames.foldLeft(noCondition()) { (acc, fieldName) =>
- acc.or(trimmedKeywords.foldLeft(noCondition()) { (accInner, key) =>
- accInner.and(s"$fieldName LIKE '%$key%'")
- })
+
+ // For each field, create a condition that all keywords must match in that field
+ // e.g. field LIKE '%keyword1%' AND field LIKE '%keyword2%'
+ val fieldConditions: Seq[Condition] = fields.map { field =>
+ trimmedKeywords.foldLeft[Condition](noCondition()) { (acc, key) =>
+ val likeCondition =
+ if (caseInsensitive)
+ field.likeIgnoreCase(s"%$key%") // Postgres-specific case-insensitive match
+ else field.like(s"%$key%") // standard SQL LIKE
+ if (acc == noCondition()) likeCondition
+ else acc.and(likeCondition)
+ }
+ }
+
+ // Finally, OR across all fields
+ // (field1Condition) OR (field2Condition) OR ...
+ fieldConditions.foldLeft[Condition](noCondition()) { (acc, cond) =>
+ if (acc == noCondition()) cond
+ else acc.or(cond)
}
}
@@ -113,14 +148,23 @@ object FulltextSearchQueryUtils {
operators: java.util.List[String],
field: Field[String]
): Condition = {
+ // Convert to a Set to avoid duplicates
val operatorSet = operators.asScala.toSet
+ // Start with a "no condition" (logical TRUE) so we can accumulate
var fieldFilter = noCondition()
- for (operator <- operatorSet) {
- val quotes = "\""
- val searchKey =
- "%" + quotes + "operatorType" + quotes + ":" + quotes + operator + quotes + "%"
- fieldFilter = fieldFilter.or(field.likeIgnoreCase(searchKey))
+
+ // For each operator, build the substring pattern
+ operatorSet.foreach { operator =>
+ // e.g. => % "operatorType":"someOperator" %
+ val searchKey = s"""%"operatorType":"$operator"%"""
+
+ // Use jOOQ's likeIgnoreCase for case-insensitive matching
+ val cond = field.likeIgnoreCase(searchKey)
+
+ // Accumulate with OR
+ fieldFilter = fieldFilter.or(cond)
}
+
fieldFilter
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/ProjectSearchQueryBuilder.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/ProjectSearchQueryBuilder.scala
index a76d2b72a1b..9bb6a86cb63 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/ProjectSearchQueryBuilder.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/ProjectSearchQueryBuilder.scala
@@ -10,7 +10,7 @@ import edu.uci.ics.texera.web.resource.dashboard.FulltextSearchQueryUtils.{
getSubstringSearchFilter
}
import org.jooq.impl.DSL
-import org.jooq.types.UInteger
+
import org.jooq.{Condition, GroupField, Record, TableLike}
import scala.jdk.CollectionConverters.CollectionHasAsScala
@@ -29,7 +29,7 @@ object ProjectSearchQueryBuilder extends SearchQueryBuilder {
)
override protected def constructFromClause(
- uid: UInteger,
+ uid: Integer,
params: DashboardResource.SearchQueryParams,
includePublic: Boolean = false
): TableLike[_] = {
@@ -40,7 +40,7 @@ object ProjectSearchQueryBuilder extends SearchQueryBuilder {
}
override protected def constructWhereClause(
- uid: UInteger,
+ uid: Integer,
params: DashboardResource.SearchQueryParams
): Condition = {
val splitKeywords = params.keywords.asScala
@@ -68,7 +68,7 @@ object ProjectSearchQueryBuilder extends SearchQueryBuilder {
override protected def getGroupByFields: Seq[GroupField] = Seq.empty
override def toEntryImpl(
- uid: UInteger,
+ uid: Integer,
record: Record
): DashboardResource.DashboardClickableFileEntry = {
val dp = record.into(PROJECT).into(classOf[Project])
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/SearchQueryBuilder.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/SearchQueryBuilder.scala
index f2fb9cb746d..f129ba43042 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/SearchQueryBuilder.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/SearchQueryBuilder.scala
@@ -1,6 +1,5 @@
package edu.uci.ics.texera.web.resource.dashboard
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.resource.dashboard.DashboardResource.{
DashboardClickableFileEntry,
@@ -8,12 +7,11 @@ import edu.uci.ics.texera.web.resource.dashboard.DashboardResource.{
}
import edu.uci.ics.texera.web.resource.dashboard.SearchQueryBuilder.context
import org.jooq._
-import org.jooq.types.UInteger
object SearchQueryBuilder {
final lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
val FILE_RESOURCE_TYPE = "file"
val WORKFLOW_RESOURCE_TYPE = "workflow"
@@ -27,30 +25,30 @@ trait SearchQueryBuilder {
protected val mappedResourceSchema: UnifiedResourceSchema
protected def constructFromClause(
- uid: UInteger,
+ uid: Integer,
params: SearchQueryParams,
includePublic: Boolean = false
): TableLike[_]
- protected def constructWhereClause(uid: UInteger, params: SearchQueryParams): Condition
+ protected def constructWhereClause(uid: Integer, params: SearchQueryParams): Condition
protected def getGroupByFields: Seq[GroupField] = Seq.empty
- protected def toEntryImpl(uid: UInteger, record: Record): DashboardClickableFileEntry
+ protected def toEntryImpl(uid: Integer, record: Record): DashboardClickableFileEntry
private def translateRecord(record: Record): Record = mappedResourceSchema.translateRecord(record)
- def toEntry(uid: UInteger, record: Record): DashboardClickableFileEntry = {
+ def toEntry(uid: Integer, record: Record): DashboardClickableFileEntry = {
toEntryImpl(uid, translateRecord(record))
}
final def constructQuery(
- uid: UInteger,
+ uid: Integer,
params: SearchQueryParams,
includePublic: Boolean
): SelectHavingStep[Record] = {
val query: SelectGroupByStep[Record] = context
- .select(mappedResourceSchema.allFields: _*)
+ .selectDistinct(mappedResourceSchema.allFields: _*)
.from(constructFromClause(uid, params, includePublic))
.where(constructWhereClause(uid, params))
val groupByFields = getGroupByFields
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/UnifiedResourceSchema.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/UnifiedResourceSchema.scala
index 6b526d54443..84d67994b3b 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/UnifiedResourceSchema.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/UnifiedResourceSchema.scala
@@ -1,14 +1,9 @@
package edu.uci.ics.texera.web.resource.dashboard
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
-import edu.uci.ics.texera.dao.jooq.generated.enums.{
- DatasetUserAccessPrivilege,
- WorkflowUserAccessPrivilege
-}
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.web.resource.dashboard.UnifiedResourceSchema.context
import org.jooq.impl.DSL
-import org.jooq.types.UInteger
import org.jooq.{Field, Record}
import java.sql.Timestamp
@@ -33,31 +28,29 @@ object UnifiedResourceSchema {
val resourceLastModifiedTimeField: Field[_] = DSL.field(DSL.name(resourceLastModifiedTimeAlias))
final lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
def apply(
resourceType: Field[String] = DSL.inline(""),
name: Field[String] = DSL.inline(""),
description: Field[String] = DSL.inline(""),
- creationTime: Field[Timestamp] = DSL.inline(null, classOf[Timestamp]),
- lastModifiedTime: Field[Timestamp] = DSL.inline(null, classOf[Timestamp]),
- ownerId: Field[UInteger] = DSL.inline(null, classOf[UInteger]),
- wid: Field[UInteger] = DSL.inline(null, classOf[UInteger]),
- workflowUserAccess: Field[WorkflowUserAccessPrivilege] =
- DSL.inline(null, classOf[WorkflowUserAccessPrivilege]),
+ creationTime: Field[Timestamp] = DSL.cast(null, classOf[Timestamp]),
+ lastModifiedTime: Field[Timestamp] = DSL.cast(null, classOf[Timestamp]),
+ ownerId: Field[Integer] = DSL.cast(null, classOf[Integer]),
+ wid: Field[Integer] = DSL.cast(null, classOf[Integer]),
+ workflowUserAccess: Field[PrivilegeEnum] = DSL.castNull(classOf[PrivilegeEnum]),
projectsOfWorkflow: Field[String] = DSL.inline(""),
- uid: Field[UInteger] = DSL.inline(null, classOf[UInteger]),
+ uid: Field[Integer] = DSL.cast(null, classOf[Integer]),
userName: Field[String] = DSL.inline(""),
userEmail: Field[String] = DSL.inline(""),
- pid: Field[UInteger] = DSL.inline(null, classOf[UInteger]),
- projectOwnerId: Field[UInteger] = DSL.inline(null, classOf[UInteger]),
+ pid: Field[Integer] = DSL.cast(null, classOf[Integer]),
+ projectOwnerId: Field[Integer] = DSL.cast(null, classOf[Integer]),
projectColor: Field[String] = DSL.inline(""),
- did: Field[UInteger] = DSL.inline(null, classOf[UInteger]),
- datasetStoragePath: Field[String] = DSL.inline(null, classOf[String]),
- isDatasetPublic: Field[java.lang.Byte] = DSL.inline(null, classOf[java.lang.Byte]),
- datasetUserAccess: Field[DatasetUserAccessPrivilege] =
- DSL.inline(null, classOf[DatasetUserAccessPrivilege])
+ did: Field[Integer] = DSL.cast(null, classOf[Integer]),
+ datasetStoragePath: Field[String] = DSL.cast(null, classOf[String]),
+ isDatasetPublic: Field[java.lang.Boolean] = DSL.cast(null, classOf[java.lang.Boolean]),
+ datasetUserAccess: Field[PrivilegeEnum] = DSL.castNull(classOf[PrivilegeEnum])
): UnifiedResourceSchema = {
new UnifiedResourceSchema(
Seq(
@@ -94,31 +87,31 @@ object UnifiedResourceSchema {
* - `description`: A textual description of the resource as a `String`.
* - `creationTime`: The timestamp when the resource was created, as a `Timestamp`.
* - `lastModifiedTime`: The timestamp of the last modification to the resource, as a `Timestamp` (applicable to workflows).
- * - `ownerId`: The identifier of the resource's owner, as a `UInteger`.
+ * - `ownerId`: The identifier of the resource's owner, as a `Integer`.
*
* Attributes specific to workflows:
- * - `wid`: Workflow ID, as a `UInteger`.
- * - `workflowUserAccess`: Access privileges associated with the workflow, as a `WorkflowUserAccessPrivilege`.
+ * - `wid`: Workflow ID, as a `Integer`.
+ * - `workflowUserAccess`: Access privileges associated with the workflow, as a `PrivilegeEnum`.
* - `projectsOfWorkflow`: IDs of projects associated with the workflow, concatenated as a `String`.
- * - `uid`: User ID associated with the workflow, as a `UInteger`.
+ * - `uid`: User ID associated with the workflow, as a `Integer`.
* - `userName`: Name of the user associated with the workflow, as a `String`.
* - `userEmail`: Email of the user associated with the workflow, as a `String`.
*
* Attributes specific to projects:
- * - `pid`: Project ID, as a `UInteger`.
- * - `projectOwnerId`: ID of the project owner, as a `UInteger`.
+ * - `pid`: Project ID, as a `Integer`.
+ * - `projectOwnerId`: ID of the project owner, as a `Integer`.
* - `projectColor`: Color associated with the project, as a `String`.
*
* Attributes specific to files:
- * - `fid`: File ID, as a `UInteger`.
+ * - `fid`: File ID, as a `Integer`.
* - `fileUploadTime`: Timestamp when the file was uploaded, as a `Timestamp`.
* - `filePath`: Path of the file, as a `String`.
- * - `fileSize`: Size of the file, as a `UInteger`.
+ * - `fileSize`: Size of the file, as a `Integer`.
* - `fileUserAccess`: Access privileges for the file, as a `UserFileAccessPrivilege`.
*
* Attributes specific to datasets:
- * - `did`: Dataset ID, as a `UInteger`.
- * - `datasetUserAccess`: Access privileges for the dataset, as a `DatasetUserAccessPrivilege`
+ * - `did`: Dataset ID, as a `Integer`.
+ * - `datasetUserAccess`: Access privileges for the dataset, as a `PrivilegeEnum`
*/
class UnifiedResourceSchema private (
fieldMappingSeq: Seq[(Field[_], Field[_])]
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/WorkflowSearchQueryBuilder.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/WorkflowSearchQueryBuilder.scala
index 5ade3dff372..2735fc58002 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/WorkflowSearchQueryBuilder.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/WorkflowSearchQueryBuilder.scala
@@ -7,7 +7,6 @@ import edu.uci.ics.texera.web.resource.dashboard.FulltextSearchQueryUtils._
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.DashboardWorkflow
import org.jooq.impl.DSL
import org.jooq.impl.DSL.groupConcatDistinct
-import org.jooq.types.UInteger
import org.jooq.{Condition, GroupField, Record, TableLike}
import scala.jdk.CollectionConverters.CollectionHasAsScala
@@ -31,7 +30,7 @@ object WorkflowSearchQueryBuilder extends SearchQueryBuilder {
}
override protected def constructFromClause(
- uid: UInteger,
+ uid: Integer,
params: DashboardResource.SearchQueryParams,
includePublic: Boolean = false
): TableLike[_] = {
@@ -49,12 +48,12 @@ object WorkflowSearchQueryBuilder extends SearchQueryBuilder {
var condition: Condition = DSL.trueCondition()
if (uid == null) {
- condition = WORKFLOW.IS_PUBLIC.eq(1.toByte)
+ condition = WORKFLOW.IS_PUBLIC.eq(true)
} else {
val privateAccessCondition =
WORKFLOW_USER_ACCESS.UID.eq(uid).or(PROJECT_USER_ACCESS.UID.eq(uid))
if (includePublic) {
- condition = privateAccessCondition.or(WORKFLOW.IS_PUBLIC.eq(1.toByte))
+ condition = privateAccessCondition.or(WORKFLOW.IS_PUBLIC.eq(true))
} else {
condition = privateAccessCondition
}
@@ -64,7 +63,7 @@ object WorkflowSearchQueryBuilder extends SearchQueryBuilder {
}
override protected def constructWhereClause(
- uid: UInteger,
+ uid: Integer,
params: DashboardResource.SearchQueryParams
): Condition = {
val splitKeywords = params.keywords.asScala
@@ -107,11 +106,20 @@ object WorkflowSearchQueryBuilder extends SearchQueryBuilder {
}
override protected def getGroupByFields: Seq[GroupField] = {
- Seq(WORKFLOW.WID)
+ Seq(
+ WORKFLOW.NAME,
+ WORKFLOW.DESCRIPTION,
+ WORKFLOW.CREATION_TIME,
+ WORKFLOW.WID,
+ WORKFLOW.LAST_MODIFIED_TIME,
+ WORKFLOW_USER_ACCESS.PRIVILEGE,
+ WORKFLOW_OF_USER.UID,
+ USER.NAME
+ )
}
override def toEntryImpl(
- uid: UInteger,
+ uid: Integer,
record: Record
): DashboardResource.DashboardClickableFileEntry = {
val pidField = groupConcatDistinct(WORKFLOW_OF_PROJECT.PID)
@@ -123,13 +131,13 @@ object WorkflowSearchQueryBuilder extends SearchQueryBuilder {
record.into(USER).getName,
record.into(WORKFLOW).into(classOf[Workflow]),
if (record.get(pidField) == null) {
- List[UInteger]()
+ List[Integer]()
} else {
record
.get(pidField)
.asInstanceOf[String]
.split(',')
- .map(number => UInteger.valueOf(number))
+ .map(number => Integer.valueOf(number))
.toList
},
record.into(USER).getUid
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/execution/AdminExecutionResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/execution/AdminExecutionResource.scala
index 9a280f921f1..79a994cf924 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/execution/AdminExecutionResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/execution/AdminExecutionResource.scala
@@ -1,13 +1,11 @@
package edu.uci.ics.texera.web.resource.dashboard.admin.execution
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
-import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.dao.jooq.generated.Tables._
+import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.web.resource.dashboard.admin.execution.AdminExecutionResource._
import io.dropwizard.auth.Auth
import org.jooq.impl.DSL
-import org.jooq.types.UInteger
import javax.annotation.security.RolesAllowed
import javax.ws.rs._
@@ -20,15 +18,15 @@ import scala.jdk.CollectionConverters._
object AdminExecutionResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
case class dashboardExecution(
workflowName: String,
- workflowId: UInteger,
+ workflowId: Integer,
userName: String,
- userId: UInteger,
- executionId: UInteger,
+ userId: Integer,
+ executionId: Integer,
executionStatus: String,
executionTime: Double,
executionName: String,
@@ -37,7 +35,7 @@ object AdminExecutionResource {
access: Boolean
)
- def mapToName(code: Byte): String = {
+ def mapToName(code: Short): String = {
code match {
case 0 => "READY"
case 1 => "RUNNING"
@@ -169,7 +167,7 @@ class AdminExecutionResource {
.select(WORKFLOW_USER_ACCESS.WID)
.from(WORKFLOW_USER_ACCESS)
.where(WORKFLOW_USER_ACCESS.UID.eq(current_user.getUid))
- .fetchInto(classOf[UInteger])
+ .fetchInto(classOf[Integer])
// Calculate the statistics needed for each execution.
executions
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
index dccb8d70b05..e1e1e0f3fcd 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/admin/user/AdminUserResource.scala
@@ -1,14 +1,12 @@
package edu.uci.ics.texera.web.resource.dashboard.admin.user
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.UserDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.User
import edu.uci.ics.texera.web.resource.dashboard.admin.user.AdminUserResource.userDao
import edu.uci.ics.texera.web.resource.dashboard.user.quota.UserQuotaResource._
import org.jasypt.util.password.StrongPasswordEncryptor
-import org.jooq.types.UInteger
import java.util
import javax.annotation.security.RolesAllowed
@@ -17,7 +15,7 @@ import javax.ws.rs.core.{MediaType, Response}
object AdminUserResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private lazy val userDao = new UserDao(context.configuration)
}
@@ -35,7 +33,7 @@ class AdminUserResource {
@Path("/list")
@Produces(Array(MediaType.APPLICATION_JSON))
def listUser(): util.List[User] = {
- userDao.fetchRangeOfUid(UInteger.MIN, UInteger.MAX)
+ userDao.fetchRangeOfUid(Integer.MIN_VALUE, Integer.MAX_VALUE)
}
@PUT
@@ -59,28 +57,28 @@ class AdminUserResource {
val newUser = new User
newUser.setName("User" + random)
newUser.setPassword(new StrongPasswordEncryptor().encryptPassword(random))
- newUser.setRole(UserRole.INACTIVE)
+ newUser.setRole(UserRoleEnum.INACTIVE)
userDao.insert(newUser)
}
@GET
@Path("/created_workflows")
@Produces(Array(MediaType.APPLICATION_JSON))
- def getCreatedWorkflow(@QueryParam("user_id") user_id: UInteger): List[Workflow] = {
+ def getCreatedWorkflow(@QueryParam("user_id") user_id: Integer): List[Workflow] = {
getUserCreatedWorkflow(user_id)
}
@GET
@Path("/access_workflows")
@Produces(Array(MediaType.APPLICATION_JSON))
- def getAccessedWorkflow(@QueryParam("user_id") user_id: UInteger): util.List[UInteger] = {
+ def getAccessedWorkflow(@QueryParam("user_id") user_id: Integer): util.List[Integer] = {
getUserAccessedWorkflow(user_id)
}
@GET
@Path("/mongodb_size")
@Produces(Array(MediaType.APPLICATION_JSON))
- def mongoDBSize(@QueryParam("user_id") user_id: UInteger): Array[MongoStorage] = {
+ def mongoDBSize(@QueryParam("user_id") user_id: Integer): Array[MongoStorage] = {
getUserMongoDBSize(user_id)
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/EntityTables.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/EntityTables.scala
index 259441cbe97..22b803364f1 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/EntityTables.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/EntityTables.scala
@@ -1,40 +1,32 @@
package edu.uci.ics.texera.web.resource.dashboard.hub
-import edu.uci.ics.texera.dao.jooq.generated.tables.records.{
- DatasetRecord,
- DatasetUserLikesRecord,
- DatasetViewCountRecord,
- WorkflowRecord,
- WorkflowUserClonesRecord,
- WorkflowUserLikesRecord,
- WorkflowViewCountRecord
-}
-import org.jooq._
-import org.jooq.types.UInteger
import edu.uci.ics.texera.dao.jooq.generated.Tables._
+import edu.uci.ics.texera.dao.jooq.generated.tables.records._
+import org.jooq._
object EntityTables {
// ==================== BASE TABLE ====================
sealed trait BaseEntityTable {
type R <: Record
val table: Table[R]
- val isPublicColumn: TableField[R, java.lang.Byte]
- val idColumn: TableField[R, UInteger]
+ val isPublicColumn: TableField[R, java.lang.Boolean]
+ val idColumn: TableField[R, Integer]
}
object BaseEntityTable {
case object WorkflowTable extends BaseEntityTable {
override type R = WorkflowRecord
override val table: Table[WorkflowRecord] = WORKFLOW
- override val isPublicColumn: TableField[WorkflowRecord, java.lang.Byte] = WORKFLOW.IS_PUBLIC
- override val idColumn: TableField[WorkflowRecord, UInteger] = WORKFLOW.WID
+ override val isPublicColumn: TableField[WorkflowRecord, java.lang.Boolean] =
+ WORKFLOW.IS_PUBLIC
+ override val idColumn: TableField[WorkflowRecord, Integer] = WORKFLOW.WID
}
case object DatasetTable extends BaseEntityTable {
override type R = DatasetRecord
override val table: Table[DatasetRecord] = DATASET
- override val isPublicColumn: TableField[DatasetRecord, java.lang.Byte] = DATASET.IS_PUBLIC
- override val idColumn: TableField[DatasetRecord, UInteger] = DATASET.DID
+ override val isPublicColumn: TableField[DatasetRecord, java.lang.Boolean] = DATASET.IS_PUBLIC
+ override val idColumn: TableField[DatasetRecord, Integer] = DATASET.DID
}
def apply(entityType: String): BaseEntityTable = {
@@ -54,8 +46,8 @@ object EntityTables {
type R <: Record
val table: Table[R]
- val uidColumn: TableField[R, UInteger]
- val idColumn: TableField[R, UInteger]
+ val uidColumn: TableField[R, Integer]
+ val idColumn: TableField[R, Integer]
}
// ==================== LIKE TABLE ====================
@@ -65,17 +57,17 @@ object EntityTables {
case object WorkflowLikeTable extends LikeTable {
override type R = WorkflowUserLikesRecord
override val table: Table[WorkflowUserLikesRecord] = WORKFLOW_USER_LIKES
- override val uidColumn: TableField[WorkflowUserLikesRecord, UInteger] =
+ override val uidColumn: TableField[WorkflowUserLikesRecord, Integer] =
WORKFLOW_USER_LIKES.UID
- override val idColumn: TableField[WorkflowUserLikesRecord, UInteger] = WORKFLOW_USER_LIKES.WID
+ override val idColumn: TableField[WorkflowUserLikesRecord, Integer] = WORKFLOW_USER_LIKES.WID
}
case object DatasetLikeTable extends LikeTable {
override type R = DatasetUserLikesRecord
override val table: Table[DatasetUserLikesRecord] = DATASET_USER_LIKES
- override val uidColumn: TableField[DatasetUserLikesRecord, UInteger] =
+ override val uidColumn: TableField[DatasetUserLikesRecord, Integer] =
DATASET_USER_LIKES.UID
- override val idColumn: TableField[DatasetUserLikesRecord, UInteger] = DATASET_USER_LIKES.DID
+ override val idColumn: TableField[DatasetUserLikesRecord, Integer] = DATASET_USER_LIKES.DID
}
def apply(entityType: String): LikeTable =
@@ -94,9 +86,9 @@ object EntityTables {
case object WorkflowCloneTable extends CloneTable {
override type R = WorkflowUserClonesRecord
override val table: Table[WorkflowUserClonesRecord] = WORKFLOW_USER_CLONES
- override val uidColumn: TableField[WorkflowUserClonesRecord, UInteger] =
+ override val uidColumn: TableField[WorkflowUserClonesRecord, Integer] =
WORKFLOW_USER_CLONES.UID
- override val idColumn: TableField[WorkflowUserClonesRecord, UInteger] =
+ override val idColumn: TableField[WorkflowUserClonesRecord, Integer] =
WORKFLOW_USER_CLONES.WID
}
@@ -112,24 +104,24 @@ object EntityTables {
sealed trait ViewCountTable {
type R <: Record
val table: Table[R]
- val idColumn: TableField[R, UInteger]
- val viewCountColumn: TableField[R, UInteger]
+ val idColumn: TableField[R, Integer]
+ val viewCountColumn: TableField[R, Integer]
}
object ViewCountTable {
case object WorkflowViewCountTable extends ViewCountTable {
override type R = WorkflowViewCountRecord
override val table: Table[WorkflowViewCountRecord] = WORKFLOW_VIEW_COUNT
- override val idColumn: TableField[WorkflowViewCountRecord, UInteger] = WORKFLOW_VIEW_COUNT.WID
- override val viewCountColumn: TableField[WorkflowViewCountRecord, UInteger] =
+ override val idColumn: TableField[WorkflowViewCountRecord, Integer] = WORKFLOW_VIEW_COUNT.WID
+ override val viewCountColumn: TableField[WorkflowViewCountRecord, Integer] =
WORKFLOW_VIEW_COUNT.VIEW_COUNT
}
case object DatasetViewCountTable extends ViewCountTable {
override type R = DatasetViewCountRecord
override val table: Table[DatasetViewCountRecord] = DATASET_VIEW_COUNT
- override val idColumn: TableField[DatasetViewCountRecord, UInteger] = DATASET_VIEW_COUNT.DID
- override val viewCountColumn: TableField[DatasetViewCountRecord, UInteger] =
+ override val idColumn: TableField[DatasetViewCountRecord, Integer] = DATASET_VIEW_COUNT.DID
+ override val viewCountColumn: TableField[DatasetViewCountRecord, Integer] =
DATASET_VIEW_COUNT.VIEW_COUNT
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/HubResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/HubResource.scala
index d26374fe4e3..c6f3200de12 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/HubResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/hub/HubResource.scala
@@ -1,6 +1,5 @@
package edu.uci.ics.texera.web.resource.dashboard.hub
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.dao.jooq.generated.Tables._
import HubResource.{
@@ -19,7 +18,6 @@ import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.
mapWorkflowEntries
}
import org.jooq.impl.DSL
-import org.jooq.types.UInteger
import java.util
import java.util.regex.Pattern
@@ -36,7 +34,7 @@ import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetResource.{
}
object HubResource {
- case class userRequest(entityId: UInteger, userId: UInteger, entityType: String)
+ case class userRequest(entityId: Integer, userId: Integer, entityType: String)
/**
* Defines the currently accepted resource types.
@@ -47,7 +45,7 @@ object HubResource {
}
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private val ipv4Pattern: Pattern = Pattern.compile(
@@ -76,7 +74,7 @@ object HubResource {
* @param entityType The type of entity being checked (must be validated).
* @return `true` if the user has liked the entity, otherwise `false`.
*/
- def isLikedHelper(userId: UInteger, workflowId: UInteger, entityType: String): Boolean = {
+ def isLikedHelper(userId: Integer, workflowId: Integer, entityType: String): Boolean = {
validateEntityType(entityType)
val entityTables = LikeTable(entityType)
val (table, uidColumn, idColumn) =
@@ -103,8 +101,8 @@ object HubResource {
*/
def recordUserActivity(
request: HttpServletRequest,
- userId: UInteger = UInteger.valueOf(0),
- entityId: UInteger,
+ userId: Integer = Integer.valueOf(0),
+ entityId: Integer,
entityType: String,
action: String
): Unit = {
@@ -180,8 +178,8 @@ object HubResource {
*/
def recordCloneActivity(
request: HttpServletRequest,
- userId: UInteger,
- entityId: UInteger,
+ userId: Integer,
+ entityId: Integer,
entityType: String
): Unit = {
@@ -216,7 +214,7 @@ object HubResource {
* @return The number of times the entity has been liked or cloned.
*/
def getUserLCCount(
- entityId: UInteger,
+ entityId: Integer,
entityType: String,
actionType: String
): Int = {
@@ -237,7 +235,7 @@ object HubResource {
.fetchOne(0, classOf[Int])
}
- def fetchDashboardWorkflowsByWids(wids: Seq[UInteger], uid: UInteger): List[DashboardWorkflow] = {
+ def fetchDashboardWorkflowsByWids(wids: Seq[Integer], uid: Integer): List[DashboardWorkflow] = {
if (wids.isEmpty) {
return List.empty[DashboardWorkflow]
}
@@ -250,7 +248,7 @@ object HubResource {
mapWorkflowEntries(records, uid)
}
- def fetchDashboardDatasetsByDids(dids: Seq[UInteger], uid: UInteger): List[DashboardDataset] = {
+ def fetchDashboardDatasetsByDids(dids: Seq[Integer], uid: Integer): List[DashboardDataset] = {
if (dids.isEmpty) {
return List.empty[DashboardDataset]
}
@@ -269,7 +267,7 @@ object HubResource {
@Path("/hub")
class HubResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
@GET
@@ -283,7 +281,7 @@ class HubResource {
context
.selectCount()
.from(table)
- .where(isPublicColumn.eq(1.toByte))
+ .where(isPublicColumn.eq(true))
.fetchOne(0, classOf[Integer])
}
@@ -291,8 +289,8 @@ class HubResource {
@Path("/isLiked")
@Produces(Array(MediaType.APPLICATION_JSON))
def isLiked(
- @QueryParam("workflowId") workflowId: UInteger,
- @QueryParam("userId") userId: UInteger,
+ @QueryParam("workflowId") workflowId: Integer,
+ @QueryParam("userId") userId: Integer,
@QueryParam("entityType") entityType: String
): Boolean = {
isLikedHelper(userId, workflowId, entityType)
@@ -322,7 +320,7 @@ class HubResource {
@Path("/likeCount")
@Produces(Array(MediaType.APPLICATION_JSON))
def getLikeCount(
- @QueryParam("entityId") entityId: UInteger,
+ @QueryParam("entityId") entityId: Integer,
@QueryParam("entityType") entityType: String
): Int = {
getUserLCCount(entityId, entityType, "like")
@@ -332,7 +330,7 @@ class HubResource {
@Path("/cloneCount")
@Produces(Array(MediaType.APPLICATION_JSON))
def getCloneCount(
- @QueryParam("entityId") entityId: UInteger,
+ @QueryParam("entityId") entityId: Integer,
@QueryParam("entityType") entityType: String
): Int = {
getUserLCCount(entityId, entityType, "clone")
@@ -357,7 +355,7 @@ class HubResource {
context
.insertInto(table)
.set(idColumn, entityID)
- .set(viewCountColumn, UInteger.valueOf(1))
+ .set(viewCountColumn, Integer.valueOf(1))
.onDuplicateKeyUpdate()
.set(viewCountColumn, viewCountColumn.add(1))
.execute()
@@ -375,7 +373,7 @@ class HubResource {
@Path("/viewCount")
@Produces(Array(MediaType.APPLICATION_JSON))
def getViewCount(
- @QueryParam("entityId") entityId: UInteger,
+ @QueryParam("entityId") entityId: Integer,
@QueryParam("entityType") entityType: String
): Int = {
@@ -387,7 +385,7 @@ class HubResource {
context
.insertInto(table)
.set(idColumn, entityId)
- .set(viewCountColumn, UInteger.valueOf(0))
+ .set(viewCountColumn, Integer.valueOf(0))
.onDuplicateKeyIgnore()
.execute()
@@ -423,15 +421,15 @@ class HubResource {
.from(table)
.join(baseTable.table)
.on(idColumn.eq(baseIdColumn))
- .where(isPublicColumn.eq(1.toByte))
+ .where(isPublicColumn.eq(true))
.groupBy(idColumn)
.orderBy(DSL.count(idColumn).desc())
.limit(8)
- .fetchInto(classOf[UInteger])
+ .fetchInto(classOf[Integer])
.asScala
.toSeq
- val currentUid: UInteger = if (uid == null || uid == -1) null else UInteger.valueOf(uid)
+ val currentUid: Integer = if (uid == null || uid == -1) null else Integer.valueOf(uid)
val clickableFileEntries =
if (entityType == "workflow") {
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetAccessResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetAccessResource.scala
index e208e31d654..099bc002727 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetAccessResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetAccessResource.scala
@@ -1,11 +1,10 @@
package edu.uci.ics.texera.web.resource.dashboard.user.dataset
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.engine.common.Utils.withTransaction
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.model.common.AccessEntry
import edu.uci.ics.texera.dao.jooq.generated.Tables.USER
-import edu.uci.ics.texera.dao.jooq.generated.enums.DatasetUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserAccess.DATASET_USER_ACCESS
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{DatasetDao, DatasetUserAccessDao, UserDao}
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{DatasetUserAccess, User}
@@ -14,7 +13,6 @@ import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetAccessResou
getOwner
}
import org.jooq.DSLContext
-import org.jooq.types.UInteger
import java.util
import javax.annotation.security.RolesAllowed
@@ -23,39 +21,39 @@ import javax.ws.rs.core.{MediaType, Response}
object DatasetAccessResource {
private lazy val context: DSLContext = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
- def isDatasetPublic(ctx: DSLContext, did: UInteger): Boolean = {
+ def isDatasetPublic(ctx: DSLContext, did: Integer): Boolean = {
val datasetDao = new DatasetDao(ctx.configuration())
Option(datasetDao.fetchOneByDid(did))
.flatMap(dataset => Option(dataset.getIsPublic))
- .contains(1.toByte)
+ .contains(true)
}
- def userHasReadAccess(ctx: DSLContext, did: UInteger, uid: UInteger): Boolean = {
+ def userHasReadAccess(ctx: DSLContext, did: Integer, uid: Integer): Boolean = {
isDatasetPublic(ctx, did) ||
userHasWriteAccess(ctx, did, uid) ||
- getDatasetUserAccessPrivilege(ctx, did, uid) == DatasetUserAccessPrivilege.READ
+ getDatasetUserAccessPrivilege(ctx, did, uid) == PrivilegeEnum.READ
}
- def userOwnDataset(ctx: DSLContext, did: UInteger, uid: UInteger): Boolean = {
+ def userOwnDataset(ctx: DSLContext, did: Integer, uid: Integer): Boolean = {
val datasetDao = new DatasetDao(ctx.configuration())
Option(datasetDao.fetchOneByDid(did))
.exists(_.getOwnerUid == uid)
}
- def userHasWriteAccess(ctx: DSLContext, did: UInteger, uid: UInteger): Boolean = {
+ def userHasWriteAccess(ctx: DSLContext, did: Integer, uid: Integer): Boolean = {
userOwnDataset(ctx, did, uid) ||
- getDatasetUserAccessPrivilege(ctx, did, uid) == DatasetUserAccessPrivilege.WRITE
+ getDatasetUserAccessPrivilege(ctx, did, uid) == PrivilegeEnum.WRITE
}
def getDatasetUserAccessPrivilege(
ctx: DSLContext,
- did: UInteger,
- uid: UInteger
- ): DatasetUserAccessPrivilege = {
+ did: Integer,
+ uid: Integer
+ ): PrivilegeEnum = {
Option(
ctx
.select(DATASET_USER_ACCESS.PRIVILEGE)
@@ -65,11 +63,11 @@ object DatasetAccessResource {
.eq(did)
.and(DATASET_USER_ACCESS.UID.eq(uid))
)
- .fetchOneInto(classOf[DatasetUserAccessPrivilege])
- ).getOrElse(DatasetUserAccessPrivilege.NONE)
+ .fetchOneInto(classOf[PrivilegeEnum])
+ ).getOrElse(PrivilegeEnum.NONE)
}
- def getOwner(ctx: DSLContext, did: UInteger): User = {
+ def getOwner(ctx: DSLContext, did: Integer): User = {
val datasetDao = new DatasetDao(ctx.configuration())
val userDao = new UserDao(ctx.configuration())
@@ -93,7 +91,7 @@ class DatasetAccessResource {
*/
@GET
@Path("/owner/{did}")
- def getOwnerEmailOfDataset(@PathParam("did") did: UInteger): String = {
+ def getOwnerEmailOfDataset(@PathParam("did") did: Integer): String = {
var email = ""
withTransaction(context) { ctx =>
val owner = getOwner(ctx, did)
@@ -113,7 +111,7 @@ class DatasetAccessResource {
@GET
@Path("/list/{did}")
def getAccessList(
- @PathParam("did") did: UInteger
+ @PathParam("did") did: Integer
): util.List[AccessEntry] = {
withTransaction(context) { ctx =>
val datasetDao = new DatasetDao(ctx.configuration())
@@ -146,7 +144,7 @@ class DatasetAccessResource {
@PUT
@Path("/grant/{did}/{email}/{privilege}")
def grantAccess(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@PathParam("email") email: String,
@PathParam("privilege") privilege: String
): Response = {
@@ -157,7 +155,7 @@ class DatasetAccessResource {
new DatasetUserAccess(
did,
userDao.fetchOneByEmail(email).getUid,
- DatasetUserAccessPrivilege.valueOf(privilege)
+ PrivilegeEnum.valueOf(privilege)
)
)
Response.ok().build()
@@ -174,7 +172,7 @@ class DatasetAccessResource {
@DELETE
@Path("/revoke/{did}/{email}")
def revokeAccess(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@PathParam("email") email: String
): Response = {
withTransaction(context) { ctx =>
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetResource.scala
index ac9165ec546..27bbedc2247 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/DatasetResource.scala
@@ -1,6 +1,6 @@
package edu.uci.ics.texera.web.resource.dashboard.user.dataset
-import edu.uci.ics.amber.core.storage.{DocumentFactory, FileResolver, StorageConfig}
+import edu.uci.ics.amber.core.storage.{DocumentFactory, FileResolver}
import edu.uci.ics.amber.core.storage.util.dataset.{
GitVersionControlLocalFileStorage,
PhysicalFileNode
@@ -9,7 +9,7 @@ import edu.uci.ics.amber.engine.common.Utils.withTransaction
import edu.uci.ics.amber.util.PathUtils
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.SessionUser
-import edu.uci.ics.texera.dao.jooq.generated.enums.DatasetUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.Dataset.DATASET
import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserAccess.DATASET_USER_ACCESS
import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetVersion.DATASET_VERSION
@@ -31,7 +31,7 @@ import edu.uci.ics.texera.web.resource.dashboard.user.dataset.`type`.DatasetFile
import io.dropwizard.auth.Auth
import org.apache.commons.lang3.StringUtils
import org.glassfish.jersey.media.multipart.{FormDataMultiPart, FormDataParam}
-import org.jooq.types.UInteger
+
import org.jooq.{DSLContext, EnumType, Record, Result, SelectJoinStep}
import play.api.libs.json.Json
@@ -53,16 +53,16 @@ import scala.util.control.NonFatal
import scala.util.{Failure, Success, Try, Using}
object DatasetResource {
- private val DATASET_IS_PUBLIC: Byte = 1
- private val DATASET_IS_PRIVATE: Byte = 0
+ private val DATASET_IS_PUBLIC: Boolean = true
+ private val DATASET_IS_PRIVATE: Boolean = false
private val FILE_OPERATION_UPLOAD_PREFIX = "file:upload:"
private val FILE_OPERATION_REMOVE_PREFIX = "file:remove"
- private val datasetLocks: scala.collection.concurrent.Map[UInteger, ReentrantLock] =
- new scala.collection.concurrent.TrieMap[UInteger, ReentrantLock]()
+ private val datasetLocks: scala.collection.concurrent.Map[Integer, ReentrantLock] =
+ new scala.collection.concurrent.TrieMap[Integer, ReentrantLock]()
private val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
/**
@@ -71,7 +71,7 @@ object DatasetResource {
* @param versionHash the hash of the version. If None, fetch the latest version
* @return
*/
- def calculateDatasetVersionSize(did: UInteger, versionHash: Option[String] = None): Long = {
+ def calculateDatasetVersionSize(did: Integer, versionHash: Option[String] = None): Long = {
/**
* Internal util to calculate the size from the physical nodes
@@ -112,7 +112,7 @@ object DatasetResource {
/**
* Helper function to get the dataset from DB using did
*/
- private def getDatasetByID(ctx: DSLContext, did: UInteger): Dataset = {
+ private def getDatasetByID(ctx: DSLContext, did: Integer): Dataset = {
val datasetDao = new DatasetDao(ctx.configuration())
val dataset = datasetDao.fetchOneByDid(did)
if (dataset == null) {
@@ -126,7 +126,7 @@ object DatasetResource {
*/
private def getDatasetVersionByID(
ctx: DSLContext,
- dvid: UInteger
+ dvid: Integer
): DatasetVersion = {
val datasetVersionDao = new DatasetVersionDao(ctx.configuration())
val version = datasetVersionDao.fetchOneByDvid(dvid)
@@ -141,7 +141,7 @@ object DatasetResource {
*/
private def getLatestDatasetVersion(
ctx: DSLContext,
- did: UInteger
+ did: Integer
): Option[DatasetVersion] = {
ctx
.selectFrom(DATASET_VERSION)
@@ -159,7 +159,7 @@ object DatasetResource {
)
private def parseUserUploadedFormToDatasetOperations(
- did: UInteger,
+ did: Integer,
multiPart: FormDataMultiPart
): DatasetOperation = {
val datasetPath = PathUtils.getDatasetPath(did) // Obtain dataset base path
@@ -208,7 +208,7 @@ object DatasetResource {
* @return the created dataset version
*/
def createNewDatasetVersionByAddingFiles(
- did: UInteger,
+ did: Integer,
user: User,
filesToAdd: Map[java.nio.file.Path, InputStream]
): Option[DashboardDatasetVersion] = {
@@ -227,8 +227,8 @@ object DatasetResource {
// concurrency control is performed here: the thread has to have the lock in order to create the new version
private def applyDatasetOperationToCreateNewVersion(
ctx: DSLContext,
- did: UInteger,
- uid: UInteger,
+ did: Integer,
+ uid: Integer,
ownerEmail: String,
userProvidedVersionName: String,
datasetOperation: DatasetOperation
@@ -237,7 +237,7 @@ object DatasetResource {
// the format of dataset version name is: v{#n} - {user provided dataset version name}. e.g. v10 - new version
def generateDatasetVersionName(
ctx: DSLContext,
- did: UInteger,
+ did: Integer,
userProvidedVersionName: String
): String = {
val numberOfExistingVersions = ctx
@@ -332,11 +332,11 @@ object DatasetResource {
fileNodes: List[DatasetFileNode]
)
- case class DatasetIDs(dids: List[UInteger])
+ case class DatasetIDs(dids: List[Integer])
- case class DatasetNameModification(did: UInteger, name: String)
+ case class DatasetNameModification(did: Integer, name: String)
- case class DatasetDescriptionModification(did: UInteger, description: String)
+ case class DatasetDescriptionModification(did: Integer, description: String)
case class DatasetVersionRootFileNodesResponse(
fileNodes: List[DatasetFileNode],
@@ -355,7 +355,7 @@ object DatasetResource {
)
}
- def mapDashboardDataset(records: Result[Record], uid: UInteger): List[DashboardDataset] = {
+ def mapDashboardDataset(records: Result[Record], uid: Integer): List[DashboardDataset] = {
records.asScala.map { record =>
val dataset = record.into(DATASET).into(classOf[Dataset])
val datasetAccess = record.into(DATASET_USER_ACCESS).into(classOf[DatasetUserAccess])
@@ -385,8 +385,8 @@ class DatasetResource {
*/
private def getDashboardDataset(
ctx: DSLContext,
- did: UInteger,
- uid: Option[UInteger],
+ did: Integer,
+ uid: Option[Integer],
isPublic: Boolean = false
): DashboardDataset = {
if (
@@ -398,7 +398,7 @@ class DatasetResource {
val targetDataset = getDatasetByID(ctx, did)
val userAccessPrivilege =
- if (isPublic) DatasetUserAccessPrivilege.NONE
+ if (isPublic) PrivilegeEnum.NONE
else getDatasetUserAccessPrivilege(ctx, did, uid.get)
val isOwner = !isPublic && (targetDataset.getOwnerUid == uid.get)
@@ -417,8 +417,8 @@ class DatasetResource {
*/
private def createNewDatasetVersionFromFormData(
ctx: DSLContext,
- did: UInteger,
- uid: UInteger,
+ did: Integer,
+ uid: Integer,
ownerEmail: String,
userProvidedVersionName: String,
multiPart: FormDataMultiPart
@@ -461,7 +461,7 @@ class DatasetResource {
val dataset: Dataset = new Dataset()
dataset.setName(datasetName)
dataset.setDescription(datasetDescription)
- dataset.setIsPublic(isDatasetPublic.toByte)
+ dataset.setIsPublic(isDatasetPublic.toByte == 1)
dataset.setOwnerUid(uid)
val createdDataset = ctx
@@ -476,7 +476,7 @@ class DatasetResource {
val datasetUserAccess = new DatasetUserAccess()
datasetUserAccess.setDid(createdDataset.getDid)
datasetUserAccess.setUid(uid)
- datasetUserAccess.setPrivilege(DatasetUserAccessPrivilege.WRITE)
+ datasetUserAccess.setPrivilege(PrivilegeEnum.WRITE)
datasetOfUserDao.insert(datasetUserAccess)
// initialize the dataset directory
@@ -503,7 +503,7 @@ class DatasetResource {
createdDataset.getCreationTime
),
user.getEmail,
- DatasetUserAccessPrivilege.WRITE,
+ PrivilegeEnum.WRITE,
isOwner = true,
versions = List(),
size = calculateDatasetVersionSize(did)
@@ -589,7 +589,7 @@ class DatasetResource {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/{did}/update/publicity")
def toggleDatasetPublicity(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@Auth sessionUser: SessionUser
): Response = {
withTransaction(context) { ctx =>
@@ -617,7 +617,7 @@ class DatasetResource {
@Path("/{did}/version/create")
@Consumes(Array(MediaType.MULTIPART_FORM_DATA))
def createDatasetVersion(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@FormDataParam("versionName") versionName: String,
@Auth user: SessionUser,
multiPart: FormDataMultiPart
@@ -679,7 +679,7 @@ class DatasetResource {
DashboardDataset(
isOwner = false,
dataset = dataset,
- accessPrivilege = DatasetUserAccessPrivilege.READ,
+ accessPrivilege = PrivilegeEnum.READ,
versions = List(),
ownerEmail = ownerEmail,
size = calculateDatasetVersionSize(dataset.getDid)
@@ -691,7 +691,7 @@ class DatasetResource {
isOwner = false,
dataset = publicDataset.dataset,
ownerEmail = publicDataset.ownerEmail,
- accessPrivilege = DatasetUserAccessPrivilege.READ,
+ accessPrivilege = PrivilegeEnum.READ,
versions = List(),
size = calculateDatasetVersionSize(publicDataset.dataset.getDid)
)
@@ -707,7 +707,7 @@ class DatasetResource {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/{did}/version/list")
def getDatasetVersionList(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@Auth user: SessionUser
): List[DatasetVersion] = {
val uid = user.getUid
@@ -722,7 +722,7 @@ class DatasetResource {
@GET
@Path("/{did}/publicVersion/list")
def getPublicDatasetVersionList(
- @PathParam("did") did: UInteger
+ @PathParam("did") did: Integer
): List[DatasetVersion] = {
withTransaction(context)(ctx => {
if (!isDatasetPublic(ctx, did)) {
@@ -736,7 +736,7 @@ class DatasetResource {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/{did}/version/latest")
def retrieveLatestDatasetVersion(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@Auth user: SessionUser
): DashboardDatasetVersion = {
val uid = user.getUid
@@ -784,8 +784,8 @@ class DatasetResource {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/{did}/version/{dvid}/rootFileNodes")
def retrieveDatasetVersionRootFileNodes(
- @PathParam("did") did: UInteger,
- @PathParam("dvid") dvid: UInteger,
+ @PathParam("did") did: Integer,
+ @PathParam("dvid") dvid: Integer,
@Auth user: SessionUser
): DatasetVersionRootFileNodesResponse = {
val uid = user.getUid
@@ -797,8 +797,8 @@ class DatasetResource {
@GET
@Path("/{did}/publicVersion/{dvid}/rootFileNodes")
def retrievePublicDatasetVersionRootFileNodes(
- @PathParam("did") did: UInteger,
- @PathParam("dvid") dvid: UInteger
+ @PathParam("did") did: Integer,
+ @PathParam("dvid") dvid: Integer
): DatasetVersionRootFileNodesResponse = {
withTransaction(context)(ctx =>
fetchDatasetVersionRootFileNodes(ctx, did, dvid, None, isPublic = true)
@@ -809,7 +809,7 @@ class DatasetResource {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/{did}")
def getDataset(
- @PathParam("did") did: UInteger,
+ @PathParam("did") did: Integer,
@Auth user: SessionUser
): DashboardDataset = {
val uid = user.getUid
@@ -819,7 +819,7 @@ class DatasetResource {
@GET
@Path("/public/{did}")
def getPublicDataset(
- @PathParam("did") did: UInteger
+ @PathParam("did") did: Integer
): DashboardDataset = {
withTransaction(context)(ctx => fetchDataset(ctx, did, None, isPublic = true))
}
@@ -882,7 +882,7 @@ class DatasetResource {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/version-zip")
def retrieveDatasetVersionZip(
- @QueryParam("did") did: UInteger,
+ @QueryParam("did") did: Integer,
@QueryParam("dvid") dvid: Optional[Integer],
@Auth user: SessionUser
): Response = {
@@ -895,7 +895,7 @@ class DatasetResource {
throw new NotFoundException(ERR_DATASET_VERSION_NOT_FOUND_MESSAGE)
)
} else {
- getDatasetVersionByID(context, UInteger.valueOf(dvid.get))
+ getDatasetVersionByID(context, Integer.valueOf(dvid.get))
}
val targetDatasetPath = PathUtils.getDatasetPath(dataset.getDid)
val fileNodes = GitVersionControlLocalFileStorage.retrieveRootFileNodesOfVersion(
@@ -956,8 +956,8 @@ class DatasetResource {
@GET
@Path("/datasetUserAccess")
def datasetUserAccess(
- @QueryParam("did") did: UInteger
- ): java.util.List[UInteger] = {
+ @QueryParam("did") did: Integer
+ ): java.util.List[Integer] = {
val records = context
.select(DATASET_USER_ACCESS.UID)
.from(DATASET_USER_ACCESS)
@@ -967,7 +967,7 @@ class DatasetResource {
records.getValues(DATASET_USER_ACCESS.UID)
}
- private def fetchDatasetVersions(ctx: DSLContext, did: UInteger): List[DatasetVersion] = {
+ private def fetchDatasetVersions(ctx: DSLContext, did: Integer): List[DatasetVersion] = {
ctx
.selectFrom(DATASET_VERSION)
.where(DATASET_VERSION.DID.eq(did))
@@ -979,9 +979,9 @@ class DatasetResource {
private def fetchDatasetVersionRootFileNodes(
ctx: DSLContext,
- did: UInteger,
- dvid: UInteger,
- uid: Option[UInteger],
+ did: Integer,
+ dvid: Integer,
+ uid: Option[Integer],
isPublic: Boolean
): DatasetVersionRootFileNodesResponse = {
val dataset = getDashboardDataset(ctx, did, uid, isPublic)
@@ -1017,8 +1017,8 @@ class DatasetResource {
private def fetchDataset(
ctx: DSLContext,
- did: UInteger,
- uid: Option[UInteger],
+ did: Integer,
+ uid: Option[Integer],
isPublic: Boolean
): DashboardDataset = {
val dashboardDataset = getDashboardDataset(ctx, did, uid, isPublic)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/utils/DatasetStatisticsUtils.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/utils/DatasetStatisticsUtils.scala
index 3f1c17a39d2..77a745c1423 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/utils/DatasetStatisticsUtils.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/dataset/utils/DatasetStatisticsUtils.scala
@@ -1,21 +1,19 @@
package edu.uci.ics.texera.web.resource.dashboard.user.dataset.utils
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.dao.jooq.generated.tables.Dataset.DATASET
import edu.uci.ics.texera.web.resource.dashboard.user.dataset.DatasetResource
import edu.uci.ics.texera.web.resource.dashboard.user.quota.UserQuotaResource.DatasetQuota
-import org.jooq.types.UInteger
import scala.jdk.CollectionConverters._
object DatasetStatisticsUtils {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
// this function retrieves the total counts of dataset that belongs to the user
- def getUserCreatedDatasetCount(uid: UInteger): Int = {
+ def getUserCreatedDatasetCount(uid: Integer): Int = {
val count = context
.selectCount()
.from(DATASET)
@@ -26,7 +24,7 @@ object DatasetStatisticsUtils {
}
// this function would return a list of dataset ids that belongs to the user
- private def getUserCreatedDatasetList(uid: UInteger): List[DatasetQuota] = {
+ private def getUserCreatedDatasetList(uid: Integer): List[DatasetQuota] = {
val result = context
.select(
DATASET.DID,
@@ -42,14 +40,14 @@ object DatasetStatisticsUtils {
DatasetQuota(
did = record.getValue(DATASET.DID),
name = record.getValue(DATASET.NAME),
- creationTime = record.getValue(DATASET.CREATION_TIME).getTime(),
+ creationTime = record.getValue(DATASET.CREATION_TIME).getTime,
size = 0
)
)
.toList
}
- def getUserCreatedDatasets(uid: UInteger): List[DatasetQuota] = {
+ def getUserCreatedDatasets(uid: Integer): List[DatasetQuota] = {
val datasetList = getUserCreatedDatasetList(uid)
datasetList.map { dataset =>
val size = DatasetResource.calculateDatasetVersionSize(dataset.did)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectAccessResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectAccessResource.scala
index 59e6b5b7d38..d124343074d 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectAccessResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectAccessResource.scala
@@ -1,14 +1,12 @@
package edu.uci.ics.texera.web.resource.dashboard.user.project
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.model.common.AccessEntry
import edu.uci.ics.texera.dao.jooq.generated.Tables.{PROJECT_USER_ACCESS, USER}
-import edu.uci.ics.texera.dao.jooq.generated.enums.ProjectUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{ProjectDao, ProjectUserAccessDao, UserDao}
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.ProjectUserAccess
import org.jooq.DSLContext
-import org.jooq.types.UInteger
import java.util
import javax.annotation.security.RolesAllowed
@@ -20,7 +18,7 @@ import javax.ws.rs.core.MediaType
@Path("/access/project")
class ProjectAccessResource() {
final private val context: DSLContext = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private val userDao = new UserDao(context.configuration())
final private val projectDao = new ProjectDao(context.configuration)
@@ -34,7 +32,7 @@ class ProjectAccessResource() {
*/
@GET
@Path("/owner/{pid}")
- def getOwner(@PathParam("pid") pid: UInteger): String = {
+ def getOwner(@PathParam("pid") pid: Integer): String = {
userDao.fetchOneByUid(projectDao.fetchOneByPid(pid).getOwnerId).getEmail
}
@@ -47,7 +45,7 @@ class ProjectAccessResource() {
@GET
@Path("/list/{pid}")
def getAccessList(
- @PathParam("pid") pid: UInteger
+ @PathParam("pid") pid: Integer
): util.List[AccessEntry] = {
context
.select(
@@ -77,7 +75,7 @@ class ProjectAccessResource() {
@PUT
@Path("/grant/{pid}/{email}/{privilege}")
def grantAccess(
- @PathParam("pid") pid: UInteger,
+ @PathParam("pid") pid: Integer,
@PathParam("email") email: String,
@PathParam("privilege") privilege: String
): Unit = {
@@ -85,7 +83,7 @@ class ProjectAccessResource() {
new ProjectUserAccess(
userDao.fetchOneByEmail(email).getUid,
pid,
- ProjectUserAccessPrivilege.valueOf(privilege)
+ PrivilegeEnum.valueOf(privilege)
)
)
}
@@ -100,7 +98,7 @@ class ProjectAccessResource() {
@DELETE
@Path("/revoke/{pid}/{email}")
def revokeAccess(
- @PathParam("pid") pid: UInteger,
+ @PathParam("pid") pid: Integer,
@PathParam("email") email: String
): Unit = {
context
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectResource.scala
index 9963721cd57..83f4b5cb5ca 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/ProjectResource.scala
@@ -1,10 +1,9 @@
package edu.uci.ics.texera.web.resource.dashboard.user.project
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.dao.jooq.generated.Tables._
-import edu.uci.ics.texera.dao.jooq.generated.enums.ProjectUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{
ProjectDao,
ProjectUserAccessDao,
@@ -18,7 +17,6 @@ import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowAccessRes
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.DashboardWorkflow
import io.dropwizard.auth.Auth
import org.apache.commons.lang3.StringUtils
-import org.jooq.types.UInteger
import java.sql.Timestamp
import java.util
@@ -36,7 +34,7 @@ import scala.jdk.CollectionConverters.IterableHasAsScala
object ProjectResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private lazy val userProjectDao = new ProjectDao(context.configuration)
final private lazy val workflowOfProjectDao = new WorkflowOfProjectDao(context.configuration)
@@ -53,7 +51,7 @@ object ProjectResource {
* @param fileName name of exported file
* @return String containing status of adding exported file to project(s)
*/
- def addExportedFileToProject(uid: UInteger, wid: UInteger, fileName: String): String = {
+ def addExportedFileToProject(uid: Integer, wid: Integer, fileName: String): String = {
// get map of PIDs and project names
val pidMap = context
.select(WORKFLOW_OF_PROJECT.PID, PROJECT.NAME)
@@ -76,7 +74,7 @@ object ProjectResource {
}
}
- private def workflowOfProjectExists(wid: UInteger, pid: UInteger): Boolean = {
+ private def workflowOfProjectExists(wid: Integer, pid: Integer): Boolean = {
workflowOfProjectDao.existsById(
context
.newRecord(WORKFLOW_OF_PROJECT.WID, WORKFLOW_OF_PROJECT.PID)
@@ -85,10 +83,10 @@ object ProjectResource {
}
case class DashboardProject(
- pid: UInteger,
+ pid: Integer,
name: String,
description: String,
- ownerID: UInteger,
+ ownerID: Integer,
creationTime: Timestamp,
color: String,
accessLevel: String
@@ -108,7 +106,7 @@ class ProjectResource {
*/
@GET
@Path("/{pid}")
- def getProject(@PathParam("pid") pid: UInteger): Project = {
+ def getProject(@PathParam("pid") pid: Integer): Project = {
userProjectDao.fetchOneByPid(pid)
}
@@ -135,7 +133,6 @@ class ProjectResource {
.join(PROJECT)
.on(PROJECT_USER_ACCESS.PID.eq(PROJECT.PID))
.where(PROJECT.OWNER_ID.eq(user.getUid).or(PROJECT_USER_ACCESS.UID.eq(user.getUid)))
- .groupBy(PROJECT.PID)
.fetchInto(classOf[DashboardProject])
}
@@ -150,7 +147,7 @@ class ProjectResource {
@GET
@Path("/{pid}/workflows")
def listProjectWorkflows(
- @PathParam("pid") pid: UInteger,
+ @PathParam("pid") pid: Integer,
@Auth user: SessionUser
): List[DashboardWorkflow] = {
val result = DashboardResource.searchAllResources(
@@ -177,7 +174,7 @@ class ProjectResource {
try {
userProjectDao.insert(project)
projectUserAccessDao.merge(
- new ProjectUserAccess(user.getUid, project.getPid, ProjectUserAccessPrivilege.WRITE)
+ new ProjectUserAccess(user.getUid, project.getPid, PrivilegeEnum.WRITE)
)
} catch {
case _: Throwable =>
@@ -195,8 +192,8 @@ class ProjectResource {
@POST
@Path("/{pid}/workflow/{wid}/add")
def addWorkflowToProject(
- @PathParam("pid") pid: UInteger,
- @PathParam("wid") wid: UInteger,
+ @PathParam("pid") pid: Integer,
+ @PathParam("wid") wid: Integer,
@Auth user: SessionUser
): Unit = {
if (!hasReadAccess(wid, user.getUid)) {
@@ -217,7 +214,7 @@ class ProjectResource {
@POST
@Path("/{pid}/rename/{name}")
def updateProjectName(
- @PathParam("pid") pid: UInteger,
+ @PathParam("pid") pid: Integer,
@PathParam("name") name: String
): Unit = {
val userProject: Project = userProjectDao.fetchOneByPid(pid)
@@ -242,7 +239,7 @@ class ProjectResource {
@Path("/{pid}/update/description")
@Consumes(Array(MediaType.TEXT_PLAIN))
def updateProjectDescription(
- @PathParam("pid") pid: UInteger,
+ @PathParam("pid") pid: Integer,
description: String
): Unit = {
val userProject: Project = userProjectDao.fetchOneByPid(pid)
@@ -264,7 +261,7 @@ class ProjectResource {
@POST
@Path("/{pid}/color/{colorHex}/add")
def updateProjectColor(
- @PathParam("pid") pid: UInteger,
+ @PathParam("pid") pid: Integer,
@PathParam("colorHex") colorHex: String,
@Auth sessionUser: SessionUser
): Unit = {
@@ -283,7 +280,7 @@ class ProjectResource {
@POST
@Path("/{pid}/color/delete")
- def deleteProjectColor(@PathParam("pid") pid: UInteger): Unit = {
+ def deleteProjectColor(@PathParam("pid") pid: Integer): Unit = {
val userProject: Project = userProjectDao.fetchOneByPid(pid)
userProject.setColor(null)
userProjectDao.update(userProject)
@@ -296,7 +293,7 @@ class ProjectResource {
*/
@DELETE
@Path("/delete/{pid}")
- def deleteProject(@PathParam("pid") pid: UInteger): Unit = {
+ def deleteProject(@PathParam("pid") pid: Integer): Unit = {
userProjectDao.deleteById(pid)
}
@@ -310,8 +307,8 @@ class ProjectResource {
@DELETE
@Path("/{pid}/workflow/{wid}/delete")
def deleteWorkflowFromProject(
- @PathParam("pid") pid: UInteger,
- @PathParam("wid") wid: UInteger
+ @PathParam("pid") pid: Integer,
+ @PathParam("wid") wid: Integer
): Unit = {
workflowOfProjectDao.deleteById(
context.newRecord(WORKFLOW_OF_PROJECT.WID, WORKFLOW_OF_PROJECT.PID).values(wid, pid)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/PublicProjectResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/PublicProjectResource.scala
index 9e20262d7e4..9ee9773c5bd 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/PublicProjectResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/project/PublicProjectResource.scala
@@ -1,15 +1,13 @@
package edu.uci.ics.texera.web.resource.dashboard.user.project
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.dao.jooq.generated.Tables.{PROJECT, PUBLIC_PROJECT, USER}
-import edu.uci.ics.texera.dao.jooq.generated.enums.ProjectUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{ProjectUserAccessDao, PublicProjectDao}
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{ProjectUserAccess, PublicProject}
import io.dropwizard.auth.Auth
import org.jooq.DSLContext
-import org.jooq.types.UInteger
import java.sql.Timestamp
import java.util
@@ -17,7 +15,7 @@ import javax.annotation.security.RolesAllowed
import javax.ws.rs._
case class DashboardPublicProject(
- pid: UInteger,
+ pid: Integer,
name: String,
owner: String,
creationTime: Timestamp
@@ -27,7 +25,7 @@ case class DashboardPublicProject(
class PublicProjectResource {
final private val context: DSLContext = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private lazy val publicProjectDao = new PublicProjectDao(context.configuration)
final private val projectUserAccessDao = new ProjectUserAccessDao(context.configuration)
@@ -35,7 +33,7 @@ class PublicProjectResource {
@GET
@RolesAllowed(Array("ADMIN"))
@Path("/type/{pid}")
- def getType(@PathParam("pid") pid: UInteger): String = {
+ def getType(@PathParam("pid") pid: Integer): String = {
if (publicProjectDao.fetchOneByPid(pid) == null)
"Private"
else
@@ -45,27 +43,27 @@ class PublicProjectResource {
@PUT
@RolesAllowed(Array("ADMIN"))
@Path("/public/{pid}")
- def makePublic(@PathParam("pid") pid: UInteger, @Auth user: SessionUser): Unit = {
+ def makePublic(@PathParam("pid") pid: Integer, @Auth user: SessionUser): Unit = {
publicProjectDao.insert(new PublicProject(pid, user.getUid))
}
@PUT
@RolesAllowed(Array("ADMIN"))
@Path("/private/{pid}")
- def makePrivate(@PathParam("pid") pid: UInteger): Unit = {
+ def makePrivate(@PathParam("pid") pid: Integer): Unit = {
publicProjectDao.deleteById(pid)
}
@PUT
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/add")
- def addPublicProjects(checkedList: util.List[UInteger], @Auth user: SessionUser): Unit = {
+ def addPublicProjects(checkedList: util.List[Integer], @Auth user: SessionUser): Unit = {
checkedList.forEach(pid => {
projectUserAccessDao.merge(
new ProjectUserAccess(
user.getUid,
pid,
- ProjectUserAccessPrivilege.READ
+ PrivilegeEnum.READ
)
)
})
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/quota/UserQuotaResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/quota/UserQuotaResource.scala
index 4a9f78f44ef..6c801bb51e6 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/quota/UserQuotaResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/quota/UserQuotaResource.scala
@@ -1,6 +1,5 @@
package edu.uci.ics.texera.web.resource.dashboard.user.quota
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.core.storage.util.mongo.MongoDatabaseManager
import edu.uci.ics.amber.core.storage.util.mongo.MongoDatabaseManager.database
import edu.uci.ics.texera.dao.SqlServer
@@ -10,7 +9,6 @@ import edu.uci.ics.texera.web.resource.dashboard.user.dataset.utils.DatasetStati
import edu.uci.ics.texera.web.resource.dashboard.user.quota.UserQuotaResource._
import io.dropwizard.auth.Auth
import org.bson.Document
-import org.jooq.types.UInteger
import java.util
import javax.ws.rs._
@@ -19,19 +17,19 @@ import scala.jdk.CollectionConverters.IterableHasAsScala
object UserQuotaResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
case class Workflow(
- userId: UInteger,
- workflowId: UInteger,
+ userId: Integer,
+ workflowId: Integer,
workflowName: String,
creationTime: Long,
lastModifiedTime: Long
)
case class DatasetQuota(
- did: UInteger,
+ did: Integer,
name: String,
creationTime: Long,
size: Long
@@ -41,7 +39,7 @@ object UserQuotaResource {
workflowName: String,
size: Double,
pointer: String,
- eid: UInteger
+ eid: Integer
)
def getDatabaseSize(collectionNames: Array[MongoStorage]): Array[MongoStorage] = {
@@ -83,7 +81,7 @@ object UserQuotaResource {
name
}
- def getUserCreatedWorkflow(uid: UInteger): List[Workflow] = {
+ def getUserCreatedWorkflow(uid: Integer): List[Workflow] = {
val userWorkflowEntries = context
.select(
WORKFLOW_OF_USER.UID,
@@ -120,7 +118,7 @@ object UserQuotaResource {
.toList
}
- def getUserAccessedWorkflow(uid: UInteger): util.List[UInteger] = {
+ def getUserAccessedWorkflow(uid: Integer): util.List[Integer] = {
val availableWorkflowIds = context
.select(
WORKFLOW_USER_ACCESS.WID
@@ -131,12 +129,12 @@ object UserQuotaResource {
.where(
WORKFLOW_USER_ACCESS.UID.eq(uid)
)
- .fetchInto(classOf[UInteger])
+ .fetchInto(classOf[Integer])
availableWorkflowIds
}
- def getUserMongoDBSize(uid: UInteger): Array[MongoStorage] = {
+ def getUserMongoDBSize(uid: Integer): Array[MongoStorage] = {
val collectionNames = context
.select(
WORKFLOW_EXECUTIONS.RESULT,
@@ -210,7 +208,7 @@ class UserQuotaResource {
@GET
@Path("/access_workflows")
@Produces(Array(MediaType.APPLICATION_JSON))
- def getAccessedWorkflow(@Auth current_user: SessionUser): util.List[UInteger] = {
+ def getAccessedWorkflow(@Auth current_user: SessionUser): util.List[Integer] = {
getUserAccessedWorkflow(current_user.getUid)
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowAccessResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowAccessResource.scala
index 53e9bc76bd2..f668297e965 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowAccessResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowAccessResource.scala
@@ -1,11 +1,10 @@
package edu.uci.ics.texera.web.resource.dashboard.user.workflow
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.web.model.common.AccessEntry
import edu.uci.ics.texera.dao.jooq.generated.Tables._
-import edu.uci.ics.texera.dao.jooq.generated.enums.WorkflowUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{
UserDao,
WorkflowOfUserDao,
@@ -15,7 +14,6 @@ import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.WorkflowUserAccess
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowAccessResource.context
import io.dropwizard.auth.Auth
import org.jooq.DSLContext
-import org.jooq.types.UInteger
import java.util
import javax.annotation.security.RolesAllowed
@@ -24,7 +22,7 @@ import javax.ws.rs.core.MediaType
object WorkflowAccessResource {
final private val context: DSLContext = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
/**
@@ -34,8 +32,8 @@ object WorkflowAccessResource {
* @param uid user id, works with workflow id as primary keys in database
* @return boolean value indicating yes/no
*/
- def hasReadAccess(wid: UInteger, uid: UInteger): Boolean = {
- isPublic(wid) || getPrivilege(wid, uid).eq(WorkflowUserAccessPrivilege.READ) || hasWriteAccess(
+ def hasReadAccess(wid: Integer, uid: Integer): Boolean = {
+ isPublic(wid) || getPrivilege(wid, uid).eq(PrivilegeEnum.READ) || hasWriteAccess(
wid,
uid
)
@@ -48,16 +46,16 @@ object WorkflowAccessResource {
* @param uid user id, works with workflow id as primary keys in database
* @return boolean value indicating yes/no
*/
- def hasWriteAccess(wid: UInteger, uid: UInteger): Boolean = {
- getPrivilege(wid, uid).eq(WorkflowUserAccessPrivilege.WRITE)
+ def hasWriteAccess(wid: Integer, uid: Integer): Boolean = {
+ getPrivilege(wid, uid).eq(PrivilegeEnum.WRITE)
}
/**
* @param wid workflow id
* @param uid user id, works with workflow id as primary keys in database
- * @return WorkflowUserAccessPrivilege value indicating NONE/READ/WRITE
+ * @return PrivilegeEnum value indicating NONE/READ/WRITE
*/
- def getPrivilege(wid: UInteger, uid: UInteger): WorkflowUserAccessPrivilege = {
+ def getPrivilege(wid: Integer, uid: Integer): PrivilegeEnum = {
val access = context
.select()
.from(WORKFLOW_USER_ACCESS)
@@ -72,7 +70,7 @@ object WorkflowAccessResource {
.where(WORKFLOW_OF_PROJECT.WID.eq(wid).and(PROJECT_USER_ACCESS.UID.eq(uid)))
.fetchOneInto(classOf[WorkflowUserAccess])
if (projectAccess == null) {
- WorkflowUserAccessPrivilege.NONE
+ PrivilegeEnum.NONE
} else {
projectAccess.getPrivilege
}
@@ -81,7 +79,7 @@ object WorkflowAccessResource {
}
}
- def isPublic(wid: UInteger): Boolean = {
+ def isPublic(wid: Integer): Boolean = {
context
.select(WORKFLOW.IS_PUBLIC)
.from(WORKFLOW)
@@ -106,7 +104,7 @@ class WorkflowAccessResource() {
*/
@GET
@Path("/owner/{wid}")
- def getOwner(@PathParam("wid") wid: UInteger): String = {
+ def getOwner(@PathParam("wid") wid: Integer): String = {
userDao.fetchOneByUid(workflowOfUserDao.fetchByWid(wid).get(0).getUid).getEmail
}
@@ -119,7 +117,7 @@ class WorkflowAccessResource() {
@GET
@Path("/list/{wid}")
def getAccessList(
- @PathParam("wid") wid: UInteger
+ @PathParam("wid") wid: Integer
): util.List[AccessEntry] = {
context
.select(
@@ -149,7 +147,7 @@ class WorkflowAccessResource() {
@PUT
@Path("/grant/{wid}/{email}/{privilege}")
def grantAccess(
- @PathParam("wid") wid: UInteger,
+ @PathParam("wid") wid: Integer,
@PathParam("email") email: String,
@PathParam("privilege") privilege: String,
@Auth user: SessionUser
@@ -162,7 +160,7 @@ class WorkflowAccessResource() {
new WorkflowUserAccess(
userDao.fetchOneByEmail(email).getUid,
wid,
- WorkflowUserAccessPrivilege.valueOf(privilege)
+ PrivilegeEnum.valueOf(privilege)
)
)
} catch {
@@ -182,7 +180,7 @@ class WorkflowAccessResource() {
@DELETE
@Path("/revoke/{wid}/{email}")
def revokeAccess(
- @PathParam("wid") wid: UInteger,
+ @PathParam("wid") wid: Integer,
@PathParam("email") email: String
): Unit = {
context
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala
index 8240a34b339..52961a34524 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala
@@ -1,10 +1,8 @@
package edu.uci.ics.texera.web.resource.dashboard.user.workflow
import edu.uci.ics.amber.core.storage.result.ExecutionResourcesMapping
-import edu.uci.ics.amber.core.storage.{DocumentFactory, StorageConfig, VFSURIFactory}
+import edu.uci.ics.amber.core.storage.{DocumentFactory, VFSURIFactory}
import edu.uci.ics.amber.core.tuple.Tuple
-import edu.uci.ics.amber.engine.architecture.logreplay.{ReplayDestination, ReplayLogRecord}
-import edu.uci.ics.amber.engine.common.storage.SequentialRecordStorage
import edu.uci.ics.amber.core.virtualidentity.{
ChannelMarkerIdentity,
ExecutionIdentity,
@@ -12,22 +10,17 @@ import edu.uci.ics.amber.core.virtualidentity.{
WorkflowIdentity
}
import edu.uci.ics.amber.core.workflow.PortIdentity
+import edu.uci.ics.amber.engine.architecture.logreplay.{ReplayDestination, ReplayLogRecord}
import edu.uci.ics.amber.engine.common.AmberConfig
+import edu.uci.ics.amber.engine.common.storage.SequentialRecordStorage
import edu.uci.ics.texera.dao.SqlServer
-import edu.uci.ics.texera.web.auth.SessionUser
-import edu.uci.ics.texera.dao.jooq.generated.Tables.{
- OPERATOR_EXECUTIONS,
- OPERATOR_PORT_EXECUTIONS,
- USER,
- WORKFLOW_EXECUTIONS,
- WORKFLOW_VERSION
-}
+import edu.uci.ics.texera.dao.jooq.generated.Tables._
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.WorkflowExecutionsDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.WorkflowExecutions
+import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowExecutionsResource._
import edu.uci.ics.texera.web.service.ExecutionsMetadataPersistService
import io.dropwizard.auth.Auth
-import org.jooq.types.{UInteger, ULong}
import java.net.URI
import java.sql.Timestamp
@@ -36,15 +29,15 @@ import javax.annotation.security.RolesAllowed
import javax.ws.rs._
import javax.ws.rs.core.{MediaType, Response}
import scala.collection.mutable
-import scala.jdk.CollectionConverters.ListHasAsScala
+import scala.jdk.CollectionConverters._
object WorkflowExecutionsResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private lazy val executionsDao = new WorkflowExecutionsDao(context.configuration)
- def getExecutionById(eId: UInteger): WorkflowExecutions = {
+ def getExecutionById(eId: Integer): WorkflowExecutions = {
executionsDao.fetchOneByEid(eId)
}
@@ -71,16 +64,16 @@ object WorkflowExecutionsResource {
* This function retrieves the latest execution id of a workflow
*
* @param wid workflow id
- * @return UInteger
+ * @return Integer
*/
- def getLatestExecutionID(wid: UInteger): Option[UInteger] = {
+ def getLatestExecutionID(wid: Integer): Option[Integer] = {
val executions = context
.select(WORKFLOW_EXECUTIONS.EID)
.from(WORKFLOW_EXECUTIONS)
.join(WORKFLOW_VERSION)
.on(WORKFLOW_EXECUTIONS.VID.eq(WORKFLOW_VERSION.VID))
.where(WORKFLOW_VERSION.WID.eq(wid))
- .fetchInto(classOf[UInteger])
+ .fetchInto(classOf[Integer])
.asScala
.toList
if (executions.isEmpty) {
@@ -123,13 +116,13 @@ object WorkflowExecutionsResource {
.set(WORKFLOW_EXECUTIONS.RUNTIME_STATS_URI, uri.toString)
.where(
WORKFLOW_EXECUTIONS.EID
- .eq(UInteger.valueOf(eid))
+ .eq(eid.toInt)
.and(
WORKFLOW_EXECUTIONS.VID.in(
context
.select(WORKFLOW_VERSION.VID)
.from(WORKFLOW_VERSION)
- .where(WORKFLOW_VERSION.WID.eq(UInteger.valueOf(wid)))
+ .where(WORKFLOW_VERSION.WID.eq(wid.toInt))
)
)
)
@@ -141,7 +134,7 @@ object WorkflowExecutionsResource {
context
.select(OPERATOR_PORT_EXECUTIONS.RESULT_URI)
.from(OPERATOR_PORT_EXECUTIONS)
- .where(OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID.eq(UInteger.valueOf(eid.id)))
+ .where(OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID.eq(eid.id.toInt))
.fetchInto(classOf[String])
.asScala
.toList
@@ -155,7 +148,7 @@ object WorkflowExecutionsResource {
if (AmberConfig.isUserSystemEnabled) {
context
.delete(OPERATOR_PORT_EXECUTIONS)
- .where(OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID.eq(UInteger.valueOf(eid.id)))
+ .where(OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID.eq(eid.id.toInt))
.execute()
} else {
ExecutionResourcesMapping.removeExecutionResources(eid)
@@ -175,7 +168,7 @@ object WorkflowExecutionsResource {
.from(OPERATOR_PORT_EXECUTIONS)
.where(
OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID
- .eq(UInteger.valueOf(eid.id))
+ .eq(eid.id.toInt)
.and(OPERATOR_PORT_EXECUTIONS.OPERATOR_ID.eq(opId.id))
.and(OPERATOR_PORT_EXECUTIONS.PORT_ID.eq(portId.id))
)
@@ -194,8 +187,8 @@ object WorkflowExecutionsResource {
}
case class WorkflowExecutionEntry(
- eId: UInteger,
- vId: UInteger,
+ eId: Integer,
+ vId: Integer,
userName: String,
googleAvatar: String,
status: Byte,
@@ -210,27 +203,27 @@ object WorkflowExecutionsResource {
case class WorkflowRuntimeStatistics(
operatorId: String,
timestamp: Timestamp,
- inputTupleCount: ULong,
- inputTupleSize: ULong,
- outputTupleCount: ULong,
- outputTupleSize: ULong,
- dataProcessingTime: ULong,
- controlProcessingTime: ULong,
- idleTime: ULong,
- numWorkers: UInteger,
+ inputTupleCount: Long,
+ inputTupleSize: Long,
+ outputTupleCount: Long,
+ outputTupleSize: Long,
+ dataProcessingTime: Long,
+ controlProcessingTime: Long,
+ idleTime: Long,
+ numWorkers: Int,
status: Int
)
}
case class ExecutionGroupBookmarkRequest(
- wid: UInteger,
- eIds: Array[UInteger],
+ wid: Integer,
+ eIds: Array[Integer],
isBookmarked: Boolean
)
-case class ExecutionGroupDeleteRequest(wid: UInteger, eIds: Array[UInteger])
+case class ExecutionGroupDeleteRequest(wid: Integer, eIds: Array[Integer])
-case class ExecutionRenameRequest(wid: UInteger, eId: UInteger, executionName: String)
+case class ExecutionRenameRequest(wid: Integer, eId: Integer, executionName: String)
@Produces(Array(MediaType.APPLICATION_JSON))
@Path("/executions")
@@ -241,8 +234,8 @@ class WorkflowExecutionsResource {
@Path("/{wid}/interactions/{eid}")
@RolesAllowed(Array("REGULAR", "ADMIN"))
def retrieveInteractionHistory(
- @PathParam("wid") wid: UInteger,
- @PathParam("eid") eid: UInteger,
+ @PathParam("wid") wid: Integer,
+ @PathParam("eid") eid: Integer,
@Auth sessionUser: SessionUser
): List[String] = {
val user = sessionUser.getUser
@@ -282,7 +275,7 @@ class WorkflowExecutionsResource {
@Path("/{wid}")
@RolesAllowed(Array("REGULAR", "ADMIN"))
def retrieveExecutionsOfWorkflow(
- @PathParam("wid") wid: UInteger,
+ @PathParam("wid") wid: Integer,
@Auth sessionUser: SessionUser
): List[WorkflowExecutionEntry] = {
val user = sessionUser.getUser
@@ -320,8 +313,8 @@ class WorkflowExecutionsResource {
@Produces(Array(MediaType.APPLICATION_JSON))
@Path("/{wid}/{eid}")
def retrieveWorkflowRuntimeStatistics(
- @PathParam("wid") wid: UInteger,
- @PathParam("eid") eid: UInteger
+ @PathParam("wid") wid: Integer,
+ @PathParam("eid") eid: Integer
): List[WorkflowRuntimeStatistics] = {
// Create URI for runtime statistics
val uriString: String = context
@@ -358,14 +351,14 @@ class WorkflowExecutionsResource {
WorkflowRuntimeStatistics(
operatorId = record.getField(0).asInstanceOf[String],
timestamp = record.getField(1).asInstanceOf[Timestamp],
- inputTupleCount = ULong.valueOf(record.getField(2).asInstanceOf[Long]),
- inputTupleSize = ULong.valueOf(record.getField(3).asInstanceOf[Long]),
- outputTupleCount = ULong.valueOf(record.getField(4).asInstanceOf[Long]),
- outputTupleSize = ULong.valueOf(record.getField(5).asInstanceOf[Long]),
- dataProcessingTime = ULong.valueOf(record.getField(6).asInstanceOf[Long]),
- controlProcessingTime = ULong.valueOf(record.getField(7).asInstanceOf[Long]),
- idleTime = ULong.valueOf(record.getField(8).asInstanceOf[Long]),
- numWorkers = UInteger.valueOf(record.getField(9).asInstanceOf[Int]),
+ inputTupleCount = record.getField(2).asInstanceOf[Long],
+ inputTupleSize = record.getField(3).asInstanceOf[Long],
+ outputTupleCount = record.getField(4).asInstanceOf[Long],
+ outputTupleSize = record.getField(5).asInstanceOf[Long],
+ dataProcessingTime = record.getField(6).asInstanceOf[Long],
+ controlProcessingTime = record.getField(7).asInstanceOf[Long],
+ idleTime = record.getField(8).asInstanceOf[Long],
+ numWorkers = record.getField(9).asInstanceOf[Int],
status = record.getField(10).asInstanceOf[Int]
)
})
@@ -382,27 +375,27 @@ class WorkflowExecutionsResource {
@Auth sessionUser: SessionUser
): Unit = {
validateUserCanAccessWorkflow(sessionUser.getUser.getUid, request.wid)
+ val eIdsList = request.eIds.toSeq.asJava
if (request.isBookmarked) {
- val eIdArray = request.eIds.mkString("(", ",", ")")
- val sqlString = "update texera_db.workflow_executions " +
- "set texera_db.workflow_executions.bookmarked = 0 " +
- s"where texera_db.workflow_executions.eid in $eIdArray"
+ // If currently bookmarked, un-bookmark (set bookmarked = false)
context
- .query(sqlString)
+ .update(WORKFLOW_EXECUTIONS)
+ .set(WORKFLOW_EXECUTIONS.BOOKMARKED, java.lang.Boolean.valueOf(false))
+ .where(WORKFLOW_EXECUTIONS.EID.in(eIdsList))
.execute()
} else {
- val eIdArray = request.eIds.mkString("(", ",", ")")
- val sqlString = "UPDATE texera_db.workflow_executions " +
- "SET texera_db.workflow_executions.bookmarked = 1 " +
- s"WHERE texera_db.workflow_executions.eid IN $eIdArray"
+ // If currently not bookmarked, bookmark (set bookmarked = true)
context
- .query(sqlString)
+ .update(WORKFLOW_EXECUTIONS)
+ .set(WORKFLOW_EXECUTIONS.BOOKMARKED, java.lang.Boolean.valueOf(true))
+ .where(WORKFLOW_EXECUTIONS.EID.in(eIdsList))
.execute()
}
+
}
/** Determine if user is authorized to access the workflow, if not raise 401 */
- def validateUserCanAccessWorkflow(uid: UInteger, wid: UInteger): Unit = {
+ def validateUserCanAccessWorkflow(uid: Integer, wid: Integer): Unit = {
if (!WorkflowAccessResource.hasReadAccess(wid, uid))
throw new WebApplicationException(Response.Status.UNAUTHORIZED)
}
@@ -417,12 +410,11 @@ class WorkflowExecutionsResource {
@Auth sessionUser: SessionUser
): Unit = {
validateUserCanAccessWorkflow(sessionUser.getUser.getUid, request.wid)
- /* delete the execution in sql */
- val eIdArray = request.eIds.mkString("(", ",", ")")
- val sqlString: String = "DELETE FROM texera_db.workflow_executions " +
- s"WHERE texera_db.workflow_executions.eid IN $eIdArray"
+ val eIdsList = request.eIds.toSeq.asJava
+
context
- .query(sqlString)
+ .deleteFrom(WORKFLOW_EXECUTIONS)
+ .where(WORKFLOW_EXECUTIONS.EID.in(eIdsList))
.execute()
}
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
index d5c714ff3a8..ddb46d998ae 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowResource.scala
@@ -3,11 +3,9 @@ package edu.uci.ics.texera.web.resource.dashboard.user.workflow
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.typesafe.scalalogging.LazyLogging
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.texera.dao.SqlServer
-import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.dao.jooq.generated.Tables._
-import edu.uci.ics.texera.dao.jooq.generated.enums.WorkflowUserAccessPrivilege
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{
WorkflowDao,
WorkflowOfProjectDao,
@@ -15,14 +13,13 @@ import edu.uci.ics.texera.dao.jooq.generated.tables.daos.{
WorkflowUserAccessDao
}
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos._
+import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.web.resource.dashboard.hub.HubResource.recordCloneActivity
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowAccessResource.hasReadAccess
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource._
import io.dropwizard.auth.Auth
-import org.jooq.{Condition, Record9, SelectOnConditionStep}
import org.jooq.impl.DSL.{groupConcatDistinct, noCondition}
-import org.jooq.types.UInteger
-import org.jooq.{Record, Result}
+import org.jooq.{Condition, Record9, Result, SelectOnConditionStep}
import java.sql.Timestamp
import java.util
@@ -43,7 +40,7 @@ import scala.util.control.NonFatal
object WorkflowResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private lazy val workflowDao = new WorkflowDao(context.configuration)
final private lazy val workflowOfUserDao = new WorkflowOfUserDao(
@@ -54,7 +51,7 @@ object WorkflowResource {
)
final private lazy val workflowOfProjectDao = new WorkflowOfProjectDao(context.configuration)
- def getWorkflowName(wid: UInteger): String = {
+ def getWorkflowName(wid: Integer): String = {
val workflow = workflowDao.fetchOneByWid(wid)
if (workflow == null) {
throw new NotFoundException(s"Workflow with id $wid not found")
@@ -69,12 +66,12 @@ object WorkflowResource {
new WorkflowUserAccess(
user.getUid,
workflow.getWid,
- WorkflowUserAccessPrivilege.WRITE
+ PrivilegeEnum.WRITE
)
)
}
- private def workflowOfUserExists(wid: UInteger, uid: UInteger): Boolean = {
+ private def workflowOfUserExists(wid: Integer, uid: Integer): Boolean = {
workflowOfUserDao.existsById(
context
.newRecord(WORKFLOW_OF_USER.UID, WORKFLOW_OF_USER.WID)
@@ -82,7 +79,7 @@ object WorkflowResource {
)
}
- private def workflowOfProjectExists(wid: UInteger, pid: UInteger): Boolean = {
+ private def workflowOfProjectExists(wid: Integer, pid: Integer): Boolean = {
workflowOfProjectDao.existsById(
context
.newRecord(WORKFLOW_OF_PROJECT.WID, WORKFLOW_OF_PROJECT.PID)
@@ -95,22 +92,22 @@ object WorkflowResource {
accessLevel: String,
ownerName: String,
workflow: Workflow,
- projectIDs: List[UInteger],
- ownerId: UInteger
+ projectIDs: List[Integer],
+ ownerId: Integer
)
case class WorkflowWithPrivilege(
name: String,
description: String,
- wid: UInteger,
+ wid: Integer,
content: String,
creationTime: Timestamp,
lastModifiedTime: Timestamp,
- isPublished: Byte,
+ isPublished: Boolean,
readonly: Boolean
)
- case class WorkflowIDs(wids: List[UInteger], pid: Option[UInteger])
+ case class WorkflowIDs(wids: List[Integer], pid: Option[Integer])
private def updateWorkflowField(
workflow: Workflow,
@@ -163,13 +160,13 @@ object WorkflowResource {
}
def baseWorkflowSelect(): SelectOnConditionStep[Record9[
- UInteger,
+ Integer,
String,
String,
Timestamp,
Timestamp,
- WorkflowUserAccessPrivilege,
- UInteger,
+ PrivilegeEnum,
+ Integer,
String,
String
]] = {
@@ -198,17 +195,17 @@ object WorkflowResource {
def mapWorkflowEntries(
workflowEntries: Result[Record9[
- UInteger,
+ Integer,
String,
String,
Timestamp,
Timestamp,
- WorkflowUserAccessPrivilege,
- UInteger,
+ PrivilegeEnum,
+ Integer,
String,
String
]],
- uid: UInteger
+ uid: Integer
): List[DashboardWorkflow] = {
workflowEntries
.map(workflowRecord =>
@@ -223,9 +220,9 @@ object WorkflowResource {
.toString,
workflowRecord.into(USER).getName,
workflowRecord.into(WORKFLOW).into(classOf[Workflow]),
- if (workflowRecord.component9() == null) List[UInteger]()
+ if (workflowRecord.component9() == null) List[Integer]()
else
- workflowRecord.component9().split(',').map(number => UInteger.valueOf(number)).toList,
+ workflowRecord.component9().split(',').map(str => Integer.valueOf(str)).toList,
workflowRecord.into(WORKFLOW_OF_USER).getUid
)
)
@@ -341,7 +338,16 @@ class WorkflowResource extends LazyLogging {
val user = sessionUser.getUser
val workflowEntries = baseWorkflowSelect()
.where(WORKFLOW_USER_ACCESS.UID.eq(user.getUid))
- .groupBy(WORKFLOW.WID, WORKFLOW_OF_USER.UID)
+ .groupBy(
+ WORKFLOW.WID,
+ WORKFLOW.NAME,
+ WORKFLOW.DESCRIPTION,
+ WORKFLOW.CREATION_TIME,
+ WORKFLOW.LAST_MODIFIED_TIME,
+ WORKFLOW_USER_ACCESS.PRIVILEGE,
+ WORKFLOW_OF_USER.UID,
+ USER.NAME
+ )
.fetch()
mapWorkflowEntries(workflowEntries, user.getUid)
}
@@ -358,7 +364,7 @@ class WorkflowResource extends LazyLogging {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/{wid}")
def retrieveWorkflow(
- @PathParam("wid") wid: UInteger,
+ @PathParam("wid") wid: Integer,
@Auth user: SessionUser
): WorkflowWithPrivilege = {
if (WorkflowAccessResource.hasReadAccess(wid, user.getUid)) {
@@ -451,13 +457,13 @@ class WorkflowResource extends LazyLogging {
val oldWorkflow: Workflow = workflowDao.fetchOneByWid(wid)
val newWorkflow = createWorkflow(
new Workflow(
+ null,
oldWorkflow.getName + "_copy",
oldWorkflow.getDescription,
- null,
assignNewOperatorIds(oldWorkflow.getContent),
null,
null,
- 0.toByte
+ false
),
sessionUser
)
@@ -491,20 +497,20 @@ class WorkflowResource extends LazyLogging {
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/clone/{wid}")
def cloneWorkflow(
- @PathParam("wid") wid: UInteger,
+ @PathParam("wid") wid: Integer,
@Auth sessionUser: SessionUser,
@Context request: HttpServletRequest
- ): UInteger = {
+ ): Integer = {
val oldWorkflow: Workflow = workflowDao.fetchOneByWid(wid)
val newWorkflow: DashboardWorkflow = createWorkflow(
new Workflow(
+ null,
oldWorkflow.getName + "_clone",
oldWorkflow.getDescription,
- null,
assignNewOperatorIds(oldWorkflow.getContent),
null,
null,
- 0.toByte
+ false
),
sessionUser
)
@@ -534,10 +540,10 @@ class WorkflowResource extends LazyLogging {
WorkflowVersionResource.insertVersion(workflow, insertingNewWorkflow = true)
DashboardWorkflow(
isOwner = true,
- WorkflowUserAccessPrivilege.WRITE.toString,
+ PrivilegeEnum.WRITE.toString,
user.getName,
workflowDao.fetchOneByWid(workflow.getWid),
- List[UInteger](),
+ List[Integer](),
user.getUid
)
}
@@ -598,27 +604,27 @@ class WorkflowResource extends LazyLogging {
@PUT
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/public/{wid}")
- def makePublic(@PathParam("wid") wid: UInteger, @Auth user: SessionUser): Unit = {
+ def makePublic(@PathParam("wid") wid: Integer, @Auth user: SessionUser): Unit = {
val workflow: Workflow = workflowDao.fetchOneByWid(wid)
- workflow.setIsPublic(1.toByte)
+ workflow.setIsPublic(true)
workflowDao.update(workflow)
}
@PUT
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/private/{wid}")
- def makePrivate(@PathParam("wid") wid: UInteger): Unit = {
+ def makePrivate(@PathParam("wid") wid: Integer): Unit = {
val workflow: Workflow = workflowDao.fetchOneByWid(wid)
- workflow.setIsPublic(0.toByte)
+ workflow.setIsPublic(false)
workflowDao.update(workflow)
}
@GET
@RolesAllowed(Array("REGULAR", "ADMIN"))
@Path("/type/{wid}")
- def getWorkflowType(@PathParam("wid") wid: UInteger): String = {
+ def getWorkflowType(@PathParam("wid") wid: Integer): String = {
val workflow: Workflow = workflowDao.fetchOneByWid(wid)
- if (workflow.getIsPublic == 1.toByte) {
+ if (workflow.getIsPublic) {
"Public"
} else {
"Private"
@@ -627,7 +633,7 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/owner_user")
- def getOwnerUser(@QueryParam("wid") wid: UInteger): User = {
+ def getOwnerUser(@QueryParam("wid") wid: Integer): User = {
context
.select(
USER.UID,
@@ -647,7 +653,7 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/workflow_name")
- def getWorkflowName(@QueryParam("wid") wid: UInteger): String = {
+ def getWorkflowName(@QueryParam("wid") wid: Integer): String = {
context
.select(
WORKFLOW.NAME
@@ -660,7 +666,7 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/public/{wid}")
def retrievePublicWorkflow(
- @PathParam("wid") wid: UInteger
+ @PathParam("wid") wid: Integer
): WorkflowWithPrivilege = {
val workflow = workflowDao.ctx
.selectFrom(WORKFLOW)
@@ -681,7 +687,7 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/workflow_description")
- def getWorkflowDescription(@QueryParam("wid") wid: UInteger): String = {
+ def getWorkflowDescription(@QueryParam("wid") wid: Integer): String = {
context
.select(
WORKFLOW.DESCRIPTION
@@ -694,8 +700,8 @@ class WorkflowResource extends LazyLogging {
@GET
@Path("/workflow_user_access")
def workflowUserAccess(
- @QueryParam("wid") wid: UInteger
- ): util.List[UInteger] = {
+ @QueryParam("wid") wid: Integer
+ ): util.List[Integer] = {
val records = context
.select(WORKFLOW_USER_ACCESS.UID)
.from(WORKFLOW_USER_ACCESS)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowVersionResource.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowVersionResource.scala
index ed2cfa95a37..0af901fee55 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowVersionResource.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/resource/dashboard/user/workflow/WorkflowVersionResource.scala
@@ -1,7 +1,6 @@
package edu.uci.ics.texera.web.resource.dashboard.user.workflow
import com.flipkart.zjsonpatch.{JsonDiff, JsonPatch}
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.engine.common.AmberConfig
import edu.uci.ics.amber.engine.common.Utils.objectMapper
import edu.uci.ics.texera.dao.SqlServer
@@ -15,7 +14,6 @@ import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.
}
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowVersionResource._
import io.dropwizard.auth.Auth
-import org.jooq.types.UInteger
import java.sql.Timestamp
import javax.annotation.security.RolesAllowed
@@ -30,7 +28,7 @@ import scala.jdk.CollectionConverters.IterableHasAsScala
object WorkflowVersionResource {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
final private lazy val workflowVersionDao = new WorkflowVersionDao(context.configuration)
final private lazy val workflowDao = new WorkflowDao(context.configuration)
@@ -72,7 +70,7 @@ object WorkflowVersionResource {
* @param patch to update latest version
* @param wid
*/
- private def updateLatestVersion(patch: String, wid: UInteger): Unit = {
+ private def updateLatestVersion(patch: String, wid: Integer): Unit = {
// get the latest version to update its content
val vid = getLatestVersion(wid)
val workflowVersion = workflowVersionDao.fetchOneByVid(vid)
@@ -86,12 +84,12 @@ object WorkflowVersionResource {
* @param wid
* @return vid
*/
- def getLatestVersion(wid: UInteger): UInteger = {
+ def getLatestVersion(wid: Integer): Integer = {
val versions = context
.select(WORKFLOW_VERSION.VID)
.from(WORKFLOW_VERSION)
.where(WORKFLOW_VERSION.WID.eq(wid))
- .fetchInto(classOf[UInteger])
+ .fetchInto(classOf[Integer])
.asScala
.toList
// for backwards compatibility check, old constructed versions would follow the old design by not saving the current
@@ -108,7 +106,7 @@ object WorkflowVersionResource {
*
* @param wid
*/
- def insertNewVersion(wid: UInteger, content: String = "[]"): WorkflowVersion = {
+ def insertNewVersion(wid: Integer, content: String = "[]"): WorkflowVersion = {
val workflowVersion = new WorkflowVersion()
workflowVersion.setContent(content)
workflowVersion.setWid(wid)
@@ -125,9 +123,9 @@ object WorkflowVersionResource {
* @return a list of contents as strings
*/
def isSnapshotInRangeUnimportant(
- lowerBound: UInteger,
- UpperBound: UInteger,
- wid: UInteger
+ lowerBound: Integer,
+ UpperBound: Integer,
+ wid: Integer
): Boolean = {
if (lowerBound == UpperBound) {
return true
@@ -282,7 +280,7 @@ object WorkflowVersionResource {
* @param importance false is not an important version and true is an important version
*/
case class VersionEntry(
- vId: UInteger,
+ vId: Integer,
creationTime: Timestamp,
content: String,
importance: Boolean
@@ -304,7 +302,7 @@ class WorkflowVersionResource {
@Path("/{wid}")
@RolesAllowed(Array("REGULAR", "ADMIN"))
def retrieveVersionsOfWorkflow(
- @PathParam("wid") wid: UInteger,
+ @PathParam("wid") wid: Integer,
@Auth sessionUser: SessionUser
): List[VersionEntry] = {
val user = sessionUser.getUser
@@ -338,8 +336,8 @@ class WorkflowVersionResource {
@Path("/{wid}/{vid}")
@RolesAllowed(Array("REGULAR", "ADMIN"))
def retrieveWorkflowVersion(
- @PathParam("wid") wid: UInteger,
- @PathParam("vid") vid: UInteger,
+ @PathParam("wid") wid: Integer,
+ @PathParam("vid") vid: Integer,
@Auth sessionUser: SessionUser
): Workflow = {
val user = sessionUser.getUser
@@ -367,10 +365,10 @@ class WorkflowVersionResource {
@Path("/clone/{vid}")
@RolesAllowed(Array("REGULAR", "ADMIN"))
def cloneVersion(
- @PathParam("vid") vid: UInteger,
+ @PathParam("vid") vid: Integer,
@Auth sessionUser: SessionUser,
requestBody: java.util.Map[String, Int]
- ): UInteger = {
+ ): Integer = {
val displayedVersionId = requestBody.get("displayedVersionId")
// Fetch the workflow ID (`wid`) associated with the specified version (`vid`)
@@ -394,13 +392,13 @@ class WorkflowVersionResource {
try {
workflowResource.createWorkflow(
new Workflow(
+ null,
newWorkflowName,
workflowVersion.getDescription,
- null,
assignNewOperatorIds(workflowVersion.getContent),
null,
null,
- 0.toByte
+ false
),
sessionUser
)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ExecutionsMetadataPersistService.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ExecutionsMetadataPersistService.scala
index 0016b89a480..7707b5911c6 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ExecutionsMetadataPersistService.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ExecutionsMetadataPersistService.scala
@@ -1,7 +1,6 @@
package edu.uci.ics.texera.web.service
import com.typesafe.scalalogging.LazyLogging
-import edu.uci.ics.amber.core.storage.StorageConfig
import edu.uci.ics.amber.core.workflow.WorkflowContext.DEFAULT_EXECUTION_ID
import edu.uci.ics.amber.engine.common.AmberConfig
import edu.uci.ics.amber.core.virtualidentity.{ExecutionIdentity, WorkflowIdentity}
@@ -9,7 +8,6 @@ import edu.uci.ics.texera.dao.SqlServer
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.WorkflowExecutionsDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.WorkflowExecutions
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowVersionResource._
-import org.jooq.types.UInteger
import java.sql.Timestamp
@@ -19,9 +17,9 @@ import java.sql.Timestamp
*/
object ExecutionsMetadataPersistService extends LazyLogging {
final private lazy val context = SqlServer
- .getInstance(StorageConfig.jdbcUrl, StorageConfig.jdbcUsername, StorageConfig.jdbcPassword)
+ .getInstance()
.createDSLContext()
- private val workflowExecutionsDao = new WorkflowExecutionsDao(
+ private lazy val workflowExecutionsDao = new WorkflowExecutionsDao(
context.configuration
)
@@ -35,13 +33,13 @@ object ExecutionsMetadataPersistService extends LazyLogging {
def insertNewExecution(
workflowId: WorkflowIdentity,
- uid: Option[UInteger],
+ uid: Option[Integer],
executionName: String,
environmentVersion: String
): ExecutionIdentity = {
if (!AmberConfig.isUserSystemEnabled) return DEFAULT_EXECUTION_ID
// first retrieve the latest version of this workflow
- val vid = getLatestVersion(UInteger.valueOf(workflowId.id))
+ val vid = getLatestVersion(workflowId.id.toInt)
val newExecution = new WorkflowExecutions()
if (executionName != "") {
newExecution.setName(executionName)
@@ -57,7 +55,7 @@ object ExecutionsMetadataPersistService extends LazyLogging {
def tryGetExistingExecution(executionId: ExecutionIdentity): Option[WorkflowExecutions] = {
if (!AmberConfig.isUserSystemEnabled) return None
try {
- Some(workflowExecutionsDao.fetchOneByEid(UInteger.valueOf(executionId.id)))
+ Some(workflowExecutionsDao.fetchOneByEid(executionId.id.toInt))
} catch {
case t: Throwable =>
logger.info("Unable to get execution. Error = " + t.getMessage)
@@ -70,7 +68,7 @@ object ExecutionsMetadataPersistService extends LazyLogging {
)(updateFunc: WorkflowExecutions => Unit): Unit = {
if (!AmberConfig.isUserSystemEnabled) return
try {
- val execution = workflowExecutionsDao.fetchOneByEid(UInteger.valueOf(executionId.id))
+ val execution = workflowExecutionsDao.fetchOneByEid(executionId.id.toInt)
updateFunc(execution)
workflowExecutionsDao.update(execution)
} catch {
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ResultExportService.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ResultExportService.scala
index 2de178e0c86..9b0ad494d3b 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ResultExportService.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/ResultExportService.scala
@@ -22,7 +22,6 @@ import edu.uci.ics.texera.web.resource.dashboard.user.workflow.{
WorkflowExecutionsResource,
WorkflowVersionResource
}
-import org.jooq.types.UInteger
import edu.uci.ics.amber.util.ArrowUtils
import edu.uci.ics.texera.web.service.WorkflowExecutionService.getLatestExecutionId
@@ -445,7 +444,7 @@ class ResultExportService(workflowIdentity: WorkflowIdentity) {
private def generateFileName(request: ResultExportRequest, extension: String): String = {
val latestVersion =
- WorkflowVersionResource.getLatestVersion(UInteger.valueOf(request.workflowId))
+ WorkflowVersionResource.getLatestVersion(Integer.valueOf(request.workflowId))
val timestamp = LocalDateTime
.now()
.truncatedTo(ChronoUnit.SECONDS)
@@ -464,10 +463,10 @@ class ResultExportService(workflowIdentity: WorkflowIdentity) {
fileName: String
): Unit = {
request.datasetIds.foreach { did =>
- val datasetPath = PathUtils.getDatasetPath(UInteger.valueOf(did))
+ val datasetPath = PathUtils.getDatasetPath(Integer.valueOf(did))
val filePath = datasetPath.resolve(fileName)
createNewDatasetVersionByAddingFiles(
- UInteger.valueOf(did),
+ Integer.valueOf(did),
user,
Map(filePath -> pipedInputStream)
)
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowEmailNotifier.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowEmailNotifier.scala
index 508ab8f5700..4c851c6fc76 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowEmailNotifier.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowEmailNotifier.scala
@@ -5,7 +5,6 @@ import edu.uci.ics.amber.engine.architecture.rpc.controlreturns.WorkflowAggregat
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource
import edu.uci.ics.texera.web.resource.{EmailMessage, GmailResource}
import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator
-import org.jooq.types.UInteger
import java.net.URI
import java.time.format.DateTimeFormatter
@@ -16,7 +15,7 @@ class WorkflowEmailNotifier(
userEmail: String,
sessionUri: URI
) extends EmailNotifier {
- private val workflowName = WorkflowResource.getWorkflowName(UInteger.valueOf(workflowId))
+ private val workflowName = WorkflowResource.getWorkflowName(workflowId.toInt)
private val emailValidator = new EmailValidator()
private val CompletedPausedOrTerminatedStates: Set[WorkflowAggregatedState] = Set(
COMPLETED,
diff --git a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowExecutionService.scala b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowExecutionService.scala
index d944ee95aeb..522d629ef45 100644
--- a/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowExecutionService.scala
+++ b/core/amber/src/main/scala/edu/uci/ics/texera/web/service/WorkflowExecutionService.scala
@@ -7,9 +7,9 @@ import edu.uci.ics.amber.core.workflow.WorkflowContext.DEFAULT_EXECUTION_ID
import edu.uci.ics.amber.engine.architecture.controller.{ControllerConfig, Workflow}
import edu.uci.ics.amber.engine.architecture.rpc.controlcommands.EmptyRequest
import edu.uci.ics.amber.engine.architecture.rpc.controlreturns.WorkflowAggregatedState._
-import edu.uci.ics.amber.engine.common.{AmberConfig, Utils}
import edu.uci.ics.amber.engine.common.client.AmberClient
import edu.uci.ics.amber.engine.common.executionruntimestate.ExecutionMetadataStore
+import edu.uci.ics.amber.engine.common.{AmberConfig, Utils}
import edu.uci.ics.texera.web.model.websocket.event.{
TexeraWebSocketEvent,
WorkflowErrorEvent,
@@ -21,7 +21,6 @@ import edu.uci.ics.texera.web.storage.ExecutionStateStore
import edu.uci.ics.texera.web.storage.ExecutionStateStore.updateWorkflowState
import edu.uci.ics.texera.web.{ComputingUnitMaster, SubscriptionManager, WebsocketInput}
import edu.uci.ics.texera.workflow.{LogicalPlan, WorkflowCompiler}
-import org.jooq.types.UInteger
import java.net.URI
import scala.collection.mutable
@@ -32,7 +31,7 @@ object WorkflowExecutionService {
return Some(DEFAULT_EXECUTION_ID)
}
WorkflowExecutionsResource
- .getLatestExecutionID(UInteger.valueOf(workflowId.id))
+ .getLatestExecutionID(workflowId.id.toInt)
.map(eid => new ExecutionIdentity(eid.longValue()))
}
}
diff --git a/core/amber/src/test/scala/edu/uci/ics/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala b/core/amber/src/test/scala/edu/uci/ics/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala
index b8f74c7e1e2..479e210f0e7 100644
--- a/core/amber/src/test/scala/edu/uci/ics/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala
+++ b/core/amber/src/test/scala/edu/uci/ics/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala
@@ -13,11 +13,10 @@ import edu.uci.ics.amber.operator.aggregate.{AggregateOpDesc, AggregationFunctio
import edu.uci.ics.amber.operator.keywordSearch.KeywordSearchOpDesc
import edu.uci.ics.amber.operator.source.scan.csv.CSVScanSourceOpDesc
import edu.uci.ics.texera.dao.MockTexeraDB
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos._
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos._
import edu.uci.ics.texera.workflow.LogicalLink
-import org.jooq.types.UInteger
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
@@ -40,9 +39,9 @@ class DefaultCostEstimatorSpec
private val testUser: User = {
val user = new User
- user.setUid(UInteger.valueOf(1))
+ user.setUid(Integer.valueOf(1))
user.setName("test_user")
- user.setRole(UserRole.ADMIN)
+ user.setRole(UserRoleEnum.ADMIN)
user.setPassword("123")
user.setEmail("test_user@test.com")
user
@@ -51,7 +50,7 @@ class DefaultCostEstimatorSpec
private val testWorkflowEntry: Workflow = {
val workflow = new Workflow
workflow.setName("test workflow")
- workflow.setWid(UInteger.valueOf(1))
+ workflow.setWid(Integer.valueOf(1))
workflow.setContent("test workflow content")
workflow.setDescription("test description")
workflow
@@ -59,17 +58,17 @@ class DefaultCostEstimatorSpec
private val testWorkflowVersionEntry: WorkflowVersion = {
val workflowVersion = new WorkflowVersion
- workflowVersion.setWid(UInteger.valueOf(1))
- workflowVersion.setVid(UInteger.valueOf(1))
+ workflowVersion.setWid(Integer.valueOf(1))
+ workflowVersion.setVid(Integer.valueOf(1))
workflowVersion.setContent("test version content")
workflowVersion
}
private val testWorkflowExecutionEntry: WorkflowExecutions = {
val workflowExecution = new WorkflowExecutions
- workflowExecution.setEid(UInteger.valueOf(1))
- workflowExecution.setVid(UInteger.valueOf(1))
- workflowExecution.setUid(UInteger.valueOf(1))
+ workflowExecution.setEid(Integer.valueOf(1))
+ workflowExecution.setVid(Integer.valueOf(1))
+ workflowExecution.setUid(Integer.valueOf(1))
workflowExecution.setStatus(3.toByte)
workflowExecution.setEnvironmentVersion("test engine")
workflowExecution
diff --git a/core/amber/src/test/scala/edu/uci/ics/amber/engine/e2e/DataProcessingSpec.scala b/core/amber/src/test/scala/edu/uci/ics/amber/engine/e2e/DataProcessingSpec.scala
index 601915ecbb9..01ff5e67ba1 100644
--- a/core/amber/src/test/scala/edu/uci/ics/amber/engine/e2e/DataProcessingSpec.scala
+++ b/core/amber/src/test/scala/edu/uci/ics/amber/engine/e2e/DataProcessingSpec.scala
@@ -113,12 +113,11 @@ class DataProcessingSpec
val table: String = "test"
val username: String = "root"
val password: String = ""
- val driver = new com.mysql.cj.jdbc.Driver()
+ val driver = new org.postgresql.Driver()
DriverManager.registerDriver(driver)
val config = DBConfigurationBuilder.newBuilder
.setPort(0) // 0 => automatically detect free port
- .addArg("--default-time-zone=+0:00")
.build()
inMemoryMySQLInstance = Option(DB.newEmbeddedDB(config))
diff --git a/core/amber/src/test/scala/edu/uci/ics/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala b/core/amber/src/test/scala/edu/uci/ics/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala
index b6de9bb8fed..a02f462211e 100644
--- a/core/amber/src/test/scala/edu/uci/ics/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala
+++ b/core/amber/src/test/scala/edu/uci/ics/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala
@@ -3,7 +3,7 @@ package edu.uci.ics.texera.web.resource.dashboard.file
import edu.uci.ics.texera.dao.MockTexeraDB
import edu.uci.ics.texera.web.auth.SessionUser
import edu.uci.ics.texera.dao.jooq.generated.Tables.{USER, WORKFLOW, WORKFLOW_OF_PROJECT}
-import edu.uci.ics.texera.dao.jooq.generated.enums.UserRole
+import edu.uci.ics.texera.dao.jooq.generated.enums.UserRoleEnum
import edu.uci.ics.texera.dao.jooq.generated.tables.daos.UserDao
import edu.uci.ics.texera.dao.jooq.generated.tables.pojos.{Project, User, Workflow}
import edu.uci.ics.texera.web.resource.dashboard.DashboardResource.SearchQueryParams
@@ -16,7 +16,7 @@ import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.
import edu.uci.ics.texera.web.resource.dashboard.{DashboardResource, FulltextSearchQueryUtils}
import org.jooq.Condition
import org.jooq.impl.DSL.noCondition
-import org.jooq.types.UInteger
+
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
@@ -34,18 +34,18 @@ class WorkflowResourceSpec
private val testUser: User = {
val user = new User
- user.setUid(UInteger.valueOf(1))
+ user.setUid(Integer.valueOf(1))
user.setName("test_user")
- user.setRole(UserRole.ADMIN)
+ user.setRole(UserRoleEnum.ADMIN)
user.setPassword("123")
user
}
private val testUser2: User = {
val user = new User
- user.setUid(UInteger.valueOf(2))
+ user.setUid(Integer.valueOf(2))
user.setName("test_user2")
- user.setRole(UserRole.ADMIN)
+ user.setRole(UserRoleEnum.ADMIN)
user.setPassword("123")
user
}
@@ -364,43 +364,43 @@ class WorkflowResourceSpec
}
it should "return a proper condition for a single projectId" in {
- val projectIdList = new java.util.ArrayList[UInteger](util.Arrays.asList(UInteger.valueOf(1)))
+ val projectIdList = new java.util.ArrayList[Integer](util.Arrays.asList(Integer.valueOf(1)))
val projectFilter: Condition =
FulltextSearchQueryUtils.getContainsFilter(projectIdList, WORKFLOW_OF_PROJECT.PID)
- assert(projectFilter.toString == WORKFLOW_OF_PROJECT.PID.eq(UInteger.valueOf(1)).toString)
+ assert(projectFilter.toString == WORKFLOW_OF_PROJECT.PID.eq(Integer.valueOf(1)).toString)
}
it should "return a proper condition for multiple projectIds" in {
- val projectIdList = new java.util.ArrayList[UInteger](
- util.Arrays.asList(UInteger.valueOf(1), UInteger.valueOf(2))
+ val projectIdList = new java.util.ArrayList[Integer](
+ util.Arrays.asList(Integer.valueOf(1), Integer.valueOf(2))
)
val projectFilter: Condition =
FulltextSearchQueryUtils.getContainsFilter(projectIdList, WORKFLOW_OF_PROJECT.PID)
assert(
projectFilter.toString == WORKFLOW_OF_PROJECT.PID
- .eq(UInteger.valueOf(1))
- .or(WORKFLOW_OF_PROJECT.PID.eq(UInteger.valueOf(2)))
+ .eq(Integer.valueOf(1))
+ .or(WORKFLOW_OF_PROJECT.PID.eq(Integer.valueOf(2)))
.toString
)
}
it should "return a proper condition for a single workflowID" in {
- val workflowIdList = new java.util.ArrayList[UInteger](util.Arrays.asList(UInteger.valueOf(1)))
+ val workflowIdList = new java.util.ArrayList[Integer](util.Arrays.asList(Integer.valueOf(1)))
val workflowIdFilter: Condition =
FulltextSearchQueryUtils.getContainsFilter(workflowIdList, WORKFLOW.WID)
- assert(workflowIdFilter.toString == WORKFLOW.WID.eq(UInteger.valueOf(1)).toString)
+ assert(workflowIdFilter.toString == WORKFLOW.WID.eq(Integer.valueOf(1)).toString)
}
it should "return a proper condition for multiple workflowIDs" in {
- val workflowIdList = new java.util.ArrayList[UInteger](
- util.Arrays.asList(UInteger.valueOf(1), UInteger.valueOf(2))
+ val workflowIdList = new java.util.ArrayList[Integer](
+ util.Arrays.asList(Integer.valueOf(1), Integer.valueOf(2))
)
val workflowIdFilter: Condition =
FulltextSearchQueryUtils.getContainsFilter(workflowIdList, WORKFLOW.WID)
assert(
workflowIdFilter.toString == WORKFLOW.WID
- .eq(UInteger.valueOf(1))
- .or(WORKFLOW.WID.eq(UInteger.valueOf(2)))
+ .eq(Integer.valueOf(1))
+ .or(WORKFLOW.WID.eq(Integer.valueOf(2)))
.toString
)
}
diff --git a/core/dao/build.sbt b/core/dao/build.sbt
index 526c37be92e..ef673546380 100644
--- a/core/dao/build.sbt
+++ b/core/dao/build.sbt
@@ -70,7 +70,7 @@ libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.15" % Test, // ScalaTest
"junit" % "junit" % "4.13.2" % Test, // JUnit
"com.novocode" % "junit-interface" % "0.11" % Test, // SBT interface for JUnit
- "ch.vorburger.mariaDB4j" % "mariaDB4j" % "2.4.0" % Test // for mocking DB
+ "io.zonky.test" % "embedded-postgres" % "2.1.0" % Test // For mock postgres DB
)
/////////////////////////////////////////////////////////////////////////////
@@ -78,8 +78,8 @@ libraryDependencies ++= Seq(
/////////////////////////////////////////////////////////////////////////////
libraryDependencies ++= Seq(
- "org.jooq" % "jooq" % "3.14.16",
- "org.jooq" % "jooq-codegen" % "3.12.4"
+ "org.jooq" % "jooq" % "3.16.10",
+ "org.jooq" % "jooq-codegen" % "3.16.10"
)
/////////////////////////////////////////////////////////////////////////////
@@ -88,5 +88,6 @@ libraryDependencies ++= Seq(
libraryDependencies ++= Seq(
"mysql" % "mysql-connector-java" % "8.0.33", // MySQL connector
+ "org.postgresql" % "postgresql" % "42.7.4",
"org.yaml" % "snakeyaml" % "1.30", // for reading storage config yaml file
)
\ No newline at end of file
diff --git a/core/dao/src/main/resources/jooq-conf.xml b/core/dao/src/main/resources/jooq-conf.xml
index 2935bce5073..1909565fadf 100644
--- a/core/dao/src/main/resources/jooq-conf.xml
+++ b/core/dao/src/main/resources/jooq-conf.xml
@@ -3,7 +3,7 @@
false
-
+ false
true
true
@@ -17,7 +17,7 @@
- org.jooq.meta.mysql.MySQLDatabase
+ org.jooq.meta.postgres.PostgresDatabase
@@ -32,7 +32,12 @@
(A Java regular expression. Use the pipe to separate several expressions).
Excludes match before includes, i.e. excludes have a higher priority -->
(test_.*)|(ignore_.*)
-
+
+
+ TIMESTAMP
+ (?i)TIMESTAMP
+
+
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/JooqCodeGenerator.scala b/core/dao/src/main/scala/edu/uci/ics/texera/dao/JooqCodeGenerator.scala
index f0297781434..b560525f85d 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/JooqCodeGenerator.scala
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/JooqCodeGenerator.scala
@@ -38,7 +38,7 @@ object JooqCodeGenerator {
// Set JDBC configuration for jOOQ
val jooqJdbcConfig = new Jdbc
- jooqJdbcConfig.setDriver("com.mysql.cj.jdbc.Driver")
+ jooqJdbcConfig.setDriver("org.postgresql.Driver")
jooqJdbcConfig.setUrl(jdbcConfig("url").toString)
jooqJdbcConfig.setUsername(jdbcConfig("username").toString)
jooqJdbcConfig.setPassword(jdbcConfig("password").toString)
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/SqlServer.scala b/core/dao/src/main/scala/edu/uci/ics/texera/dao/SqlServer.scala
index f1915fb16f9..2748bf1e948 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/SqlServer.scala
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/SqlServer.scala
@@ -1,8 +1,8 @@
package edu.uci.ics.texera.dao
-import com.mysql.cj.jdbc.MysqlDataSource
-import org.jooq.{DSLContext, SQLDialect}
import org.jooq.impl.DSL
+import org.jooq.{DSLContext, SQLDialect}
+import org.postgresql.ds.PGSimpleDataSource
/**
* SqlServer class that manages a connection to a MySQL database using jOOQ.
@@ -12,15 +12,14 @@ import org.jooq.impl.DSL
* @param password The password for authenticating with the MySQL database.
*/
class SqlServer private (url: String, user: String, password: String) {
- val SQL_DIALECT: SQLDialect = SQLDialect.MYSQL
- private val dataSource: MysqlDataSource = new MysqlDataSource()
- var context: DSLContext = _
-
- {
+ val SQL_DIALECT: SQLDialect = SQLDialect.POSTGRES
+ private val dataSource: PGSimpleDataSource = new PGSimpleDataSource()
+ var context: DSLContext = {
dataSource.setUrl(url)
dataSource.setUser(user)
dataSource.setPassword(password)
- context = DSL.using(dataSource, SQL_DIALECT)
+ dataSource.setConnectTimeout(5)
+ DSL.using(dataSource, SQL_DIALECT)
}
def createDSLContext(): DSLContext = context
@@ -31,24 +30,19 @@ class SqlServer private (url: String, user: String, password: String) {
}
object SqlServer {
- @volatile private var instance: Option[SqlServer] = None
+ private var instance: Option[SqlServer] = None
- def getInstance(url: String, user: String, password: String): SqlServer = {
- instance match {
- case Some(server) => server
- case None =>
- synchronized {
- instance match {
- case Some(server) => server
- case None =>
- val server = new SqlServer(url, user, password)
- instance = Some(server)
- server
- }
- }
+ def initConnection(url: String, user: String, password: String): Unit = {
+ if (instance.isEmpty) {
+ val server = new SqlServer(url, user, password)
+ instance = Some(server)
}
}
+ def getInstance(): SqlServer = {
+ instance.get
+ }
+
/**
* A utility function for create a transaction block using given sql context
* @param dsl the sql context
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/DefaultCatalog.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/DefaultCatalog.java
index 276732fc44f..e62a434d605 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/DefaultCatalog.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/DefaultCatalog.java
@@ -4,10 +4,10 @@
package edu.uci.ics.texera.dao.jooq.generated;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import org.jooq.Constants;
import org.jooq.Schema;
import org.jooq.impl.CatalogImpl;
@@ -18,17 +18,17 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DefaultCatalog extends CatalogImpl {
- private static final long serialVersionUID = 1757128142;
+ private static final long serialVersionUID = 1L;
/**
- * The reference instance of
+ * The reference instance of DEFAULT_CATALOG
*/
public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog();
/**
* The schema texera_db
.
*/
- public final TexeraDb TEXERA_DB = edu.uci.ics.texera.dao.jooq.generated.TexeraDb.TEXERA_DB;
+ public final TexeraDb TEXERA_DB = TexeraDb.TEXERA_DB;
/**
* No further instances allowed
@@ -39,13 +39,16 @@ private DefaultCatalog() {
@Override
public final List getSchemas() {
- List result = new ArrayList();
- result.addAll(getSchemas0());
- return result;
+ return Arrays.asList(
+ TexeraDb.TEXERA_DB
+ );
}
- private final List getSchemas0() {
- return Arrays.asList(
- TexeraDb.TEXERA_DB);
- }
+ /**
+ * A reference to the 3.16 minor release of the code generator. If this
+ * doesn't compile, it's because the runtime library uses an older minor
+ * release, namely: 3.16. You can turn off the generation of this reference
+ * by specifying /configuration/generator/generate/jooqVersionReference
+ */
+ private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_16;
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Indexes.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Indexes.java
deleted file mode 100644
index f3b7cf15bf4..00000000000
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Indexes.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * This file is generated by jOOQ.
- */
-package edu.uci.ics.texera.dao.jooq.generated;
-
-
-import edu.uci.ics.texera.dao.jooq.generated.tables.Dataset;
-import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserAccess;
-import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserLikes;
-import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetVersion;
-import edu.uci.ics.texera.dao.jooq.generated.tables.DatasetViewCount;
-import edu.uci.ics.texera.dao.jooq.generated.tables.OperatorExecutions;
-import edu.uci.ics.texera.dao.jooq.generated.tables.OperatorPortExecutions;
-import edu.uci.ics.texera.dao.jooq.generated.tables.Project;
-import edu.uci.ics.texera.dao.jooq.generated.tables.ProjectUserAccess;
-import edu.uci.ics.texera.dao.jooq.generated.tables.PublicProject;
-import edu.uci.ics.texera.dao.jooq.generated.tables.User;
-import edu.uci.ics.texera.dao.jooq.generated.tables.UserConfig;
-import edu.uci.ics.texera.dao.jooq.generated.tables.Workflow;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowExecutions;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowOfProject;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowOfUser;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowUserAccess;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowUserClones;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowUserLikes;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowVersion;
-import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowViewCount;
-
-import org.jooq.Index;
-import org.jooq.OrderField;
-import org.jooq.impl.Internal;
-
-
-/**
- * A class modelling indexes of tables of the texera_db
schema.
- */
-@SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public class Indexes {
-
- // -------------------------------------------------------------------------
- // INDEX definitions
- // -------------------------------------------------------------------------
-
- public static final Index DATASET_IDX_DATASET_NAME_DESCRIPTION = Indexes0.DATASET_IDX_DATASET_NAME_DESCRIPTION;
- public static final Index DATASET_OWNER_UID = Indexes0.DATASET_OWNER_UID;
- public static final Index DATASET_PRIMARY = Indexes0.DATASET_PRIMARY;
- public static final Index DATASET_USER_ACCESS_PRIMARY = Indexes0.DATASET_USER_ACCESS_PRIMARY;
- public static final Index DATASET_USER_ACCESS_UID = Indexes0.DATASET_USER_ACCESS_UID;
- public static final Index DATASET_USER_LIKES_DID = Indexes0.DATASET_USER_LIKES_DID;
- public static final Index DATASET_USER_LIKES_PRIMARY = Indexes0.DATASET_USER_LIKES_PRIMARY;
- public static final Index DATASET_VERSION_DID = Indexes0.DATASET_VERSION_DID;
- public static final Index DATASET_VERSION_IDX_DATASET_VERSION_NAME = Indexes0.DATASET_VERSION_IDX_DATASET_VERSION_NAME;
- public static final Index DATASET_VERSION_PRIMARY = Indexes0.DATASET_VERSION_PRIMARY;
- public static final Index DATASET_VIEW_COUNT_PRIMARY = Indexes0.DATASET_VIEW_COUNT_PRIMARY;
- public static final Index OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID = Indexes0.OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID;
- public static final Index OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID = Indexes0.OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID;
- public static final Index PROJECT_IDX_USER_PROJECT_NAME_DESCRIPTION = Indexes0.PROJECT_IDX_USER_PROJECT_NAME_DESCRIPTION;
- public static final Index PROJECT_OWNER_ID = Indexes0.PROJECT_OWNER_ID;
- public static final Index PROJECT_PRIMARY = Indexes0.PROJECT_PRIMARY;
- public static final Index PROJECT_USER_ACCESS_PID = Indexes0.PROJECT_USER_ACCESS_PID;
- public static final Index PROJECT_USER_ACCESS_PRIMARY = Indexes0.PROJECT_USER_ACCESS_PRIMARY;
- public static final Index PUBLIC_PROJECT_PRIMARY = Indexes0.PUBLIC_PROJECT_PRIMARY;
- public static final Index USER_EMAIL = Indexes0.USER_EMAIL;
- public static final Index USER_GOOGLE_ID = Indexes0.USER_GOOGLE_ID;
- public static final Index USER_IDX_USER_NAME = Indexes0.USER_IDX_USER_NAME;
- public static final Index USER_PRIMARY = Indexes0.USER_PRIMARY;
- public static final Index USER_CONFIG_PRIMARY = Indexes0.USER_CONFIG_PRIMARY;
- public static final Index WORKFLOW_IDX_WORKFLOW_NAME_DESCRIPTION_CONTENT = Indexes0.WORKFLOW_IDX_WORKFLOW_NAME_DESCRIPTION_CONTENT;
- public static final Index WORKFLOW_PRIMARY = Indexes0.WORKFLOW_PRIMARY;
- public static final Index WORKFLOW_EXECUTIONS_PRIMARY = Indexes0.WORKFLOW_EXECUTIONS_PRIMARY;
- public static final Index WORKFLOW_EXECUTIONS_UID = Indexes0.WORKFLOW_EXECUTIONS_UID;
- public static final Index WORKFLOW_EXECUTIONS_VID = Indexes0.WORKFLOW_EXECUTIONS_VID;
- public static final Index WORKFLOW_OF_PROJECT_PID = Indexes0.WORKFLOW_OF_PROJECT_PID;
- public static final Index WORKFLOW_OF_PROJECT_PRIMARY = Indexes0.WORKFLOW_OF_PROJECT_PRIMARY;
- public static final Index WORKFLOW_OF_USER_PRIMARY = Indexes0.WORKFLOW_OF_USER_PRIMARY;
- public static final Index WORKFLOW_OF_USER_WID = Indexes0.WORKFLOW_OF_USER_WID;
- public static final Index WORKFLOW_USER_ACCESS_PRIMARY = Indexes0.WORKFLOW_USER_ACCESS_PRIMARY;
- public static final Index WORKFLOW_USER_ACCESS_WID = Indexes0.WORKFLOW_USER_ACCESS_WID;
- public static final Index WORKFLOW_USER_CLONES_PRIMARY = Indexes0.WORKFLOW_USER_CLONES_PRIMARY;
- public static final Index WORKFLOW_USER_CLONES_WID = Indexes0.WORKFLOW_USER_CLONES_WID;
- public static final Index WORKFLOW_USER_LIKES_PRIMARY = Indexes0.WORKFLOW_USER_LIKES_PRIMARY;
- public static final Index WORKFLOW_USER_LIKES_WID = Indexes0.WORKFLOW_USER_LIKES_WID;
- public static final Index WORKFLOW_VERSION_PRIMARY = Indexes0.WORKFLOW_VERSION_PRIMARY;
- public static final Index WORKFLOW_VERSION_WID = Indexes0.WORKFLOW_VERSION_WID;
- public static final Index WORKFLOW_VIEW_COUNT_PRIMARY = Indexes0.WORKFLOW_VIEW_COUNT_PRIMARY;
-
- // -------------------------------------------------------------------------
- // [#1459] distribute members to avoid static initialisers > 64kb
- // -------------------------------------------------------------------------
-
- private static class Indexes0 {
- public static Index DATASET_IDX_DATASET_NAME_DESCRIPTION = Internal.createIndex("idx_dataset_name_description", Dataset.DATASET, new OrderField[] { Dataset.DATASET.NAME, Dataset.DATASET.DESCRIPTION }, false);
- public static Index DATASET_OWNER_UID = Internal.createIndex("owner_uid", Dataset.DATASET, new OrderField[] { Dataset.DATASET.OWNER_UID }, false);
- public static Index DATASET_PRIMARY = Internal.createIndex("PRIMARY", Dataset.DATASET, new OrderField[] { Dataset.DATASET.DID }, true);
- public static Index DATASET_USER_ACCESS_PRIMARY = Internal.createIndex("PRIMARY", DatasetUserAccess.DATASET_USER_ACCESS, new OrderField[] { DatasetUserAccess.DATASET_USER_ACCESS.DID, DatasetUserAccess.DATASET_USER_ACCESS.UID }, true);
- public static Index DATASET_USER_ACCESS_UID = Internal.createIndex("uid", DatasetUserAccess.DATASET_USER_ACCESS, new OrderField[] { DatasetUserAccess.DATASET_USER_ACCESS.UID }, false);
- public static Index DATASET_USER_LIKES_DID = Internal.createIndex("did", DatasetUserLikes.DATASET_USER_LIKES, new OrderField[] { DatasetUserLikes.DATASET_USER_LIKES.DID }, false);
- public static Index DATASET_USER_LIKES_PRIMARY = Internal.createIndex("PRIMARY", DatasetUserLikes.DATASET_USER_LIKES, new OrderField[] { DatasetUserLikes.DATASET_USER_LIKES.UID, DatasetUserLikes.DATASET_USER_LIKES.DID }, true);
- public static Index DATASET_VERSION_DID = Internal.createIndex("did", DatasetVersion.DATASET_VERSION, new OrderField[] { DatasetVersion.DATASET_VERSION.DID }, false);
- public static Index DATASET_VERSION_IDX_DATASET_VERSION_NAME = Internal.createIndex("idx_dataset_version_name", DatasetVersion.DATASET_VERSION, new OrderField[] { DatasetVersion.DATASET_VERSION.NAME }, false);
- public static Index DATASET_VERSION_PRIMARY = Internal.createIndex("PRIMARY", DatasetVersion.DATASET_VERSION, new OrderField[] { DatasetVersion.DATASET_VERSION.DVID }, true);
- public static Index DATASET_VIEW_COUNT_PRIMARY = Internal.createIndex("PRIMARY", DatasetViewCount.DATASET_VIEW_COUNT, new OrderField[] { DatasetViewCount.DATASET_VIEW_COUNT.DID }, true);
- public static Index OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID = Internal.createIndex("workflow_execution_id", OperatorExecutions.OPERATOR_EXECUTIONS, new OrderField[] { OperatorExecutions.OPERATOR_EXECUTIONS.WORKFLOW_EXECUTION_ID, OperatorExecutions.OPERATOR_EXECUTIONS.OPERATOR_ID }, true);
- public static Index OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID = Internal.createIndex("workflow_execution_id", OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS, new OrderField[] { OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.OPERATOR_ID, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.PORT_ID }, true);
- public static Index PROJECT_IDX_USER_PROJECT_NAME_DESCRIPTION = Internal.createIndex("idx_user_project_name_description", Project.PROJECT, new OrderField[] { Project.PROJECT.NAME, Project.PROJECT.DESCRIPTION }, false);
- public static Index PROJECT_OWNER_ID = Internal.createIndex("owner_id", Project.PROJECT, new OrderField[] { Project.PROJECT.OWNER_ID, Project.PROJECT.NAME }, true);
- public static Index PROJECT_PRIMARY = Internal.createIndex("PRIMARY", Project.PROJECT, new OrderField[] { Project.PROJECT.PID }, true);
- public static Index PROJECT_USER_ACCESS_PID = Internal.createIndex("pid", ProjectUserAccess.PROJECT_USER_ACCESS, new OrderField[] { ProjectUserAccess.PROJECT_USER_ACCESS.PID }, false);
- public static Index PROJECT_USER_ACCESS_PRIMARY = Internal.createIndex("PRIMARY", ProjectUserAccess.PROJECT_USER_ACCESS, new OrderField[] { ProjectUserAccess.PROJECT_USER_ACCESS.UID, ProjectUserAccess.PROJECT_USER_ACCESS.PID }, true);
- public static Index PUBLIC_PROJECT_PRIMARY = Internal.createIndex("PRIMARY", PublicProject.PUBLIC_PROJECT, new OrderField[] { PublicProject.PUBLIC_PROJECT.PID }, true);
- public static Index USER_EMAIL = Internal.createIndex("email", User.USER, new OrderField[] { User.USER.EMAIL }, true);
- public static Index USER_GOOGLE_ID = Internal.createIndex("google_id", User.USER, new OrderField[] { User.USER.GOOGLE_ID }, true);
- public static Index USER_IDX_USER_NAME = Internal.createIndex("idx_user_name", User.USER, new OrderField[] { User.USER.NAME }, false);
- public static Index USER_PRIMARY = Internal.createIndex("PRIMARY", User.USER, new OrderField[] { User.USER.UID }, true);
- public static Index USER_CONFIG_PRIMARY = Internal.createIndex("PRIMARY", UserConfig.USER_CONFIG, new OrderField[] { UserConfig.USER_CONFIG.UID, UserConfig.USER_CONFIG.KEY }, true);
- public static Index WORKFLOW_IDX_WORKFLOW_NAME_DESCRIPTION_CONTENT = Internal.createIndex("idx_workflow_name_description_content", Workflow.WORKFLOW, new OrderField[] { Workflow.WORKFLOW.NAME, Workflow.WORKFLOW.DESCRIPTION, Workflow.WORKFLOW.CONTENT }, false);
- public static Index WORKFLOW_PRIMARY = Internal.createIndex("PRIMARY", Workflow.WORKFLOW, new OrderField[] { Workflow.WORKFLOW.WID }, true);
- public static Index WORKFLOW_EXECUTIONS_PRIMARY = Internal.createIndex("PRIMARY", WorkflowExecutions.WORKFLOW_EXECUTIONS, new OrderField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.EID }, true);
- public static Index WORKFLOW_EXECUTIONS_UID = Internal.createIndex("uid", WorkflowExecutions.WORKFLOW_EXECUTIONS, new OrderField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.UID }, false);
- public static Index WORKFLOW_EXECUTIONS_VID = Internal.createIndex("vid", WorkflowExecutions.WORKFLOW_EXECUTIONS, new OrderField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.VID }, false);
- public static Index WORKFLOW_OF_PROJECT_PID = Internal.createIndex("pid", WorkflowOfProject.WORKFLOW_OF_PROJECT, new OrderField[] { WorkflowOfProject.WORKFLOW_OF_PROJECT.PID }, false);
- public static Index WORKFLOW_OF_PROJECT_PRIMARY = Internal.createIndex("PRIMARY", WorkflowOfProject.WORKFLOW_OF_PROJECT, new OrderField[] { WorkflowOfProject.WORKFLOW_OF_PROJECT.WID, WorkflowOfProject.WORKFLOW_OF_PROJECT.PID }, true);
- public static Index WORKFLOW_OF_USER_PRIMARY = Internal.createIndex("PRIMARY", WorkflowOfUser.WORKFLOW_OF_USER, new OrderField[] { WorkflowOfUser.WORKFLOW_OF_USER.UID, WorkflowOfUser.WORKFLOW_OF_USER.WID }, true);
- public static Index WORKFLOW_OF_USER_WID = Internal.createIndex("wid", WorkflowOfUser.WORKFLOW_OF_USER, new OrderField[] { WorkflowOfUser.WORKFLOW_OF_USER.WID }, false);
- public static Index WORKFLOW_USER_ACCESS_PRIMARY = Internal.createIndex("PRIMARY", WorkflowUserAccess.WORKFLOW_USER_ACCESS, new OrderField[] { WorkflowUserAccess.WORKFLOW_USER_ACCESS.UID, WorkflowUserAccess.WORKFLOW_USER_ACCESS.WID }, true);
- public static Index WORKFLOW_USER_ACCESS_WID = Internal.createIndex("wid", WorkflowUserAccess.WORKFLOW_USER_ACCESS, new OrderField[] { WorkflowUserAccess.WORKFLOW_USER_ACCESS.WID }, false);
- public static Index WORKFLOW_USER_CLONES_PRIMARY = Internal.createIndex("PRIMARY", WorkflowUserClones.WORKFLOW_USER_CLONES, new OrderField[] { WorkflowUserClones.WORKFLOW_USER_CLONES.UID, WorkflowUserClones.WORKFLOW_USER_CLONES.WID }, true);
- public static Index WORKFLOW_USER_CLONES_WID = Internal.createIndex("wid", WorkflowUserClones.WORKFLOW_USER_CLONES, new OrderField[] { WorkflowUserClones.WORKFLOW_USER_CLONES.WID }, false);
- public static Index WORKFLOW_USER_LIKES_PRIMARY = Internal.createIndex("PRIMARY", WorkflowUserLikes.WORKFLOW_USER_LIKES, new OrderField[] { WorkflowUserLikes.WORKFLOW_USER_LIKES.UID, WorkflowUserLikes.WORKFLOW_USER_LIKES.WID }, true);
- public static Index WORKFLOW_USER_LIKES_WID = Internal.createIndex("wid", WorkflowUserLikes.WORKFLOW_USER_LIKES, new OrderField[] { WorkflowUserLikes.WORKFLOW_USER_LIKES.WID }, false);
- public static Index WORKFLOW_VERSION_PRIMARY = Internal.createIndex("PRIMARY", WorkflowVersion.WORKFLOW_VERSION, new OrderField[] { WorkflowVersion.WORKFLOW_VERSION.VID }, true);
- public static Index WORKFLOW_VERSION_WID = Internal.createIndex("wid", WorkflowVersion.WORKFLOW_VERSION, new OrderField[] { WorkflowVersion.WORKFLOW_VERSION.WID }, false);
- public static Index WORKFLOW_VIEW_COUNT_PRIMARY = Internal.createIndex("PRIMARY", WorkflowViewCount.WORKFLOW_VIEW_COUNT, new OrderField[] { WorkflowViewCount.WORKFLOW_VIEW_COUNT.WID }, true);
- }
-}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Keys.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Keys.java
index c2def618e62..093fb4c2480 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Keys.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Keys.java
@@ -48,162 +48,78 @@
import edu.uci.ics.texera.dao.jooq.generated.tables.records.WorkflowViewCountRecord;
import org.jooq.ForeignKey;
-import org.jooq.Identity;
+import org.jooq.TableField;
import org.jooq.UniqueKey;
+import org.jooq.impl.DSL;
import org.jooq.impl.Internal;
-import org.jooq.types.UInteger;
/**
- * A class modelling foreign key relationships and constraints of tables of
- * the texera_db
schema.
+ * A class modelling foreign key relationships and constraints of tables in
+ * texera_db.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Keys {
- // -------------------------------------------------------------------------
- // IDENTITY definitions
- // -------------------------------------------------------------------------
-
- public static final Identity IDENTITY_DATASET = Identities0.IDENTITY_DATASET;
- public static final Identity IDENTITY_DATASET_VERSION = Identities0.IDENTITY_DATASET_VERSION;
- public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT;
- public static final Identity IDENTITY_USER = Identities0.IDENTITY_USER;
- public static final Identity IDENTITY_WORKFLOW = Identities0.IDENTITY_WORKFLOW;
- public static final Identity IDENTITY_WORKFLOW_EXECUTIONS = Identities0.IDENTITY_WORKFLOW_EXECUTIONS;
- public static final Identity IDENTITY_WORKFLOW_VERSION = Identities0.IDENTITY_WORKFLOW_VERSION;
-
// -------------------------------------------------------------------------
// UNIQUE and PRIMARY KEY definitions
// -------------------------------------------------------------------------
- public static final UniqueKey KEY_DATASET_PRIMARY = UniqueKeys0.KEY_DATASET_PRIMARY;
- public static final UniqueKey KEY_DATASET_USER_ACCESS_PRIMARY = UniqueKeys0.KEY_DATASET_USER_ACCESS_PRIMARY;
- public static final UniqueKey KEY_DATASET_USER_LIKES_PRIMARY = UniqueKeys0.KEY_DATASET_USER_LIKES_PRIMARY;
- public static final UniqueKey KEY_DATASET_VERSION_PRIMARY = UniqueKeys0.KEY_DATASET_VERSION_PRIMARY;
- public static final UniqueKey KEY_DATASET_VIEW_COUNT_PRIMARY = UniqueKeys0.KEY_DATASET_VIEW_COUNT_PRIMARY;
- public static final UniqueKey KEY_OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID = UniqueKeys0.KEY_OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID;
- public static final UniqueKey KEY_OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID = UniqueKeys0.KEY_OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID;
- public static final UniqueKey KEY_PROJECT_PRIMARY = UniqueKeys0.KEY_PROJECT_PRIMARY;
- public static final UniqueKey KEY_PROJECT_OWNER_ID = UniqueKeys0.KEY_PROJECT_OWNER_ID;
- public static final UniqueKey KEY_PROJECT_USER_ACCESS_PRIMARY = UniqueKeys0.KEY_PROJECT_USER_ACCESS_PRIMARY;
- public static final UniqueKey KEY_PUBLIC_PROJECT_PRIMARY = UniqueKeys0.KEY_PUBLIC_PROJECT_PRIMARY;
- public static final UniqueKey KEY_USER_PRIMARY = UniqueKeys0.KEY_USER_PRIMARY;
- public static final UniqueKey KEY_USER_EMAIL = UniqueKeys0.KEY_USER_EMAIL;
- public static final UniqueKey KEY_USER_GOOGLE_ID = UniqueKeys0.KEY_USER_GOOGLE_ID;
- public static final UniqueKey KEY_USER_CONFIG_PRIMARY = UniqueKeys0.KEY_USER_CONFIG_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_PRIMARY = UniqueKeys0.KEY_WORKFLOW_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_EXECUTIONS_PRIMARY = UniqueKeys0.KEY_WORKFLOW_EXECUTIONS_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_OF_PROJECT_PRIMARY = UniqueKeys0.KEY_WORKFLOW_OF_PROJECT_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_OF_USER_PRIMARY = UniqueKeys0.KEY_WORKFLOW_OF_USER_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_USER_ACCESS_PRIMARY = UniqueKeys0.KEY_WORKFLOW_USER_ACCESS_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_USER_CLONES_PRIMARY = UniqueKeys0.KEY_WORKFLOW_USER_CLONES_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_USER_LIKES_PRIMARY = UniqueKeys0.KEY_WORKFLOW_USER_LIKES_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_VERSION_PRIMARY = UniqueKeys0.KEY_WORKFLOW_VERSION_PRIMARY;
- public static final UniqueKey KEY_WORKFLOW_VIEW_COUNT_PRIMARY = UniqueKeys0.KEY_WORKFLOW_VIEW_COUNT_PRIMARY;
+ public static final UniqueKey DATASET_PKEY = Internal.createUniqueKey(Dataset.DATASET, DSL.name("dataset_pkey"), new TableField[] { Dataset.DATASET.DID }, true);
+ public static final UniqueKey DATASET_USER_ACCESS_PKEY = Internal.createUniqueKey(DatasetUserAccess.DATASET_USER_ACCESS, DSL.name("dataset_user_access_pkey"), new TableField[] { DatasetUserAccess.DATASET_USER_ACCESS.DID, DatasetUserAccess.DATASET_USER_ACCESS.UID }, true);
+ public static final UniqueKey DATASET_USER_LIKES_PKEY = Internal.createUniqueKey(DatasetUserLikes.DATASET_USER_LIKES, DSL.name("dataset_user_likes_pkey"), new TableField[] { DatasetUserLikes.DATASET_USER_LIKES.UID, DatasetUserLikes.DATASET_USER_LIKES.DID }, true);
+ public static final UniqueKey DATASET_VERSION_PKEY = Internal.createUniqueKey(DatasetVersion.DATASET_VERSION, DSL.name("dataset_version_pkey"), new TableField[] { DatasetVersion.DATASET_VERSION.DVID }, true);
+ public static final UniqueKey DATASET_VIEW_COUNT_PKEY = Internal.createUniqueKey(DatasetViewCount.DATASET_VIEW_COUNT, DSL.name("dataset_view_count_pkey"), new TableField[] { DatasetViewCount.DATASET_VIEW_COUNT.DID }, true);
+ public static final UniqueKey OPERATOR_EXECUTIONS_PKEY = Internal.createUniqueKey(OperatorExecutions.OPERATOR_EXECUTIONS, DSL.name("operator_executions_pkey"), new TableField[] { OperatorExecutions.OPERATOR_EXECUTIONS.WORKFLOW_EXECUTION_ID, OperatorExecutions.OPERATOR_EXECUTIONS.OPERATOR_ID }, true);
+ public static final UniqueKey OPERATOR_PORT_EXECUTIONS_PKEY = Internal.createUniqueKey(OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS, DSL.name("operator_port_executions_pkey"), new TableField[] { OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.OPERATOR_ID, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.PORT_ID }, true);
+ public static final UniqueKey PROJECT_OWNER_ID_NAME_KEY = Internal.createUniqueKey(Project.PROJECT, DSL.name("project_owner_id_name_key"), new TableField[] { Project.PROJECT.OWNER_ID, Project.PROJECT.NAME }, true);
+ public static final UniqueKey PROJECT_PKEY = Internal.createUniqueKey(Project.PROJECT, DSL.name("project_pkey"), new TableField[] { Project.PROJECT.PID }, true);
+ public static final UniqueKey PROJECT_USER_ACCESS_PKEY = Internal.createUniqueKey(ProjectUserAccess.PROJECT_USER_ACCESS, DSL.name("project_user_access_pkey"), new TableField[] { ProjectUserAccess.PROJECT_USER_ACCESS.UID, ProjectUserAccess.PROJECT_USER_ACCESS.PID }, true);
+ public static final UniqueKey PUBLIC_PROJECT_PKEY = Internal.createUniqueKey(PublicProject.PUBLIC_PROJECT, DSL.name("public_project_pkey"), new TableField[] { PublicProject.PUBLIC_PROJECT.PID }, true);
+ public static final UniqueKey USER_EMAIL_KEY = Internal.createUniqueKey(User.USER, DSL.name("user_email_key"), new TableField[] { User.USER.EMAIL }, true);
+ public static final UniqueKey USER_GOOGLE_ID_KEY = Internal.createUniqueKey(User.USER, DSL.name("user_google_id_key"), new TableField[] { User.USER.GOOGLE_ID }, true);
+ public static final UniqueKey USER_PKEY = Internal.createUniqueKey(User.USER, DSL.name("user_pkey"), new TableField[] { User.USER.UID }, true);
+ public static final UniqueKey USER_CONFIG_PKEY = Internal.createUniqueKey(UserConfig.USER_CONFIG, DSL.name("user_config_pkey"), new TableField[] { UserConfig.USER_CONFIG.UID, UserConfig.USER_CONFIG.KEY }, true);
+ public static final UniqueKey WORKFLOW_PKEY = Internal.createUniqueKey(Workflow.WORKFLOW, DSL.name("workflow_pkey"), new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final UniqueKey WORKFLOW_EXECUTIONS_PKEY = Internal.createUniqueKey(WorkflowExecutions.WORKFLOW_EXECUTIONS, DSL.name("workflow_executions_pkey"), new TableField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.EID }, true);
+ public static final UniqueKey WORKFLOW_OF_PROJECT_PKEY = Internal.createUniqueKey(WorkflowOfProject.WORKFLOW_OF_PROJECT, DSL.name("workflow_of_project_pkey"), new TableField[] { WorkflowOfProject.WORKFLOW_OF_PROJECT.WID, WorkflowOfProject.WORKFLOW_OF_PROJECT.PID }, true);
+ public static final UniqueKey WORKFLOW_OF_USER_PKEY = Internal.createUniqueKey(WorkflowOfUser.WORKFLOW_OF_USER, DSL.name("workflow_of_user_pkey"), new TableField[] { WorkflowOfUser.WORKFLOW_OF_USER.UID, WorkflowOfUser.WORKFLOW_OF_USER.WID }, true);
+ public static final UniqueKey WORKFLOW_USER_ACCESS_PKEY = Internal.createUniqueKey(WorkflowUserAccess.WORKFLOW_USER_ACCESS, DSL.name("workflow_user_access_pkey"), new TableField[] { WorkflowUserAccess.WORKFLOW_USER_ACCESS.UID, WorkflowUserAccess.WORKFLOW_USER_ACCESS.WID }, true);
+ public static final UniqueKey WORKFLOW_USER_CLONES_PKEY = Internal.createUniqueKey(WorkflowUserClones.WORKFLOW_USER_CLONES, DSL.name("workflow_user_clones_pkey"), new TableField[] { WorkflowUserClones.WORKFLOW_USER_CLONES.UID, WorkflowUserClones.WORKFLOW_USER_CLONES.WID }, true);
+ public static final UniqueKey WORKFLOW_USER_LIKES_PKEY = Internal.createUniqueKey(WorkflowUserLikes.WORKFLOW_USER_LIKES, DSL.name("workflow_user_likes_pkey"), new TableField[] { WorkflowUserLikes.WORKFLOW_USER_LIKES.UID, WorkflowUserLikes.WORKFLOW_USER_LIKES.WID }, true);
+ public static final UniqueKey WORKFLOW_VERSION_PKEY = Internal.createUniqueKey(WorkflowVersion.WORKFLOW_VERSION, DSL.name("workflow_version_pkey"), new TableField[] { WorkflowVersion.WORKFLOW_VERSION.VID }, true);
+ public static final UniqueKey WORKFLOW_VIEW_COUNT_PKEY = Internal.createUniqueKey(WorkflowViewCount.WORKFLOW_VIEW_COUNT, DSL.name("workflow_view_count_pkey"), new TableField[] { WorkflowViewCount.WORKFLOW_VIEW_COUNT.WID }, true);
// -------------------------------------------------------------------------
// FOREIGN KEY definitions
// -------------------------------------------------------------------------
- public static final ForeignKey DATASET_IBFK_1 = ForeignKeys0.DATASET_IBFK_1;
- public static final ForeignKey DATASET_USER_ACCESS_IBFK_1 = ForeignKeys0.DATASET_USER_ACCESS_IBFK_1;
- public static final ForeignKey DATASET_USER_ACCESS_IBFK_2 = ForeignKeys0.DATASET_USER_ACCESS_IBFK_2;
- public static final ForeignKey DATASET_USER_LIKES_IBFK_1 = ForeignKeys0.DATASET_USER_LIKES_IBFK_1;
- public static final ForeignKey DATASET_USER_LIKES_IBFK_2 = ForeignKeys0.DATASET_USER_LIKES_IBFK_2;
- public static final ForeignKey DATASET_VERSION_IBFK_1 = ForeignKeys0.DATASET_VERSION_IBFK_1;
- public static final ForeignKey DATASET_VIEW_COUNT_IBFK_1 = ForeignKeys0.DATASET_VIEW_COUNT_IBFK_1;
- public static final ForeignKey OPERATOR_EXECUTIONS_IBFK_1 = ForeignKeys0.OPERATOR_EXECUTIONS_IBFK_1;
- public static final ForeignKey OPERATOR_PORT_EXECUTIONS_IBFK_1 = ForeignKeys0.OPERATOR_PORT_EXECUTIONS_IBFK_1;
- public static final ForeignKey PROJECT_IBFK_1 = ForeignKeys0.PROJECT_IBFK_1;
- public static final ForeignKey PROJECT_USER_ACCESS_IBFK_1 = ForeignKeys0.PROJECT_USER_ACCESS_IBFK_1;
- public static final ForeignKey PROJECT_USER_ACCESS_IBFK_2 = ForeignKeys0.PROJECT_USER_ACCESS_IBFK_2;
- public static final ForeignKey PUBLIC_PROJECT_IBFK_1 = ForeignKeys0.PUBLIC_PROJECT_IBFK_1;
- public static final ForeignKey USER_CONFIG_IBFK_1 = ForeignKeys0.USER_CONFIG_IBFK_1;
- public static final ForeignKey WORKFLOW_EXECUTIONS_IBFK_1 = ForeignKeys0.WORKFLOW_EXECUTIONS_IBFK_1;
- public static final ForeignKey WORKFLOW_EXECUTIONS_IBFK_2 = ForeignKeys0.WORKFLOW_EXECUTIONS_IBFK_2;
- public static final ForeignKey WORKFLOW_OF_PROJECT_IBFK_1 = ForeignKeys0.WORKFLOW_OF_PROJECT_IBFK_1;
- public static final ForeignKey WORKFLOW_OF_PROJECT_IBFK_2 = ForeignKeys0.WORKFLOW_OF_PROJECT_IBFK_2;
- public static final ForeignKey WORKFLOW_OF_USER_IBFK_1 = ForeignKeys0.WORKFLOW_OF_USER_IBFK_1;
- public static final ForeignKey WORKFLOW_OF_USER_IBFK_2 = ForeignKeys0.WORKFLOW_OF_USER_IBFK_2;
- public static final ForeignKey WORKFLOW_USER_ACCESS_IBFK_1 = ForeignKeys0.WORKFLOW_USER_ACCESS_IBFK_1;
- public static final ForeignKey WORKFLOW_USER_ACCESS_IBFK_2 = ForeignKeys0.WORKFLOW_USER_ACCESS_IBFK_2;
- public static final ForeignKey WORKFLOW_USER_CLONES_IBFK_1 = ForeignKeys0.WORKFLOW_USER_CLONES_IBFK_1;
- public static final ForeignKey WORKFLOW_USER_CLONES_IBFK_2 = ForeignKeys0.WORKFLOW_USER_CLONES_IBFK_2;
- public static final ForeignKey WORKFLOW_USER_LIKES_IBFK_1 = ForeignKeys0.WORKFLOW_USER_LIKES_IBFK_1;
- public static final ForeignKey WORKFLOW_USER_LIKES_IBFK_2 = ForeignKeys0.WORKFLOW_USER_LIKES_IBFK_2;
- public static final ForeignKey WORKFLOW_VERSION_IBFK_1 = ForeignKeys0.WORKFLOW_VERSION_IBFK_1;
- public static final ForeignKey WORKFLOW_VIEW_COUNT_IBFK_1 = ForeignKeys0.WORKFLOW_VIEW_COUNT_IBFK_1;
-
- // -------------------------------------------------------------------------
- // [#1459] distribute members to avoid static initialisers > 64kb
- // -------------------------------------------------------------------------
-
- private static class Identities0 {
- public static Identity IDENTITY_DATASET = Internal.createIdentity(Dataset.DATASET, Dataset.DATASET.DID);
- public static Identity IDENTITY_DATASET_VERSION = Internal.createIdentity(DatasetVersion.DATASET_VERSION, DatasetVersion.DATASET_VERSION.DVID);
- public static Identity IDENTITY_PROJECT = Internal.createIdentity(Project.PROJECT, Project.PROJECT.PID);
- public static Identity IDENTITY_USER = Internal.createIdentity(User.USER, User.USER.UID);
- public static Identity IDENTITY_WORKFLOW = Internal.createIdentity(Workflow.WORKFLOW, Workflow.WORKFLOW.WID);
- public static Identity IDENTITY_WORKFLOW_EXECUTIONS = Internal.createIdentity(WorkflowExecutions.WORKFLOW_EXECUTIONS, WorkflowExecutions.WORKFLOW_EXECUTIONS.EID);
- public static Identity IDENTITY_WORKFLOW_VERSION = Internal.createIdentity(WorkflowVersion.WORKFLOW_VERSION, WorkflowVersion.WORKFLOW_VERSION.VID);
- }
-
- private static class UniqueKeys0 {
- public static final UniqueKey KEY_DATASET_PRIMARY = Internal.createUniqueKey(Dataset.DATASET, "KEY_dataset_PRIMARY", Dataset.DATASET.DID);
- public static final UniqueKey KEY_DATASET_USER_ACCESS_PRIMARY = Internal.createUniqueKey(DatasetUserAccess.DATASET_USER_ACCESS, "KEY_dataset_user_access_PRIMARY", DatasetUserAccess.DATASET_USER_ACCESS.DID, DatasetUserAccess.DATASET_USER_ACCESS.UID);
- public static final UniqueKey KEY_DATASET_USER_LIKES_PRIMARY = Internal.createUniqueKey(DatasetUserLikes.DATASET_USER_LIKES, "KEY_dataset_user_likes_PRIMARY", DatasetUserLikes.DATASET_USER_LIKES.UID, DatasetUserLikes.DATASET_USER_LIKES.DID);
- public static final UniqueKey KEY_DATASET_VERSION_PRIMARY = Internal.createUniqueKey(DatasetVersion.DATASET_VERSION, "KEY_dataset_version_PRIMARY", DatasetVersion.DATASET_VERSION.DVID);
- public static final UniqueKey KEY_DATASET_VIEW_COUNT_PRIMARY = Internal.createUniqueKey(DatasetViewCount.DATASET_VIEW_COUNT, "KEY_dataset_view_count_PRIMARY", DatasetViewCount.DATASET_VIEW_COUNT.DID);
- public static final UniqueKey KEY_OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID = Internal.createUniqueKey(OperatorExecutions.OPERATOR_EXECUTIONS, "KEY_operator_executions_workflow_execution_id", OperatorExecutions.OPERATOR_EXECUTIONS.WORKFLOW_EXECUTION_ID, OperatorExecutions.OPERATOR_EXECUTIONS.OPERATOR_ID);
- public static final UniqueKey KEY_OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID = Internal.createUniqueKey(OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS, "KEY_operator_port_executions_workflow_execution_id", OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.OPERATOR_ID, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.PORT_ID);
- public static final UniqueKey KEY_PROJECT_PRIMARY = Internal.createUniqueKey(Project.PROJECT, "KEY_project_PRIMARY", Project.PROJECT.PID);
- public static final UniqueKey KEY_PROJECT_OWNER_ID = Internal.createUniqueKey(Project.PROJECT, "KEY_project_owner_id", Project.PROJECT.OWNER_ID, Project.PROJECT.NAME);
- public static final UniqueKey KEY_PROJECT_USER_ACCESS_PRIMARY = Internal.createUniqueKey(ProjectUserAccess.PROJECT_USER_ACCESS, "KEY_project_user_access_PRIMARY", ProjectUserAccess.PROJECT_USER_ACCESS.UID, ProjectUserAccess.PROJECT_USER_ACCESS.PID);
- public static final UniqueKey KEY_PUBLIC_PROJECT_PRIMARY = Internal.createUniqueKey(PublicProject.PUBLIC_PROJECT, "KEY_public_project_PRIMARY", PublicProject.PUBLIC_PROJECT.PID);
- public static final UniqueKey KEY_USER_PRIMARY = Internal.createUniqueKey(User.USER, "KEY_user_PRIMARY", User.USER.UID);
- public static final UniqueKey KEY_USER_EMAIL = Internal.createUniqueKey(User.USER, "KEY_user_email", User.USER.EMAIL);
- public static final UniqueKey KEY_USER_GOOGLE_ID = Internal.createUniqueKey(User.USER, "KEY_user_google_id", User.USER.GOOGLE_ID);
- public static final UniqueKey KEY_USER_CONFIG_PRIMARY = Internal.createUniqueKey(UserConfig.USER_CONFIG, "KEY_user_config_PRIMARY", UserConfig.USER_CONFIG.UID, UserConfig.USER_CONFIG.KEY);
- public static final UniqueKey KEY_WORKFLOW_PRIMARY = Internal.createUniqueKey(Workflow.WORKFLOW, "KEY_workflow_PRIMARY", Workflow.WORKFLOW.WID);
- public static final UniqueKey KEY_WORKFLOW_EXECUTIONS_PRIMARY = Internal.createUniqueKey(WorkflowExecutions.WORKFLOW_EXECUTIONS, "KEY_workflow_executions_PRIMARY", WorkflowExecutions.WORKFLOW_EXECUTIONS.EID);
- public static final UniqueKey KEY_WORKFLOW_OF_PROJECT_PRIMARY = Internal.createUniqueKey(WorkflowOfProject.WORKFLOW_OF_PROJECT, "KEY_workflow_of_project_PRIMARY", WorkflowOfProject.WORKFLOW_OF_PROJECT.WID, WorkflowOfProject.WORKFLOW_OF_PROJECT.PID);
- public static final UniqueKey KEY_WORKFLOW_OF_USER_PRIMARY = Internal.createUniqueKey(WorkflowOfUser.WORKFLOW_OF_USER, "KEY_workflow_of_user_PRIMARY", WorkflowOfUser.WORKFLOW_OF_USER.UID, WorkflowOfUser.WORKFLOW_OF_USER.WID);
- public static final UniqueKey KEY_WORKFLOW_USER_ACCESS_PRIMARY = Internal.createUniqueKey(WorkflowUserAccess.WORKFLOW_USER_ACCESS, "KEY_workflow_user_access_PRIMARY", WorkflowUserAccess.WORKFLOW_USER_ACCESS.UID, WorkflowUserAccess.WORKFLOW_USER_ACCESS.WID);
- public static final UniqueKey KEY_WORKFLOW_USER_CLONES_PRIMARY = Internal.createUniqueKey(WorkflowUserClones.WORKFLOW_USER_CLONES, "KEY_workflow_user_clones_PRIMARY", WorkflowUserClones.WORKFLOW_USER_CLONES.UID, WorkflowUserClones.WORKFLOW_USER_CLONES.WID);
- public static final UniqueKey KEY_WORKFLOW_USER_LIKES_PRIMARY = Internal.createUniqueKey(WorkflowUserLikes.WORKFLOW_USER_LIKES, "KEY_workflow_user_likes_PRIMARY", WorkflowUserLikes.WORKFLOW_USER_LIKES.UID, WorkflowUserLikes.WORKFLOW_USER_LIKES.WID);
- public static final UniqueKey KEY_WORKFLOW_VERSION_PRIMARY = Internal.createUniqueKey(WorkflowVersion.WORKFLOW_VERSION, "KEY_workflow_version_PRIMARY", WorkflowVersion.WORKFLOW_VERSION.VID);
- public static final UniqueKey KEY_WORKFLOW_VIEW_COUNT_PRIMARY = Internal.createUniqueKey(WorkflowViewCount.WORKFLOW_VIEW_COUNT, "KEY_workflow_view_count_PRIMARY", WorkflowViewCount.WORKFLOW_VIEW_COUNT.WID);
- }
-
- private static class ForeignKeys0 {
- public static final ForeignKey DATASET_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, Dataset.DATASET, "dataset_ibfk_1", Dataset.DATASET.OWNER_UID);
- public static final ForeignKey DATASET_USER_ACCESS_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_DATASET_PRIMARY, DatasetUserAccess.DATASET_USER_ACCESS, "dataset_user_access_ibfk_1", DatasetUserAccess.DATASET_USER_ACCESS.DID);
- public static final ForeignKey DATASET_USER_ACCESS_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, DatasetUserAccess.DATASET_USER_ACCESS, "dataset_user_access_ibfk_2", DatasetUserAccess.DATASET_USER_ACCESS.UID);
- public static final ForeignKey DATASET_USER_LIKES_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, DatasetUserLikes.DATASET_USER_LIKES, "dataset_user_likes_ibfk_1", DatasetUserLikes.DATASET_USER_LIKES.UID);
- public static final ForeignKey DATASET_USER_LIKES_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_DATASET_PRIMARY, DatasetUserLikes.DATASET_USER_LIKES, "dataset_user_likes_ibfk_2", DatasetUserLikes.DATASET_USER_LIKES.DID);
- public static final ForeignKey DATASET_VERSION_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_DATASET_PRIMARY, DatasetVersion.DATASET_VERSION, "dataset_version_ibfk_1", DatasetVersion.DATASET_VERSION.DID);
- public static final ForeignKey DATASET_VIEW_COUNT_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_DATASET_PRIMARY, DatasetViewCount.DATASET_VIEW_COUNT, "dataset_view_count_ibfk_1", DatasetViewCount.DATASET_VIEW_COUNT.DID);
- public static final ForeignKey OPERATOR_EXECUTIONS_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_EXECUTIONS_PRIMARY, OperatorExecutions.OPERATOR_EXECUTIONS, "operator_executions_ibfk_1", OperatorExecutions.OPERATOR_EXECUTIONS.WORKFLOW_EXECUTION_ID);
- public static final ForeignKey OPERATOR_PORT_EXECUTIONS_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_EXECUTIONS_PRIMARY, OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS, "operator_port_executions_ibfk_1", OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID);
- public static final ForeignKey PROJECT_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, Project.PROJECT, "project_ibfk_1", Project.PROJECT.OWNER_ID);
- public static final ForeignKey PROJECT_USER_ACCESS_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, ProjectUserAccess.PROJECT_USER_ACCESS, "project_user_access_ibfk_1", ProjectUserAccess.PROJECT_USER_ACCESS.UID);
- public static final ForeignKey PROJECT_USER_ACCESS_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_PROJECT_PRIMARY, ProjectUserAccess.PROJECT_USER_ACCESS, "project_user_access_ibfk_2", ProjectUserAccess.PROJECT_USER_ACCESS.PID);
- public static final ForeignKey PUBLIC_PROJECT_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_PROJECT_PRIMARY, PublicProject.PUBLIC_PROJECT, "public_project_ibfk_1", PublicProject.PUBLIC_PROJECT.PID);
- public static final ForeignKey USER_CONFIG_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, UserConfig.USER_CONFIG, "user_config_ibfk_1", UserConfig.USER_CONFIG.UID);
- public static final ForeignKey WORKFLOW_EXECUTIONS_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_VERSION_PRIMARY, WorkflowExecutions.WORKFLOW_EXECUTIONS, "workflow_executions_ibfk_1", WorkflowExecutions.WORKFLOW_EXECUTIONS.VID);
- public static final ForeignKey WORKFLOW_EXECUTIONS_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, WorkflowExecutions.WORKFLOW_EXECUTIONS, "workflow_executions_ibfk_2", WorkflowExecutions.WORKFLOW_EXECUTIONS.UID);
- public static final ForeignKey WORKFLOW_OF_PROJECT_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowOfProject.WORKFLOW_OF_PROJECT, "workflow_of_project_ibfk_1", WorkflowOfProject.WORKFLOW_OF_PROJECT.WID);
- public static final ForeignKey WORKFLOW_OF_PROJECT_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_PROJECT_PRIMARY, WorkflowOfProject.WORKFLOW_OF_PROJECT, "workflow_of_project_ibfk_2", WorkflowOfProject.WORKFLOW_OF_PROJECT.PID);
- public static final ForeignKey WORKFLOW_OF_USER_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, WorkflowOfUser.WORKFLOW_OF_USER, "workflow_of_user_ibfk_1", WorkflowOfUser.WORKFLOW_OF_USER.UID);
- public static final ForeignKey WORKFLOW_OF_USER_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowOfUser.WORKFLOW_OF_USER, "workflow_of_user_ibfk_2", WorkflowOfUser.WORKFLOW_OF_USER.WID);
- public static final ForeignKey WORKFLOW_USER_ACCESS_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, WorkflowUserAccess.WORKFLOW_USER_ACCESS, "workflow_user_access_ibfk_1", WorkflowUserAccess.WORKFLOW_USER_ACCESS.UID);
- public static final ForeignKey WORKFLOW_USER_ACCESS_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowUserAccess.WORKFLOW_USER_ACCESS, "workflow_user_access_ibfk_2", WorkflowUserAccess.WORKFLOW_USER_ACCESS.WID);
- public static final ForeignKey WORKFLOW_USER_CLONES_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, WorkflowUserClones.WORKFLOW_USER_CLONES, "workflow_user_clones_ibfk_1", WorkflowUserClones.WORKFLOW_USER_CLONES.UID);
- public static final ForeignKey WORKFLOW_USER_CLONES_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowUserClones.WORKFLOW_USER_CLONES, "workflow_user_clones_ibfk_2", WorkflowUserClones.WORKFLOW_USER_CLONES.WID);
- public static final ForeignKey WORKFLOW_USER_LIKES_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_USER_PRIMARY, WorkflowUserLikes.WORKFLOW_USER_LIKES, "workflow_user_likes_ibfk_1", WorkflowUserLikes.WORKFLOW_USER_LIKES.UID);
- public static final ForeignKey WORKFLOW_USER_LIKES_IBFK_2 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowUserLikes.WORKFLOW_USER_LIKES, "workflow_user_likes_ibfk_2", WorkflowUserLikes.WORKFLOW_USER_LIKES.WID);
- public static final ForeignKey WORKFLOW_VERSION_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowVersion.WORKFLOW_VERSION, "workflow_version_ibfk_1", WorkflowVersion.WORKFLOW_VERSION.WID);
- public static final ForeignKey WORKFLOW_VIEW_COUNT_IBFK_1 = Internal.createForeignKey(edu.uci.ics.texera.dao.jooq.generated.Keys.KEY_WORKFLOW_PRIMARY, WorkflowViewCount.WORKFLOW_VIEW_COUNT, "workflow_view_count_ibfk_1", WorkflowViewCount.WORKFLOW_VIEW_COUNT.WID);
- }
+ public static final ForeignKey DATASET__DATASET_OWNER_UID_FKEY = Internal.createForeignKey(Dataset.DATASET, DSL.name("dataset_owner_uid_fkey"), new TableField[] { Dataset.DATASET.OWNER_UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey DATASET_USER_ACCESS__DATASET_USER_ACCESS_DID_FKEY = Internal.createForeignKey(DatasetUserAccess.DATASET_USER_ACCESS, DSL.name("dataset_user_access_did_fkey"), new TableField[] { DatasetUserAccess.DATASET_USER_ACCESS.DID }, Keys.DATASET_PKEY, new TableField[] { Dataset.DATASET.DID }, true);
+ public static final ForeignKey DATASET_USER_ACCESS__DATASET_USER_ACCESS_UID_FKEY = Internal.createForeignKey(DatasetUserAccess.DATASET_USER_ACCESS, DSL.name("dataset_user_access_uid_fkey"), new TableField[] { DatasetUserAccess.DATASET_USER_ACCESS.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey DATASET_USER_LIKES__DATASET_USER_LIKES_DID_FKEY = Internal.createForeignKey(DatasetUserLikes.DATASET_USER_LIKES, DSL.name("dataset_user_likes_did_fkey"), new TableField[] { DatasetUserLikes.DATASET_USER_LIKES.DID }, Keys.DATASET_PKEY, new TableField[] { Dataset.DATASET.DID }, true);
+ public static final ForeignKey DATASET_USER_LIKES__DATASET_USER_LIKES_UID_FKEY = Internal.createForeignKey(DatasetUserLikes.DATASET_USER_LIKES, DSL.name("dataset_user_likes_uid_fkey"), new TableField[] { DatasetUserLikes.DATASET_USER_LIKES.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey DATASET_VERSION__DATASET_VERSION_DID_FKEY = Internal.createForeignKey(DatasetVersion.DATASET_VERSION, DSL.name("dataset_version_did_fkey"), new TableField[] { DatasetVersion.DATASET_VERSION.DID }, Keys.DATASET_PKEY, new TableField[] { Dataset.DATASET.DID }, true);
+ public static final ForeignKey DATASET_VIEW_COUNT__DATASET_VIEW_COUNT_DID_FKEY = Internal.createForeignKey(DatasetViewCount.DATASET_VIEW_COUNT, DSL.name("dataset_view_count_did_fkey"), new TableField[] { DatasetViewCount.DATASET_VIEW_COUNT.DID }, Keys.DATASET_PKEY, new TableField[] { Dataset.DATASET.DID }, true);
+ public static final ForeignKey OPERATOR_EXECUTIONS__OPERATOR_EXECUTIONS_WORKFLOW_EXECUTION_ID_FKEY = Internal.createForeignKey(OperatorExecutions.OPERATOR_EXECUTIONS, DSL.name("operator_executions_workflow_execution_id_fkey"), new TableField[] { OperatorExecutions.OPERATOR_EXECUTIONS.WORKFLOW_EXECUTION_ID }, Keys.WORKFLOW_EXECUTIONS_PKEY, new TableField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.EID }, true);
+ public static final ForeignKey OPERATOR_PORT_EXECUTIONS__OPERATOR_PORT_EXECUTIONS_WORKFLOW_EXECUTION_ID_FKEY = Internal.createForeignKey(OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS, DSL.name("operator_port_executions_workflow_execution_id_fkey"), new TableField[] { OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID }, Keys.WORKFLOW_EXECUTIONS_PKEY, new TableField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.EID }, true);
+ public static final ForeignKey PROJECT__PROJECT_OWNER_ID_FKEY = Internal.createForeignKey(Project.PROJECT, DSL.name("project_owner_id_fkey"), new TableField[] { Project.PROJECT.OWNER_ID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey PROJECT_USER_ACCESS__PROJECT_USER_ACCESS_PID_FKEY = Internal.createForeignKey(ProjectUserAccess.PROJECT_USER_ACCESS, DSL.name("project_user_access_pid_fkey"), new TableField[] { ProjectUserAccess.PROJECT_USER_ACCESS.PID }, Keys.PROJECT_PKEY, new TableField[] { Project.PROJECT.PID }, true);
+ public static final ForeignKey PROJECT_USER_ACCESS__PROJECT_USER_ACCESS_UID_FKEY = Internal.createForeignKey(ProjectUserAccess.PROJECT_USER_ACCESS, DSL.name("project_user_access_uid_fkey"), new TableField[] { ProjectUserAccess.PROJECT_USER_ACCESS.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey PUBLIC_PROJECT__PUBLIC_PROJECT_PID_FKEY = Internal.createForeignKey(PublicProject.PUBLIC_PROJECT, DSL.name("public_project_pid_fkey"), new TableField[] { PublicProject.PUBLIC_PROJECT.PID }, Keys.PROJECT_PKEY, new TableField[] { Project.PROJECT.PID }, true);
+ public static final ForeignKey USER_CONFIG__USER_CONFIG_UID_FKEY = Internal.createForeignKey(UserConfig.USER_CONFIG, DSL.name("user_config_uid_fkey"), new TableField[] { UserConfig.USER_CONFIG.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey WORKFLOW_EXECUTIONS__WORKFLOW_EXECUTIONS_UID_FKEY = Internal.createForeignKey(WorkflowExecutions.WORKFLOW_EXECUTIONS, DSL.name("workflow_executions_uid_fkey"), new TableField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey WORKFLOW_EXECUTIONS__WORKFLOW_EXECUTIONS_VID_FKEY = Internal.createForeignKey(WorkflowExecutions.WORKFLOW_EXECUTIONS, DSL.name("workflow_executions_vid_fkey"), new TableField[] { WorkflowExecutions.WORKFLOW_EXECUTIONS.VID }, Keys.WORKFLOW_VERSION_PKEY, new TableField[] { WorkflowVersion.WORKFLOW_VERSION.VID }, true);
+ public static final ForeignKey WORKFLOW_OF_PROJECT__WORKFLOW_OF_PROJECT_PID_FKEY = Internal.createForeignKey(WorkflowOfProject.WORKFLOW_OF_PROJECT, DSL.name("workflow_of_project_pid_fkey"), new TableField[] { WorkflowOfProject.WORKFLOW_OF_PROJECT.PID }, Keys.PROJECT_PKEY, new TableField[] { Project.PROJECT.PID }, true);
+ public static final ForeignKey WORKFLOW_OF_PROJECT__WORKFLOW_OF_PROJECT_WID_FKEY = Internal.createForeignKey(WorkflowOfProject.WORKFLOW_OF_PROJECT, DSL.name("workflow_of_project_wid_fkey"), new TableField[] { WorkflowOfProject.WORKFLOW_OF_PROJECT.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final ForeignKey WORKFLOW_OF_USER__WORKFLOW_OF_USER_UID_FKEY = Internal.createForeignKey(WorkflowOfUser.WORKFLOW_OF_USER, DSL.name("workflow_of_user_uid_fkey"), new TableField[] { WorkflowOfUser.WORKFLOW_OF_USER.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey WORKFLOW_OF_USER__WORKFLOW_OF_USER_WID_FKEY = Internal.createForeignKey(WorkflowOfUser.WORKFLOW_OF_USER, DSL.name("workflow_of_user_wid_fkey"), new TableField[] { WorkflowOfUser.WORKFLOW_OF_USER.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final ForeignKey WORKFLOW_USER_ACCESS__WORKFLOW_USER_ACCESS_UID_FKEY = Internal.createForeignKey(WorkflowUserAccess.WORKFLOW_USER_ACCESS, DSL.name("workflow_user_access_uid_fkey"), new TableField[] { WorkflowUserAccess.WORKFLOW_USER_ACCESS.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey WORKFLOW_USER_ACCESS__WORKFLOW_USER_ACCESS_WID_FKEY = Internal.createForeignKey(WorkflowUserAccess.WORKFLOW_USER_ACCESS, DSL.name("workflow_user_access_wid_fkey"), new TableField[] { WorkflowUserAccess.WORKFLOW_USER_ACCESS.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final ForeignKey WORKFLOW_USER_CLONES__WORKFLOW_USER_CLONES_UID_FKEY = Internal.createForeignKey(WorkflowUserClones.WORKFLOW_USER_CLONES, DSL.name("workflow_user_clones_uid_fkey"), new TableField[] { WorkflowUserClones.WORKFLOW_USER_CLONES.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey WORKFLOW_USER_CLONES__WORKFLOW_USER_CLONES_WID_FKEY = Internal.createForeignKey(WorkflowUserClones.WORKFLOW_USER_CLONES, DSL.name("workflow_user_clones_wid_fkey"), new TableField[] { WorkflowUserClones.WORKFLOW_USER_CLONES.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final ForeignKey WORKFLOW_USER_LIKES__WORKFLOW_USER_LIKES_UID_FKEY = Internal.createForeignKey(WorkflowUserLikes.WORKFLOW_USER_LIKES, DSL.name("workflow_user_likes_uid_fkey"), new TableField[] { WorkflowUserLikes.WORKFLOW_USER_LIKES.UID }, Keys.USER_PKEY, new TableField[] { User.USER.UID }, true);
+ public static final ForeignKey WORKFLOW_USER_LIKES__WORKFLOW_USER_LIKES_WID_FKEY = Internal.createForeignKey(WorkflowUserLikes.WORKFLOW_USER_LIKES, DSL.name("workflow_user_likes_wid_fkey"), new TableField[] { WorkflowUserLikes.WORKFLOW_USER_LIKES.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final ForeignKey WORKFLOW_VERSION__WORKFLOW_VERSION_WID_FKEY = Internal.createForeignKey(WorkflowVersion.WORKFLOW_VERSION, DSL.name("workflow_version_wid_fkey"), new TableField[] { WorkflowVersion.WORKFLOW_VERSION.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
+ public static final ForeignKey WORKFLOW_VIEW_COUNT__WORKFLOW_VIEW_COUNT_WID_FKEY = Internal.createForeignKey(WorkflowViewCount.WORKFLOW_VIEW_COUNT, DSL.name("workflow_view_count_wid_fkey"), new TableField[] { WorkflowViewCount.WORKFLOW_VIEW_COUNT.WID }, Keys.WORKFLOW_PKEY, new TableField[] { Workflow.WORKFLOW.WID }, true);
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Tables.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Tables.java
index b8385eca46f..02dbcb77bcf 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Tables.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/Tables.java
@@ -29,7 +29,7 @@
/**
- * Convenience access to all tables in texera_db
+ * Convenience access to all tables in texera_db.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Tables {
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/TexeraDb.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/TexeraDb.java
index e6eb7f34115..f67b14ca734 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/TexeraDb.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/TexeraDb.java
@@ -27,7 +27,6 @@
import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowVersion;
import edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowViewCount;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -42,7 +41,7 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TexeraDb extends SchemaImpl {
- private static final long serialVersionUID = -590590918;
+ private static final long serialVersionUID = 1L;
/**
* The reference instance of texera_db
@@ -52,112 +51,112 @@ public class TexeraDb extends SchemaImpl {
/**
* The table texera_db.dataset
.
*/
- public final Dataset DATASET = edu.uci.ics.texera.dao.jooq.generated.tables.Dataset.DATASET;
+ public final Dataset DATASET = Dataset.DATASET;
/**
* The table texera_db.dataset_user_access
.
*/
- public final DatasetUserAccess DATASET_USER_ACCESS = edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserAccess.DATASET_USER_ACCESS;
+ public final DatasetUserAccess DATASET_USER_ACCESS = DatasetUserAccess.DATASET_USER_ACCESS;
/**
* The table texera_db.dataset_user_likes
.
*/
- public final DatasetUserLikes DATASET_USER_LIKES = edu.uci.ics.texera.dao.jooq.generated.tables.DatasetUserLikes.DATASET_USER_LIKES;
+ public final DatasetUserLikes DATASET_USER_LIKES = DatasetUserLikes.DATASET_USER_LIKES;
/**
* The table texera_db.dataset_version
.
*/
- public final DatasetVersion DATASET_VERSION = edu.uci.ics.texera.dao.jooq.generated.tables.DatasetVersion.DATASET_VERSION;
+ public final DatasetVersion DATASET_VERSION = DatasetVersion.DATASET_VERSION;
/**
* The table texera_db.dataset_view_count
.
*/
- public final DatasetViewCount DATASET_VIEW_COUNT = edu.uci.ics.texera.dao.jooq.generated.tables.DatasetViewCount.DATASET_VIEW_COUNT;
+ public final DatasetViewCount DATASET_VIEW_COUNT = DatasetViewCount.DATASET_VIEW_COUNT;
/**
* The table texera_db.operator_executions
.
*/
- public final OperatorExecutions OPERATOR_EXECUTIONS = edu.uci.ics.texera.dao.jooq.generated.tables.OperatorExecutions.OPERATOR_EXECUTIONS;
+ public final OperatorExecutions OPERATOR_EXECUTIONS = OperatorExecutions.OPERATOR_EXECUTIONS;
/**
* The table texera_db.operator_port_executions
.
*/
- public final OperatorPortExecutions OPERATOR_PORT_EXECUTIONS = edu.uci.ics.texera.dao.jooq.generated.tables.OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS;
+ public final OperatorPortExecutions OPERATOR_PORT_EXECUTIONS = OperatorPortExecutions.OPERATOR_PORT_EXECUTIONS;
/**
* The table texera_db.project
.
*/
- public final Project PROJECT = edu.uci.ics.texera.dao.jooq.generated.tables.Project.PROJECT;
+ public final Project PROJECT = Project.PROJECT;
/**
* The table texera_db.project_user_access
.
*/
- public final ProjectUserAccess PROJECT_USER_ACCESS = edu.uci.ics.texera.dao.jooq.generated.tables.ProjectUserAccess.PROJECT_USER_ACCESS;
+ public final ProjectUserAccess PROJECT_USER_ACCESS = ProjectUserAccess.PROJECT_USER_ACCESS;
/**
* The table texera_db.public_project
.
*/
- public final PublicProject PUBLIC_PROJECT = edu.uci.ics.texera.dao.jooq.generated.tables.PublicProject.PUBLIC_PROJECT;
+ public final PublicProject PUBLIC_PROJECT = PublicProject.PUBLIC_PROJECT;
/**
* The table texera_db.user
.
*/
- public final User USER = edu.uci.ics.texera.dao.jooq.generated.tables.User.USER;
+ public final User USER = User.USER;
/**
* The table texera_db.user_activity
.
*/
- public final UserActivity USER_ACTIVITY = edu.uci.ics.texera.dao.jooq.generated.tables.UserActivity.USER_ACTIVITY;
+ public final UserActivity USER_ACTIVITY = UserActivity.USER_ACTIVITY;
/**
* The table texera_db.user_config
.
*/
- public final UserConfig USER_CONFIG = edu.uci.ics.texera.dao.jooq.generated.tables.UserConfig.USER_CONFIG;
+ public final UserConfig USER_CONFIG = UserConfig.USER_CONFIG;
/**
* The table texera_db.workflow
.
*/
- public final Workflow WORKFLOW = edu.uci.ics.texera.dao.jooq.generated.tables.Workflow.WORKFLOW;
+ public final Workflow WORKFLOW = Workflow.WORKFLOW;
/**
* The table texera_db.workflow_executions
.
*/
- public final WorkflowExecutions WORKFLOW_EXECUTIONS = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowExecutions.WORKFLOW_EXECUTIONS;
+ public final WorkflowExecutions WORKFLOW_EXECUTIONS = WorkflowExecutions.WORKFLOW_EXECUTIONS;
/**
* The table texera_db.workflow_of_project
.
*/
- public final WorkflowOfProject WORKFLOW_OF_PROJECT = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowOfProject.WORKFLOW_OF_PROJECT;
+ public final WorkflowOfProject WORKFLOW_OF_PROJECT = WorkflowOfProject.WORKFLOW_OF_PROJECT;
/**
* The table texera_db.workflow_of_user
.
*/
- public final WorkflowOfUser WORKFLOW_OF_USER = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowOfUser.WORKFLOW_OF_USER;
+ public final WorkflowOfUser WORKFLOW_OF_USER = WorkflowOfUser.WORKFLOW_OF_USER;
/**
* The table texera_db.workflow_user_access
.
*/
- public final WorkflowUserAccess WORKFLOW_USER_ACCESS = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowUserAccess.WORKFLOW_USER_ACCESS;
+ public final WorkflowUserAccess WORKFLOW_USER_ACCESS = WorkflowUserAccess.WORKFLOW_USER_ACCESS;
/**
* The table texera_db.workflow_user_clones
.
*/
- public final WorkflowUserClones WORKFLOW_USER_CLONES = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowUserClones.WORKFLOW_USER_CLONES;
+ public final WorkflowUserClones WORKFLOW_USER_CLONES = WorkflowUserClones.WORKFLOW_USER_CLONES;
/**
* The table texera_db.workflow_user_likes
.
*/
- public final WorkflowUserLikes WORKFLOW_USER_LIKES = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowUserLikes.WORKFLOW_USER_LIKES;
+ public final WorkflowUserLikes WORKFLOW_USER_LIKES = WorkflowUserLikes.WORKFLOW_USER_LIKES;
/**
* The table texera_db.workflow_version
.
*/
- public final WorkflowVersion WORKFLOW_VERSION = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowVersion.WORKFLOW_VERSION;
+ public final WorkflowVersion WORKFLOW_VERSION = WorkflowVersion.WORKFLOW_VERSION;
/**
* The table texera_db.workflow_view_count
.
*/
- public final WorkflowViewCount WORKFLOW_VIEW_COUNT = edu.uci.ics.texera.dao.jooq.generated.tables.WorkflowViewCount.WORKFLOW_VIEW_COUNT;
+ public final WorkflowViewCount WORKFLOW_VIEW_COUNT = WorkflowViewCount.WORKFLOW_VIEW_COUNT;
/**
* No further instances allowed
@@ -174,13 +173,7 @@ public Catalog getCatalog() {
@Override
public final List> getTables() {
- List result = new ArrayList();
- result.addAll(getTables0());
- return result;
- }
-
- private final List> getTables0() {
- return Arrays.>asList(
+ return Arrays.asList(
Dataset.DATASET,
DatasetUserAccess.DATASET_USER_ACCESS,
DatasetUserLikes.DATASET_USER_LIKES,
@@ -202,6 +195,7 @@ private final List> getTables0() {
WorkflowUserClones.WORKFLOW_USER_CLONES,
WorkflowUserLikes.WORKFLOW_USER_LIKES,
WorkflowVersion.WORKFLOW_VERSION,
- WorkflowViewCount.WORKFLOW_VIEW_COUNT);
+ WorkflowViewCount.WORKFLOW_VIEW_COUNT
+ );
}
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/DatasetUserAccessPrivilege.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/DatasetUserAccessPrivilege.java
deleted file mode 100644
index cdc1b72822f..00000000000
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/DatasetUserAccessPrivilege.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is generated by jOOQ.
- */
-package edu.uci.ics.texera.dao.jooq.generated.enums;
-
-
-import org.jooq.Catalog;
-import org.jooq.EnumType;
-import org.jooq.Schema;
-
-
-/**
- * This class is generated by jOOQ.
- */
-@SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public enum DatasetUserAccessPrivilege implements EnumType {
-
- NONE("NONE"),
-
- READ("READ"),
-
- WRITE("WRITE");
-
- private final String literal;
-
- private DatasetUserAccessPrivilege(String literal) {
- this.literal = literal;
- }
-
- @Override
- public Catalog getCatalog() {
- return null;
- }
-
- @Override
- public Schema getSchema() {
- return null;
- }
-
- @Override
- public String getName() {
- return "dataset_user_access_privilege";
- }
-
- @Override
- public String getLiteral() {
- return literal;
- }
-}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/WorkflowUserAccessPrivilege.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/PrivilegeEnum.java
similarity index 57%
rename from core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/WorkflowUserAccessPrivilege.java
rename to core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/PrivilegeEnum.java
index eb7f0f96eb0..06997a14e52 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/WorkflowUserAccessPrivilege.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/PrivilegeEnum.java
@@ -4,6 +4,8 @@
package edu.uci.ics.texera.dao.jooq.generated.enums;
+import edu.uci.ics.texera.dao.jooq.generated.TexeraDb;
+
import org.jooq.Catalog;
import org.jooq.EnumType;
import org.jooq.Schema;
@@ -13,7 +15,7 @@
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public enum WorkflowUserAccessPrivilege implements EnumType {
+public enum PrivilegeEnum implements EnumType {
NONE("NONE"),
@@ -23,27 +25,34 @@ public enum WorkflowUserAccessPrivilege implements EnumType {
private final String literal;
- private WorkflowUserAccessPrivilege(String literal) {
+ private PrivilegeEnum(String literal) {
this.literal = literal;
}
@Override
public Catalog getCatalog() {
- return null;
+ return getSchema().getCatalog();
}
@Override
public Schema getSchema() {
- return null;
+ return TexeraDb.TEXERA_DB;
}
@Override
public String getName() {
- return "workflow_user_access_privilege";
+ return "privilege_enum";
}
@Override
public String getLiteral() {
return literal;
}
+
+ /**
+ * Lookup a value of this EnumType by its literal
+ */
+ public static PrivilegeEnum lookupLiteral(String literal) {
+ return EnumType.lookupLiteral(PrivilegeEnum.class, literal);
+ }
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/ProjectUserAccessPrivilege.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/ProjectUserAccessPrivilege.java
deleted file mode 100644
index 180ae85380e..00000000000
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/ProjectUserAccessPrivilege.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is generated by jOOQ.
- */
-package edu.uci.ics.texera.dao.jooq.generated.enums;
-
-
-import org.jooq.Catalog;
-import org.jooq.EnumType;
-import org.jooq.Schema;
-
-
-/**
- * This class is generated by jOOQ.
- */
-@SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public enum ProjectUserAccessPrivilege implements EnumType {
-
- NONE("NONE"),
-
- READ("READ"),
-
- WRITE("WRITE");
-
- private final String literal;
-
- private ProjectUserAccessPrivilege(String literal) {
- this.literal = literal;
- }
-
- @Override
- public Catalog getCatalog() {
- return null;
- }
-
- @Override
- public Schema getSchema() {
- return null;
- }
-
- @Override
- public String getName() {
- return "project_user_access_privilege";
- }
-
- @Override
- public String getLiteral() {
- return literal;
- }
-}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/UserRole.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/UserRoleEnum.java
similarity index 59%
rename from core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/UserRole.java
rename to core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/UserRoleEnum.java
index b171b040320..01663851e9a 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/UserRole.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/enums/UserRoleEnum.java
@@ -4,6 +4,8 @@
package edu.uci.ics.texera.dao.jooq.generated.enums;
+import edu.uci.ics.texera.dao.jooq.generated.TexeraDb;
+
import org.jooq.Catalog;
import org.jooq.EnumType;
import org.jooq.Schema;
@@ -13,7 +15,7 @@
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public enum UserRole implements EnumType {
+public enum UserRoleEnum implements EnumType {
INACTIVE("INACTIVE"),
@@ -25,27 +27,34 @@ public enum UserRole implements EnumType {
private final String literal;
- private UserRole(String literal) {
+ private UserRoleEnum(String literal) {
this.literal = literal;
}
@Override
public Catalog getCatalog() {
- return null;
+ return getSchema().getCatalog();
}
@Override
public Schema getSchema() {
- return null;
+ return TexeraDb.TEXERA_DB;
}
@Override
public String getName() {
- return "user_role";
+ return "user_role_enum";
}
@Override
public String getLiteral() {
return literal;
}
+
+ /**
+ * Lookup a value of this EnumType by its literal
+ */
+ public static UserRoleEnum lookupLiteral(String literal) {
+ return EnumType.lookupLiteral(UserRoleEnum.class, literal);
+ }
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/Dataset.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/Dataset.java
index df1ec6af9ec..c89b70bc7a7 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/Dataset.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/Dataset.java
@@ -4,7 +4,6 @@
package edu.uci.ics.texera.dao.jooq.generated.tables;
-import edu.uci.ics.texera.dao.jooq.generated.Indexes;
import edu.uci.ics.texera.dao.jooq.generated.Keys;
import edu.uci.ics.texera.dao.jooq.generated.TexeraDb;
import edu.uci.ics.texera.dao.jooq.generated.tables.records.DatasetRecord;
@@ -16,17 +15,17 @@
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Identity;
-import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row6;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
+import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
-import org.jooq.types.UInteger;
/**
@@ -35,7 +34,7 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Dataset extends TableImpl {
- private static final long serialVersionUID = 1458628918;
+ private static final long serialVersionUID = 1L;
/**
* The reference instance of texera_db.dataset
@@ -53,38 +52,39 @@ public Class getRecordType() {
/**
* The column texera_db.dataset.did
.
*/
- public final TableField DID = createField(DSL.name("did"), org.jooq.impl.SQLDataType.INTEGERUNSIGNED.nullable(false).identity(true), this, "");
+ public final TableField DID = createField(DSL.name("did"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");
/**
* The column texera_db.dataset.owner_uid
.
*/
- public final TableField OWNER_UID = createField(DSL.name("owner_uid"), org.jooq.impl.SQLDataType.INTEGERUNSIGNED.nullable(false), this, "");
+ public final TableField OWNER_UID = createField(DSL.name("owner_uid"), SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column texera_db.dataset.name
.
*/
- public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, "");
+ public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(128).nullable(false), this, "");
/**
* The column texera_db.dataset.is_public
.
*/
- public final TableField IS_PUBLIC = createField(DSL.name("is_public"), org.jooq.impl.SQLDataType.TINYINT.nullable(false).defaultValue(org.jooq.impl.DSL.inline("1", org.jooq.impl.SQLDataType.TINYINT)), this, "");
+ public final TableField IS_PUBLIC = createField(DSL.name("is_public"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field("true", SQLDataType.BOOLEAN)), this, "");
/**
* The column texera_db.dataset.description
.
*/
- public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR(512).nullable(false), this, "");
+ public final TableField DESCRIPTION = createField(DSL.name("description"), SQLDataType.VARCHAR(512).nullable(false), this, "");
/**
* The column texera_db.dataset.creation_time
.
*/
- public final TableField CREATION_TIME = createField(DSL.name("creation_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("CURRENT_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP)), this, "");
+ public final TableField CREATION_TIME = createField(DSL.name("creation_time"), SQLDataType.TIMESTAMP(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.TIMESTAMP)), this, "");
- /**
- * Create a texera_db.dataset
table reference
- */
- public Dataset() {
- this(DSL.name("dataset"), null);
+ private Dataset(Name alias, Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private Dataset(Name alias, Table aliased, Field>[] parameters) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
}
/**
@@ -101,12 +101,11 @@ public Dataset(Name alias) {
this(alias, DATASET);
}
- private Dataset(Name alias, Table aliased) {
- this(alias, aliased, null);
- }
-
- private Dataset(Name alias, Table aliased, Field>[] parameters) {
- super(alias, null, aliased, parameters, DSL.comment(""));
+ /**
+ * Create a texera_db.dataset
table reference
+ */
+ public Dataset() {
+ this(DSL.name("dataset"), null);
}
public Dataset(Table child, ForeignKey key) {
@@ -115,36 +114,34 @@ public Dataset(Table child, ForeignKey k
@Override
public Schema getSchema() {
- return TexeraDb.TEXERA_DB;
- }
-
- @Override
- public List getIndexes() {
- return Arrays.asList(Indexes.DATASET_IDX_DATASET_NAME_DESCRIPTION, Indexes.DATASET_OWNER_UID, Indexes.DATASET_PRIMARY);
+ return aliased() ? null : TexeraDb.TEXERA_DB;
}
@Override
- public Identity getIdentity() {
- return Keys.IDENTITY_DATASET;
+ public Identity getIdentity() {
+ return (Identity) super.getIdentity();
}
@Override
public UniqueKey getPrimaryKey() {
- return Keys.KEY_DATASET_PRIMARY;
- }
-
- @Override
- public List> getKeys() {
- return Arrays.>asList(Keys.KEY_DATASET_PRIMARY);
+ return Keys.DATASET_PKEY;
}
@Override
public List> getReferences() {
- return Arrays.>asList(Keys.DATASET_IBFK_1);
+ return Arrays.asList(Keys.DATASET__DATASET_OWNER_UID_FKEY);
}
+ private transient User _user;
+
+ /**
+ * Get the implicit join path to the texera_db.user
table.
+ */
public User user() {
- return new User(this, Keys.DATASET_IBFK_1);
+ if (_user == null)
+ _user = new User(this, Keys.DATASET__DATASET_OWNER_UID_FKEY);
+
+ return _user;
}
@Override
@@ -178,7 +175,7 @@ public Dataset rename(Name name) {
// -------------------------------------------------------------------------
@Override
- public Row6 fieldsRow() {
+ public Row6 fieldsRow() {
return (Row6) super.fieldsRow();
}
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserAccess.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserAccess.java
index 21f0c20461c..4709b961e25 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserAccess.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserAccess.java
@@ -4,10 +4,9 @@
package edu.uci.ics.texera.dao.jooq.generated.tables;
-import edu.uci.ics.texera.dao.jooq.generated.Indexes;
import edu.uci.ics.texera.dao.jooq.generated.Keys;
import edu.uci.ics.texera.dao.jooq.generated.TexeraDb;
-import edu.uci.ics.texera.dao.jooq.generated.enums.DatasetUserAccessPrivilege;
+import edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum;
import edu.uci.ics.texera.dao.jooq.generated.tables.records.DatasetUserAccessRecord;
import java.util.Arrays;
@@ -15,17 +14,17 @@
import org.jooq.Field;
import org.jooq.ForeignKey;
-import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row3;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
+import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
-import org.jooq.types.UInteger;
/**
@@ -34,7 +33,7 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DatasetUserAccess extends TableImpl {
- private static final long serialVersionUID = -1056803018;
+ private static final long serialVersionUID = 1L;
/**
* The reference instance of texera_db.dataset_user_access
@@ -52,45 +51,47 @@ public Class getRecordType() {
/**
* The column texera_db.dataset_user_access.did
.
*/
- public final TableField DID = createField(DSL.name("did"), org.jooq.impl.SQLDataType.INTEGERUNSIGNED.nullable(false), this, "");
+ public final TableField DID = createField(DSL.name("did"), SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column texera_db.dataset_user_access.uid
.
*/
- public final TableField UID = createField(DSL.name("uid"), org.jooq.impl.SQLDataType.INTEGERUNSIGNED.nullable(false), this, "");
+ public final TableField UID = createField(DSL.name("uid"), SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column texera_db.dataset_user_access.privilege
.
*/
- public final TableField PRIVILEGE = createField(DSL.name("privilege"), org.jooq.impl.SQLDataType.VARCHAR(5).nullable(false).defaultValue(org.jooq.impl.DSL.inline("NONE", org.jooq.impl.SQLDataType.VARCHAR)).asEnumDataType(edu.uci.ics.texera.dao.jooq.generated.enums.DatasetUserAccessPrivilege.class), this, "");
+ public final TableField PRIVILEGE = createField(DSL.name("privilege"), SQLDataType.VARCHAR.nullable(false).defaultValue(DSL.field("'NONE'::texera_db.privilege_enum", SQLDataType.VARCHAR)).asEnumDataType(edu.uci.ics.texera.dao.jooq.generated.enums.PrivilegeEnum.class), this, "");
- /**
- * Create a texera_db.dataset_user_access
table reference
- */
- public DatasetUserAccess() {
- this(DSL.name("dataset_user_access"), null);
+ private DatasetUserAccess(Name alias, Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private DatasetUserAccess(Name alias, Table aliased, Field>[] parameters) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
}
/**
- * Create an aliased texera_db.dataset_user_access
table reference
+ * Create an aliased texera_db.dataset_user_access
table
+ * reference
*/
public DatasetUserAccess(String alias) {
this(DSL.name(alias), DATASET_USER_ACCESS);
}
/**
- * Create an aliased texera_db.dataset_user_access
table reference
+ * Create an aliased texera_db.dataset_user_access
table
+ * reference
*/
public DatasetUserAccess(Name alias) {
this(alias, DATASET_USER_ACCESS);
}
- private DatasetUserAccess(Name alias, Table aliased) {
- this(alias, aliased, null);
- }
-
- private DatasetUserAccess(Name alias, Table aliased, Field>[] parameters) {
- super(alias, null, aliased, parameters, DSL.comment(""));
+ /**
+ * Create a texera_db.dataset_user_access
table reference
+ */
+ public DatasetUserAccess() {
+ this(DSL.name("dataset_user_access"), null);
}
public DatasetUserAccess(Table child, ForeignKey key) {
@@ -99,35 +100,40 @@ public DatasetUserAccess(Table child, ForeignKey getIndexes() {
- return Arrays.asList(Indexes.DATASET_USER_ACCESS_PRIMARY, Indexes.DATASET_USER_ACCESS_UID);
+ return aliased() ? null : TexeraDb.TEXERA_DB;
}
@Override
public UniqueKey getPrimaryKey() {
- return Keys.KEY_DATASET_USER_ACCESS_PRIMARY;
- }
-
- @Override
- public List> getKeys() {
- return Arrays.>asList(Keys.KEY_DATASET_USER_ACCESS_PRIMARY);
+ return Keys.DATASET_USER_ACCESS_PKEY;
}
@Override
public List> getReferences() {
- return Arrays.>asList(Keys.DATASET_USER_ACCESS_IBFK_1, Keys.DATASET_USER_ACCESS_IBFK_2);
+ return Arrays.asList(Keys.DATASET_USER_ACCESS__DATASET_USER_ACCESS_DID_FKEY, Keys.DATASET_USER_ACCESS__DATASET_USER_ACCESS_UID_FKEY);
}
+ private transient Dataset _dataset;
+ private transient User _user;
+
+ /**
+ * Get the implicit join path to the texera_db.dataset
table.
+ */
public Dataset dataset() {
- return new Dataset(this, Keys.DATASET_USER_ACCESS_IBFK_1);
+ if (_dataset == null)
+ _dataset = new Dataset(this, Keys.DATASET_USER_ACCESS__DATASET_USER_ACCESS_DID_FKEY);
+
+ return _dataset;
}
+ /**
+ * Get the implicit join path to the texera_db.user
table.
+ */
public User user() {
- return new User(this, Keys.DATASET_USER_ACCESS_IBFK_2);
+ if (_user == null)
+ _user = new User(this, Keys.DATASET_USER_ACCESS__DATASET_USER_ACCESS_UID_FKEY);
+
+ return _user;
}
@Override
@@ -161,7 +167,7 @@ public DatasetUserAccess rename(Name name) {
// -------------------------------------------------------------------------
@Override
- public Row3 fieldsRow() {
+ public Row3 fieldsRow() {
return (Row3) super.fieldsRow();
}
}
diff --git a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserLikes.java b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserLikes.java
index ec7ef7aa30c..c739293dc8c 100644
--- a/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserLikes.java
+++ b/core/dao/src/main/scala/edu/uci/ics/texera/dao/jooq/generated/tables/DatasetUserLikes.java
@@ -4,7 +4,6 @@
package edu.uci.ics.texera.dao.jooq.generated.tables;
-import edu.uci.ics.texera.dao.jooq.generated.Indexes;
import edu.uci.ics.texera.dao.jooq.generated.Keys;
import edu.uci.ics.texera.dao.jooq.generated.TexeraDb;
import edu.uci.ics.texera.dao.jooq.generated.tables.records.DatasetUserLikesRecord;
@@ -14,17 +13,17 @@
import org.jooq.Field;
import org.jooq.ForeignKey;
-import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row2;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
+import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
+import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;
-import org.jooq.types.UInteger;
/**
@@ -33,7 +32,7 @@
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DatasetUserLikes extends TableImpl {
- private static final long serialVersionUID = 566607224;
+ private static final long serialVersionUID = 1L;
/**
* The reference instance of texera_db.dataset_user_likes
@@ -51,40 +50,42 @@ public Class getRecordType() {
/**
* The column texera_db.dataset_user_likes.uid
.
*/
- public final TableField UID = createField(DSL.name("uid"), org.jooq.impl.SQLDataType.INTEGERUNSIGNED.nullable(false), this, "");
+ public final TableField UID = createField(DSL.name("uid"), SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column texera_db.dataset_user_likes.did
.
*/
- public final TableField DID = createField(DSL.name("did"), org.jooq.impl.SQLDataType.INTEGERUNSIGNED.nullable(false), this, "");
+ public final TableField DID = createField(DSL.name("did"), SQLDataType.INTEGER.nullable(false), this, "");
- /**
- * Create a texera_db.dataset_user_likes
table reference
- */
- public DatasetUserLikes() {
- this(DSL.name("dataset_user_likes"), null);
+ private DatasetUserLikes(Name alias, Table aliased) {
+ this(alias, aliased, null);
+ }
+
+ private DatasetUserLikes(Name alias, Table aliased, Field>[] parameters) {
+ super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
}
/**
- * Create an aliased texera_db.dataset_user_likes
table reference
+ * Create an aliased texera_db.dataset_user_likes
table
+ * reference
*/
public DatasetUserLikes(String alias) {
this(DSL.name(alias), DATASET_USER_LIKES);
}
/**
- * Create an aliased texera_db.dataset_user_likes
table reference
+ * Create an aliased texera_db.dataset_user_likes
table
+ * reference
*/
public DatasetUserLikes(Name alias) {
this(alias, DATASET_USER_LIKES);
}
- private DatasetUserLikes(Name alias, Table aliased) {
- this(alias, aliased, null);
- }
-
- private DatasetUserLikes(Name alias, Table aliased, Field>[] parameters) {
- super(alias, null, aliased, parameters, DSL.comment(""));
+ /**
+ * Create a texera_db.dataset_user_likes
table reference
+ */
+ public DatasetUserLikes() {
+ this(DSL.name("dataset_user_likes"), null);
}
public DatasetUserLikes(Table child, ForeignKey key) {
@@ -93,35 +94,40 @@ public DatasetUserLikes(Table